You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to compile with both the -Werror and -Xsource:3.0 compiler flags in preparation for Scala 3. However, the generated code gives warnings, which -Werror treats as errors. An example,
[warn] .../target/scala-2.13/src_managed/.../Color.scala: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method unary_!,
[warn] or remove the empty argument list from its definition (Java-defined methods are exempt)
[warn] In Scala 3, an unapplied method like this will be eta-expanded into a function.
[warn] lazy val values = scala.collection.immutable.Seq(RED, GREEN, BLUE)
I've tried enabling Xsource:3.0 and work through the warnings. I might be wrong, but my impression is that many of the warnings are spurious. I filed scala/bug#11889 and scala/bug#11890.
Given that the bugs reported are pretty obvious and Xsource:3.0 is rarely referenced online, I am suspecting this is not the best way to ensure source compatibility. Probably better just to try and compile with Scala 3.
BTW, what's the context of this Scala 3 preparation? Generally, you can always generate ScalaPB source code in a sub-project, compile in Scala 2 and depend on it from a Scala 3 project.
Based on https://gitter.im/lampepfl/dotty?at=5e510c533ca8a67fb80f4c82 I am closing this issue, as Xsource:3.0 doesn't provide adequate indication for Scala 3.0 compatibility. Happy to continue the discussion on how to achieve what you are trying to accomplish.
Based on https://gitter.im/lampepfl/dotty?at=5e510c533ca8a67fb80f4c82 I am closing this issue, as Xsource:3.0 doesn't provide adequate indication for Scala 3.0 compatibility. Happy to continue the discussion on how to achieve what you are trying to accomplish.
I'm trying to compile with both the
-Werror
and-Xsource:3.0
compiler flags in preparation for Scala 3. However, the generated code gives warnings, which-Werror
treats as errors. An example,For the protobuf enum,
Versions,
The text was updated successfully, but these errors were encountered: