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
"Trying to access the this of another class" or "symbol value x$4$1 does not exist" when compiling code involving anonymous functions, multiple parameter lists and default arguments #5720
Comments
Imported From: https://issues.scala-lang.org/browse/SI-5720?orig=1 |
@paulp said: class M(x0: Int = 1)(x1: Int = 1) {
def g(x2: Int = 1) = ()
}
object Test {
((null: Option[M]) getOrElse new M()()).g()
} |
@som-snytt said (edited on May 3, 2012 4:20:13 AM UTC): That's why uncurry (in making the Function) fails to update owner. And that's why lambda lift thinks the x$s are free. I'm about to see where to fix TNA (transformNamedAppl), and if that's it, I'll submit a pull, otherwise bounce the ball back. |
@paulp said: |
@som-snytt said: Also, it's probably too "ownerous" [failure to resist pun] to make lambda lift robust against bad ownership; but maybe a debug flag to sanity check it. |
@paulp said: |
@som-snytt said: |
@som-snytt said: |
@som-snytt said: |
this code
leads to Error: symbol value x$4$1 does not exist in C.model in 2.9.1 and 2.9.2
or something like the following in later versions
uncaught exception during compilation: java.lang.AssertionError
java.lang.AssertionError: assertion failed:
while compiling:
current phase: icode
library version: version 2.10.0-20120428-143539-774cd4f87b
compiler version: version 2.10.0-20120428-143539-774cd4f87b
reconstructed args:
Trying to access the this of another class: tree.symbol = class$read$ $iw$$iw$C,$read$ $iw$$iw$C$$anonfun$1 compilation unit:
ctx.clazz.symbol = anonymous class
at scala.Predef$.assert(Predef.scala:182)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$bac
kend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:944)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadQualifier(Ge
nICode.scala:1151)
The text was updated successfully, but these errors were encountered: