-
Notifications
You must be signed in to change notification settings - Fork 21
NullPointerException in TASTy reader during compile when using Scala 3 modules from Scala 2.13.6 with scalacOptions += "-Ytasty-reader" #12420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Minimized to: build.sbtlazy val api = (project in file("api"))
.settings(
scalaVersion := "3.0.0",
)
lazy val client = (project in file("client"))
.dependsOn(api)
.settings(
scalaVersion := "2.13.6",
scalacOptions += "-Ytasty-reader",
) api/Lib.scalatrait HasId[+K] {
def id: K
}
trait Id[+T, K] {
def id: K
}
case class UserId(id: String) extends Id[User, String]
case class User(id: UserId) extends HasId[UserId]
class Bar[A <: HasId[Id[A, String]]](bar: A)
class Foo extends Bar(User(???)) client/Test.scalaobject Test {
def foo = new Foo
} |
There's a few JitPack snapshot dependencies in that repo, so this comment is just to give which commits (can sub the hash in where it says "master-SNAPSHOT", "v0.11-SNAPSHOT" etc) they are according to jitpack at the moment. As otherwise, if it takes a while to look into this and those snapshots move on, compile errors in the dependent modules could stop it reaching the play project's compile stage. veautiful: 6c2ac65049 Tom Grigg on gitter kindly mentions that he may have a more minimal example that can reproduce it however. |
Thanks for the report! and for the minimisation it looks like an issue of not being lazy enough in the tasty reader, so parameters are referenced before their symbol is created |
fix scala/bug#12420: complete LambdaType param symbols lazily
reproduction steps
using Scala 3.0.0 and 2.13.6,
Pushed as a commit of a project, as it is hard for me to produce a more minimal example (I don't know which Scala 3 file the TASTy reader is NPE'ing on)
https://github.com/assessory/assessory/tree/581e12dead9e22d71240fd64ae531d10d8c37a65
problem
Produces this NPE from within the compiler:
Expected behaviour: it tells me about the compile errors in my own code
Actual behaviour: the compiler breaks with an NPE in the tasty reader.
The text was updated successfully, but these errors were encountered: