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 looking into cross building Scala 2.13 / 3.3 targets and I've been playing with the 2_deps example. When I do the following tweaks:
diff --git a/examples/crossbuild/2_deps/BUILD b/examples/crossbuild/2_deps/BUILD
index ff04ca1..135fc0f 100644
--- a/examples/crossbuild/2_deps/BUILD
+++ b/examples/crossbuild/2_deps/BUILD
@@ -13,6 +13,7 @@ scala_library(
scala_library(
name = "lib",
srcs = ["lib_default.scala"],
+ scala_version = "3.3.1",
)
scala_binary(
diff --git a/examples/crossbuild/2_deps/bin.scala b/examples/crossbuild/2_deps/bin.scala
index f038de2..d70708c 100644
--- a/examples/crossbuild/2_deps/bin.scala
+++ b/examples/crossbuild/2_deps/bin.scala
@@ -1,3 +1,3 @@
object C extends App {
- println("Hello, world")
+ println("Hello, world: " + new B)
}
then bin213 fails to build:
error: error while loading B, Missing dependency 'Add -Ytasty-reader to scalac options to parse the TASTy in bazel-out/darwin_arm64-fastbuild/bin/2_deps/lib.jar(deps/B.class)', required by bazel-out/darwin_arm64-fastbuild/bin/2_deps/lib.jar(deps/B.class)
2_deps/bin.scala:4: error: deps.B does not have a constructor
println("Hello, world: " + new B)
^
Adding -Ytasty-reader doesn't help, produces a different error:
2_deps/bin.scala:2: error: could not find package scala.annotation.internal whilst reading annotation of package <empty>; perhaps it is missing from the classpath.
println("Hello, world: " + new B)
^
Yes, I've added it as a maven dependency and it works! Thank you!
Still, feels like this might be a common use case - partially migrating larger codebases to Scala 3. It is why I'm looking into it. So I'd like to suggest for consideration adding this as an example or as a note in the docs.
I'm looking into cross building Scala 2.13 / 3.3 targets and I've been playing with the 2_deps example. When I do the following tweaks:
then
bin213
fails to build:Adding
-Ytasty-reader
doesn't help, produces a different error:So, is 3 ← 2.13 backward compatibility not supported / broken, or am I missing something?
The text was updated successfully, but these errors were encountered: