Skip to content

Scala JS always uses CrossVersion.for3Use2_13 #1024

@JD557

Description

@JD557

Describe the bug

Scala JS always uses CrossVersion.for3Use2_13, even for libraries that only work with Scala 3.

Scastie snippet link

No response

To Reproduce

  1. Create a Scala.js project
  2. Set the Scala version to Scala 3
  3. Add a Scala 3 only library
  4. Notice that the library is included with CrossVersion.for3Use2_13

Expected behavior

When the selected Scala version is Scala 3, scastie should use Scala 3 libraries.

I think the issue is

def renderSbt(lib: ScalaDependency): String =
s"${renderSbtCross(lib)} cross CrossVersion.for3Use2_13"

Maybe it should look like

def renderSbt(lib: ScalaDependency): String = {
if (Some(lib) == runtimeDependency) renderSbtDouble(lib)
else if (lib.target.binaryScalaVersion.startsWith("2.13"))
s"${renderSbtDouble(lib)} cross CrossVersion.for3Use2_13"
else renderSbtDouble(lib)
}
? Not sure.

Screenshot ( Optional )

No response

Version

Scastie website

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions