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
java.lang.Error: no-symbol does not have owner with CPS-Plugin #3501
Comments
Imported From: https://issues.scala-lang.org/browse/SI-3501?orig=1
|
@TiarkRompf said: import scala.util.continuations._
object Test {
def capture(): Int @suspendable = 42
def loop(): Unit @suspendable = {
while (true) {
val y = foo()
val s = y // java.lang.Error: no-symbol does not have owner
}
// removing either 'val s = ' or replacing 'y' with
// something else will make it work
}
} |
@TiarkRompf said: |
@TiarkRompf said: |
@paulp said: % scalac -Ycheck-debug -Ycheck:all -P:continuations:enable a.scala
Created [REF(type AnyRef)]
[Not checkable: parser]
[Not checkable: namer]
[Not checkable: packageobjects]
[Now checking: typer]
[check: typer] 19 new symbols.
unhandled impoprt: import scala.util.continuations._ in a.scala
[Now checking: superaccessors]
unhandled impoprt: import scala.util.continuations._ in a.scala
[Now checking: pickler]
unhandled impoprt: import scala.util.continuations._ in a.scala
[Now checking: refchecks]
[Now checking: selectiveanf]
[check: selectiveanf] 4 new symbols.
[check: selectiveanf] a.scala:8: Expected owner method while$$1, found method loop: scala.reflect.generic.Trees$$ValDef / @scala.util.continuations.cpsSym <synthetic> val tmp1: Unit = {
@scala.util.continuations.cpsSym val y: Int = Test.this.capture();
val s: Int = y;
()
}
[Now checking: liftcode]
[check: liftcode] a.scala:8: Expected owner method while$$1, found method loop: scala.reflect.generic.Trees$$ValDef / @scala.util.continuations.cpsSym <synthetic> val tmp1: Unit = {
@scala.util.continuations.cpsSym val y: Int = Test.this.capture();
val s: Int = y;
()
}
[Now checking: selectivecps]
[check: selectivecps] 12 new symbols.
[check: selectivecps] a.scala:10: Expected owner method while$$1, found method loop: scala.reflect.generic.Trees$$ValDef / val s: Int = y
[...] |
@ingoem said:
|
Topher (topher.the.geek) said: |
Topher (topher.the.geek) said: patch -p0 -i ~/tmp/t3501.patch |
The following code raises the error:
// val s = sum(x, y) // java.lang.Error: no-symbol does not have owner
// x = s
x = sum(x,y) // WORKS
}
println("x: " + x)
}
}
}
{code}
The text was updated successfully, but these errors were encountered: