refactor: replace private[this] with private and = _ with explicit defaults for Scala 3.8#3072
Merged
Merged
Conversation
…faults for Scala 3.8 Motivation: Scala 3.8 deprecates private[this] in favor of private, and deprecates uninitialized vars (= _) in favor of explicit default values. These deprecations cause compilation warnings under Scala 3.8. Modification: - Replace private[this] and protected[this] with private and protected across ~94 files in actor, actor-typed, bench-jmh, cluster-sharding-typed, persistence, remote, and stream modules - Replace = _ initializers with explicit defaults (= null, = None, = 0, = 0L, = false, etc.) in affected files - No behavioral changes; these are purely mechanical deprecation fixes Result: Code compiles cleanly under Scala 3.8 without private[this] or uninitialized var deprecation warnings. No runtime behavior changes. Tests: Not run - mechanical refactoring, compilation test sufficient References: None - proactive Scala 3.8 forward compatibility
Member
Author
|
@pjfanning I think this is ready. |
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.8 deprecates
private[this]in favor ofprivate, and deprecates uninitialized vars (= _) in favor of explicit default values. These deprecations cause compilation warnings under Scala 3.8.Modification
private[this]andprotected[this]withprivateandprotectedacross 94 files inactor,actor-typed,bench-jmh,cluster-sharding-typed,persistence,remote, andstreammodules= _initializers with explicit defaults (= null,= None,= 0,= 0L,= false, etc.) in affected filesResult
Code compiles cleanly under Scala 3.8 without
private[this]or uninitialized var deprecation warnings. No runtime behavior changes.Tests
References
None - proactive Scala 3.8 forward compatibility