Add cross build for Scala 3 #386
Merged
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.
A first go at cross building for Scala 3.0.0-M1. Let's see what I missed or broke.
A few notes:
The default Scala.js version in
plugins.sbt
was changed to 1.3.1 since this seems to be the only version that works here with all Scala versions 2.11 through 3.0.0-M1. In particular, a fix to support Scala 3 in ScalaJSJUnitPlugin was just recently merged for the 1.3.1 release (Support Scala 3 in ScalaJSJUnitPlugin. scala-js/scala-js#4285)I don't know what (if anything) this change will break.
Scala 3 disallows ClassTag[Nothing] (Disallow Array[Nothing], Array[Null], ... to avoid ClassCastException in some cases scala3#1730)
The change to ArraySeqTest.check() is the only solution I could come up with in a reasonable amount of time that worked for all supported Scala versions.
ArraySeq.empty[T]
would work for Scala 2.13 and Scala 3, but not for Scala 2.11/2.12 since the signature in this library has anAnyRef
upper bound unlike the 2.13 stdlib.Perhaps someone has a better idea of what to do here.
Scala.js complained about the
@Test(timeout = 10000)
annotation inLazyListTest
when building with Scala 3:The error message is confusing because the
L
suffix was omitted but says it's unsupported. I added theL
suffix, and the error went away.Fixes #385