fix: Scala 3.9 compatibility fixes#1074
Merged
Merged
Conversation
Motivation: sbt lint reported 45 unused keys across sub-projects. Modification: Add projectInfoVersion, mimaReportSignatureProblems, autoAPIMappings, and unidocProjectFilter to excludeLintKeys in project/Common.scala globalSettings. Result: sbt lint warnings resolved. Tests: - sbt "http-core / compile; http / compile; parsing / compile" - sbt lint warnings resolved - sbt "http-caching / compile; http-cors / compile; http-testkit / compile" - sbt lint warnings resolved References: None - build configuration cleanup
Motivation: Scala 3.9.0-RC1 introduces several breaking changes: 1. -language:_ wildcard option is no longer accepted 2. -Yfuture-lazy-vals option removed (now default behavior) 3. -Ywarn-dead-code is Scala 2 only 4. Context bound desugaring changes, breaking explicit ClassTag/Tuple/ LogSource passing patterns Modification: - build.sbt: make -language:_ conditional on Scala 3 < 3.9 - project/Common.scala: move -Ywarn-dead-code to Scala 2 only, conditionally include -Yfuture-lazy-vals for Scala 3 < 3.9 - HttpMessage.scala, RejectionHandler.scala, PredefinedToResponseMarshallers.scala: use implicit val ClassTag instead of context bound [T: ClassTag] - Directive.scala, BasicDirectives.scala, PathMatcher.scala: use implicit val Tuple instead of context bound [L: Tuple] - PoolInterface.scala, StageLoggingWithOverride.scala: use implicit val LogSource instead of explicit passing Result: pekko-http parsing, http-core, http, and http-testkit modules compile cleanly with Scala 3.9.0-RC1. Tests: - sbt "++3.9.0-RC1!; parsing/compile; http-core/compile; http/compile; http-testkit/compile" passes References: None - Scala 3.9 forward compatibility
pjfanning
reviewed
Jun 19, 2026
Motivation: The same scalacOptions block for `-language:_` (excluded on Scala 3.9+) was repeated inline in 3 places in build.sbt. Modification: Add `Common.notOnScala39Plus` helper and replace all 3 inline blocks. Result: Single source of truth for the Scala 3.9+ language option exclusion. Tests: Not run - build config only References: Refs apache#1074
He-Pin
commented
Jun 19, 2026
He-Pin
left a comment
Member
Author
There was a problem hiding this comment.
Done. Extracted notOnScala39Plus helper in Common.scala and replaced all 3 inline blocks.
Motivation: The previous commit used unqualified `notOnScala39Plus` which is not in scope in build.sbt, causing compilation failure. Modification: Prefix all 3 call sites with `Common.` and run scalafmt. Result: build.sbt compiles successfully with the shared helper. Tests: Not run - build config fix References: Refs apache#1074
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
Scala 3.9.0-RC1 introduces several breaking changes:
-language:_wildcard option is no longer accepted-Yfuture-lazy-valsoption removed (behavior is now default)-Ywarn-dead-codeis Scala 2 onlyClassTag/Tuple/LogSourcepassing patternsModification
-language:_conditional on Scala 3 minor < 9-Ywarn-dead-codeto Scala 2 only, conditionally include-Yfuture-lazy-valsfor Scala 3 < 3.9implicit val ClassTaginstead of context bound[T: ClassTag]implicit val Tupleinstead of context bound[L: Tuple]implicit val LogSourceinstead of explicit passingResult
pekko-http
parsing,http-core,http, andhttp-testkitmodules compile cleanly with Scala 3.9.0-RC1.Tests
sbt "++3.9.0-RC1!; parsing/compile; http-core/compile; http/compile; http-testkit/compile"passesReferences
None - Scala 3.9 forward compatibility