fix: Scala 3.8 syntax compat fixes and import cleanup#3074
Merged
Conversation
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
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 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
_wildcard type with?in scala-3 source directories (Platform.scala,ClusterReceptionistProtocol.scala)usingkeyword for implicit argument forwarding inByteIterator.scala(scala-3):getShort(using byteOrder)@uncheckedannotations for type-test patterns that cannot be checked at runtime inAskPattern.scalaandByteString.scalaapply _with explicit lambdaref => apply(ref)inPatterns.scala(4 occurrences)SortedSet.emptyimplicit ordering inSimpleDnsCache.scalaby binding ordering asimplicit valbefore calling.emptyAnyRef JPair AnyRefwithJPair[AnyRef, AnyRef]inConstantFun.scalaLogSourceimplicit val bindings forLoggingcalls inOps.scalaimplicit def selfSenderinSourceRefImpl.scalaLoggingfactory call inMultiNodeSpec.scalaFixedBufferSpec.scalaCallingThreadDispatcher.scalaoperators/index.mdSnapshotStorage.scalaResult
Code compiles cleanly with Scala 3.8 syntax requirements. No behavioral changes to the runtime.
Tests
References
None - proactive Scala 3.8 forward compatibility