scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

2.13.12 NoSuchMethodError for scala.tools.nsc.Reporting$PerRunReporting.warning #12869

Closed Veyronix closed 1 year ago

Veyronix commented 1 year ago

Reproduction steps

Problem

The project no longer compiles. Reason:

java.lang.NoSuchMethodError: 'void scala.tools.nsc.Reporting$PerRunReporting.warning(scala.reflect.internal.util.Position, java.lang.String, scala.tools.nsc.Reporting$WarningCategory, scala.reflect.internal.Symbols$Symbol)'

Adding a parameter with a default value to the warning method in Scala 2.13.12 made it not binary-compatible. Commit which introduced the problem https://github.com/scala/scala/commit/e445819e1490c27232f6a828fb832abbc675ded0

lrytz commented 1 year ago

Hello, the scala compiler is not binary compatible between releases. If you have a project that depends on the Scala compiler, or on scala.reflect.internal, you need to fully cross-build (https://www.scala-sbt.org/1.x/docs/Cross-Build.html#Overriding+the+publishing+convention) and build / release against every Scala minor version. See also https://docs.scala-lang.org/overviews/core/binary-compatibility-of-scala-releases.html#concretely.