fix: fix compilation warnings across Scala 2.13 and 3.3 cross-builds#3297
Merged
Conversation
Motivation: Several deprecation and pattern match warnings were present across the codebase, including @serialversionuid on traits (Scala 3 warning text changed), unchecked type tests, unreachable cases, and invalid @nowarn filters. Modification: - Update @nowarn message filters for @serialversionuid to use broader regex matching both Scala 3.3 "does nothing" and older "has no effect" - Add @unchecked to type tests that can't be checked at runtime (ByteString, AskPattern) - Fix unreachable case in TlsGraphStage (sealed trait match) - Fix invalid @nowarn filter in bench-jmh benchmark - Update boilerplate template for generated Functions.scala Result: Clean compilation with zero warnings on both Scala 2.13.18 and 3.3.8 with -Dpekko.allwarnings=true. Tests: sbt -Dpekko.allwarnings=true "+test:compile" - passes with no warnings References: None - code quality improvement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Several compilation warnings were present across the codebase when building with
-Dpekko.allwarnings=true:@SerialVersionUID does nothing on a trait(Scala 3.3.8 changed the warning text from "has no effect" to "does nothing", causing existing@nowarnfilters to miss)IndexedSeq[Byte]in ByteString andInternalRecipientRef[Req]in AskPattern (pattern match type erasure)SslTlsOutboundexhaustively matched)@nowarnfiltercat=unused-paramsin bench-jmh benchmark (not a valid Scala 3 category)Modification
@nowarnmessage filters for@SerialVersionUIDto use broader regex(has no effect|does nothing)matching both Scala 3.3 and older warning text (17 source locations + boilerplate template)@uncheckedannotation to type tests that can't be checked at runtime due to type erasure (ByteStringaddAll, AskPatternask)case other =>tocase null =>in TlsGraphStage since the sealed trait match is exhaustive@nowarn("cat=unused-params")to@nowarn("msg=never used")in bench-jmh benchmarkFunctions.scalaResult
Clean compilation with zero Scala warnings on both Scala 2.13.18 and 3.3.8 with
-Dpekko.allwarnings=true.Tests
sbt -Dpekko.allwarnings=true "+test:compile"- passes with no Scala warningsReferences
None - code quality improvement