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 running an experiment using the Scala standard library and I was modifying parts of it
to use the new experimental modularity feature (#20061) for annotating where type
parameters should be instantiated with singleton types. But the generated TASTy has
a cyclic reference somewhere so it all blows up.
I've managed to reproduce the issue by adding a new, dummy, class with the modularity Singletons
to the standard library. I'll try to reproduce on a smaller project later, but I'm not familiar with
TASTy serialization myself.
Compiler version
Latest main
Minimized code
Build changes:
diff --git a/build.sbt b/build.sbt
index f357044c91..d4d000e04d 100644
--- a/build.sbt
+++ b/build.sbt
@@ -37,6 +37,7 @@ val `community-build` = Build.`community-build`
val `sbt-community-build` = Build.`sbt-community-build`
val `scala3-presentation-compiler` = Build.`scala3-presentation-compiler`
val `scala3-presentation-compiler-bootstrapped` = Build.`scala3-presentation-compiler-bootstrapped`
+val `scala2-library-modularity` = Build.`scala2-library-modularity`
val sjsSandbox = Build.sjsSandbox
val sjsJUnitTests = Build.sjsJUnitTests
diff --git a/project/Build.scala b/project/Build.scala
index c1a8800421..1f4f84d4b0 100644
--- a/project/Build.scala
+++ b/project/Build.scala
@@ -1076,6 +1076,21 @@ object Build {
settings(scala2LibraryBootstrappedSettings).
settings(moduleName := "scala2-library")
// -Ycheck:all is set in project/scripts/scala2-library-tasty-mima.sh
+
+ /** Scala 2 library compiled by dotty using the latest published sources of the library.
+ *
+ * This version of the library is not (yet) TASTy/binary compatible with the Scala 2 compiled library.
+ */
+ lazy val `scala2-library-modularity` = project.in(file("scala2-library-modularity")).
+ withCommonSettings(Bootstrapped).
+ dependsOn(dottyCompiler(Bootstrapped) % "provided; compile->runtime; test->test").
+ settings(commonBootstrappedSettings).
+ settings(scala2LibraryBootstrappedSettings).
+ settings(moduleName := "scala2-library-checked").
+ settings(scalacOptions -= "-Yno:experimental").
+ settings(scalacOptions += "-language:experimental.modularity").
+ settings(scalacOptions += "-experimental")
+ // -Ycheck:all is set in project/scripts/scala2-library-tasty-mima.sh
/** Scala 2 library compiled by dotty using the latest published sources of the library.
*
Dummy class definition I added to List.scala that breaks TASTy.
// A dummy class for triggering the serialization errorfinalclassDummy[T:Singleton]() {
}
Output
I get a unpickler error followed by a subsequent crash.
I'm running an experiment using the Scala standard library and I was modifying parts of it
to use the new experimental modularity feature (#20061) for annotating where type
parameters should be instantiated with singleton types. But the generated TASTy has
a cyclic reference somewhere so it all blows up.
I've managed to reproduce the issue by adding a new, dummy, class with the modularity Singletons
to the standard library. I'll try to reproduce on a smaller project later, but I'm not familiar with
TASTy serialization myself.
Compiler version
Latest main
Minimized code
Build changes:
Dummy class definition I added to
List.scala
that breaks TASTy.Output
I get a unpickler error followed by a subsequent crash.
Crash:
Expectation
No crash, and no unpicker error.
The text was updated successfully, but these errors were encountered: