Skip to content

Add cross build for Scala 3 #386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 21, 2020
Merged

Add cross build for Scala 3 #386

merged 2 commits into from
Nov 21, 2020

Conversation

griggt
Copy link
Contributor

@griggt griggt commented Nov 17, 2020

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 an AnyRef 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 in LazyListTest when building with Scala 3:

    [error] 40 |  @Test(timeout = 10000) // scala/bug#6881
    [error]    |        ^^^^^^^^^^^^^^^
    [error]    |10000L is an unsupported argument for the JUnit @Test annotation in this position

    The error message is confusing because the L suffix was omitted but says it's unsupported. I added the L suffix, and the error went away.

Fixes #385

@SethTisue SethTisue self-assigned this Nov 17, 2020
@SethTisue
Copy link
Member

SethTisue commented Nov 19, 2020

Your changes LGTM. Thanks for tackling this!

I had originally added a 2.13.4 upgrade here, but I'll make that a separate PR, as LazyList needs a bit of work

I'll publish a new version soon: #388

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.

add a Scala 3 crossbuild
2 participants