Skip to content

refactor: replace private[this] with private and = _ with explicit defaults for Scala 3.8#3072

Merged
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:scala38-compat-deprecation-fixes
Jun 17, 2026
Merged

refactor: replace private[this] with private and = _ with explicit defaults for Scala 3.8#3072
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:scala38-compat-deprecation-fixes

Conversation

@He-Pin

@He-Pin He-Pin commented Jun 15, 2026

Copy link
Copy Markdown
Member

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

…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
@He-Pin He-Pin requested a review from pjfanning June 15, 2026 16:32
@He-Pin He-Pin added this to the 2.0.0-M4 milestone Jun 15, 2026
@He-Pin He-Pin requested review from Philippus and mdedetrich June 16, 2026 03:15
@He-Pin

He-Pin commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

@pjfanning I think this is ready.

@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 4749eda into apache:main Jun 17, 2026
9 checks passed
@He-Pin He-Pin deleted the scala38-compat-deprecation-fixes branch June 17, 2026 15:40
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