Skip to content

fix: Scala 3.8 syntax compat fixes and import cleanup#3074

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

fix: Scala 3.8 syntax compat fixes and import cleanup#3074
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:scala38-compat-syntax-fixes

Conversation

@He-Pin

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

Copy link
Copy Markdown
Member

Motivation

Scala 3.8 introduces stricter syntax requirements and new warnings for patterns that will be removed in future versions. Several code patterns need updates for forward compatibility.

Modification

  • Replace _ wildcard type with ? in scala-3 source directories (Platform.scala, ClusterReceptionistProtocol.scala)
  • Add explicit using keyword for implicit argument forwarding in ByteIterator.scala (scala-3): getShort(using byteOrder)
  • Add @unchecked annotations for type-test patterns that cannot be checked at runtime in AskPattern.scala and ByteString.scala
  • Replace eta expansion syntax apply _ with explicit lambda ref => apply(ref) in Patterns.scala (4 occurrences)
  • Fix SortedSet.empty implicit ordering in SimpleDnsCache.scala by binding ordering as implicit val before calling .empty
  • Replace infix type syntax AnyRef JPair AnyRef with JPair[AnyRef, AnyRef] in ConstantFun.scala
  • Add LogSource implicit val bindings for Logging calls in Ops.scala
  • Add implicit def selfSender in SourceRefImpl.scala
  • Fix Logging factory call in MultiNodeSpec.scala
  • Fix discard result pattern in FixedBufferSpec.scala
  • Import reordering and formatting across ~35 files for scalafmt compliance
  • Fix Scaladoc apostrophe in CallingThreadDispatcher.scala
  • Fix doc reference "Java 8" to "Java" in operators/index.md
  • Remove unused import in SnapshotStorage.scala

Result

Code compiles cleanly with Scala 3.8 syntax requirements. No behavioral changes to the runtime.

Tests

  • Not run - syntax compat fixes, verified by cross-compilation

References

None - proactive Scala 3.8 forward compatibility

Motivation:
Scala 3.8 introduces stricter syntax requirements and new warnings for
patterns that will be removed in future versions. Several code patterns
need updates for forward compatibility.

Modification:
- Replace _ wildcard type with ? in scala-3 source directories
  (Platform.scala, ClusterReceptionistProtocol.scala)
- Add explicit using keyword for implicit argument forwarding in
  ByteIterator.scala (scala-3): getShort(using byteOrder)
- Add @unchecked annotations for type-test patterns that cannot be
  checked at runtime in AskPattern.scala and ByteString.scala
- Replace eta expansion syntax apply _ with explicit lambda
  ref => apply(ref) in Patterns.scala (4 occurrences)
- Fix SortedSet.empty implicit ordering in SimpleDnsCache.scala by
  binding ordering as implicit val before calling .empty
- Replace infix type syntax AnyRef JPair AnyRef with JPair[AnyRef, AnyRef]
  in ConstantFun.scala
- Add LogSource implicit val bindings for Logging calls in Ops.scala
- Add implicit def selfSender in SourceRefImpl.scala
- Fix Logging factory call in MultiNodeSpec.scala
- Fix discard result pattern in FixedBufferSpec.scala
- Import reordering and formatting across ~35 files for scalafmt
  compliance
- Fix Scaladoc apostrophe in CallingThreadDispatcher.scala
- Fix doc reference "Java 8" to "Java" in operators/index.md
- Remove unused import in SnapshotStorage.scala

Result:
Code compiles cleanly with Scala 3.8 syntax requirements. No behavioral
changes to the runtime.

Tests:
Not run - syntax compat fixes, verified by cross-compilation

References:
None - proactive Scala 3.8 forward compatibility
@He-Pin He-Pin requested a review from pjfanning June 15, 2026 17:36

@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

@pjfanning pjfanning added this to the 2.0.0-M4 milestone Jun 15, 2026
@He-Pin He-Pin merged commit ee6965c into apache:main Jun 15, 2026
9 checks passed
@He-Pin He-Pin deleted the scala38-compat-syntax-fixes branch June 15, 2026 19:29
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