Skip to content

Compilation error on Scala 3 #683

@NikKozh

Description

@NikKozh

Hi! We are migrating big project from Scala 2 to 3 and we have encountered problem with scalaxb sbt plugin - seems like it generates Scala 2 code, which results in errors like:

[error] 434 |  import Helper._
[error]     |                ^
[error]     |`_` is no longer supported for a wildcard import; use `*` instead
[error]     |This construct can be rewritten automatically under -rewrite -source future-migration.

For some reasons we can't use -rewrite -source flags, but even with them (in separate test project) there is still multiple warnings like:

[warn] 419 |        case that: DataWriter[_] =>
[warn]     |                   ^^^^^^^^^^^^^
[warn]     |                 pattern selector should be an instance of Matchable,,
[warn]     |                 but it has unmatchable type Any instead

Which makes compilation impossible with Xfatal-warnings flag.

From what I saw in this repo, it seems like Scala 3 should be supported, so maybe I am doing something wrong?

There is dependencies I use in build.sbt:

ThisBuild / scalaVersion := "3.4.1"

lazy val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "2.3.0"
lazy val scalaParser = "org.scala-lang.modules" %% "scala-parser-combinators" % "2.4.0"
lazy val jaxb = "javax.xml.bind" % "jaxb-api" % "2.3.1"
lazy val dispatchV = "2.0.0"
lazy val dispatch = "org.dispatchhttp" %% "dispatch-core" % dispatchV

(it's basically last versions for all needed dependencies from docs)

And plugins.sbt:

addSbtPlugin("org.scalaxb"          % "sbt-scalaxb"               % "1.12.2")

I can provide a little example project with reproducible error, if needed. Any help would be appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions