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
Compilation error (None.get
) when adding private val
to a case class field
#12988
Comments
Unlike the PR code, the Scastie example is missing an |
Not sure what the scastie intends to convey, but the zio scala_bug branch I see the code is trying to sort case class params by correlating non-method param accessors (which have correct sorting) with case accessor methods (unsorted and name-mangled). A quick debug println shows the mismatch
it's looking for |
So this is the reproucer, right? object example {
final case class Toto[@specialized(Int) A] (
private val a: String,
b: A,
) {
@inline def theA: String = a
}
def toto[A](a: A): Toto[A] = Toto("", a)
} |
@lrytz Yes, I think that the minimal reproducer |
I should have said thanks for the reproductions. The inline is relevant. I took a look but have been occupied elsewhere. |
Scala version: 2.13.13
If we remove the
private val
of theprivate val headFiberId
the code compiles. It seems to me that thisprivate val headFiberId
is valid Scala code and should compileReproducer: guizmaii/zio#1
Note that I don't manage to reproduce the error in scastie: https://scastie.scala-lang.org/wynbilFLRTWlyVL3fjT7WQ
The text was updated successfully, but these errors were encountered: