Skip to content

fix: fix compilation warnings across Scala 2.13 and 3.3 cross-builds#3297

Merged
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:fix/fix-compilation-warnings
Jul 6, 2026
Merged

fix: fix compilation warnings across Scala 2.13 and 3.3 cross-builds#3297
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:fix/fix-compilation-warnings

Conversation

@He-Pin

@He-Pin He-Pin commented Jul 5, 2026

Copy link
Copy Markdown
Member

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 @nowarn filters to miss)
  • Unchecked type tests for IndexedSeq[Byte] in ByteString and InternalRecipientRef[Req] in AskPattern (pattern match type erasure)
  • Unreachable case in TlsGraphStage (sealed trait SslTlsOutbound exhaustively matched)
  • Invalid @nowarn filter cat=unused-params in bench-jmh benchmark (not a valid Scala 3 category)

Modification

  • Update all @nowarn message filters for @SerialVersionUID to use broader regex (has no effect|does nothing) matching both Scala 3.3 and older warning text (17 source locations + boilerplate template)
  • Add @unchecked annotation to type tests that can't be checked at runtime due to type erasure (ByteString addAll, AskPattern ask)
  • Change unreachable case other => to case null => in TlsGraphStage since the sealed trait match is exhaustive
  • Change invalid @nowarn("cat=unused-params") to @nowarn("msg=never used") in bench-jmh benchmark
  • Update boilerplate template for generated Functions.scala

Result

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 warnings

References

None - code quality improvement

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
@He-Pin
He-Pin requested a review from pjfanning July 6, 2026 03:39
@He-Pin He-Pin added this to the 2.0.0-M4 milestone Jul 6, 2026

@pjfanning pjfanning left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@He-Pin
He-Pin merged commit ce8e081 into apache:main Jul 6, 2026
9 checks passed
@He-Pin
He-Pin deleted the fix/fix-compilation-warnings branch July 6, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants