fix: replace private[this] with private and =_ with explicit defaults#1068
Merged
Conversation
Motivation: Scala 3 deprecates `private[this]` (subsumed by `private`) and `= _` initializer syntax. These produce warnings that become errors under -Werror. Modification: - Replace `private[this]` with `private` across ~40 files - Replace `= _` with explicit defaults (`= null`, `= 0L`, etc.) across ~15 files - Fix refutable pattern in HttpHeaderParserSpec (val type annotation to asInstanceOf) Result: All modules compile cleanly on both Scala 2.13.18 and 3.3.8 with no deprecation warnings for these patterns. Tests: - sbt "++ 2.13 Test/compile" passes - sbt "++ 3.3 Test/compile" passes References: None - Scala 3 forward compatibility
This was referenced Jun 15, 2026
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.
Summary
private[this]withprivateacross ~40 files (Scala 3 deprecation:private[this]is subsumed byprivate)= _with explicit defaults (= null,= 0L, etc.) across ~15 files (Scala 3 deprecation)HttpHeaderParserSpec(valtype annotation →asInstanceOf)Details
These are purely mechanical changes to address Scala 3 deprecation warnings. No behavioral changes.
private[this]→privateAffects benchmarks, core engine classes, parsers, model classes, testkit, and test code.
= _→ explicit defaultsReplaces uninitialized var declarations with explicit defaults (
= nullfor reference types,= 0Lfor longs, etc.).Test fix
HttpHeaderParserSpec: refutable pattern invaldefinition (type annotation) replaced withasInstanceOf.Test plan
sbt "++ 2.13 Test/compile"passessbt "++ 3.3 Test/compile"passesMotivation
Scala 3 deprecates
private[this]and= _syntax. These changes ensure forward compatibility.Modification
Mechanical replacement of deprecated syntax across ~50 files.
Result
All modules compile cleanly on both Scala 2.13.18 and 3.3.8 with no deprecation warnings for these patterns.
Tests
sbt "++ 2.13 Test/compile"passessbt "++ 3.3 Test/compile"passesReferences
None - Scala 3 forward compatibility