-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area:experimental:ccCapture checking relatedCapture checking relatedcc-experimentIntended to be merged with cc-experiment branch on originIntended to be merged with cc-experiment branch on originitype:bug
Description
Compiler version
Minimized example
def f(c: T^, d: T^) =
lazy val x: T^{c} = d; c
val f = () => xOutput
Compiling this with -Xprint:cc gives:
package <empty> {
@SourceFile("tests/new/test.scala") class T() extends Object() {}
final lazy module val test$package: test$package = new test$package()
@SourceFile("tests/new/test.scala") final module class test$package() extends
Object() {
private[this] type $this = test$package.type
private def writeReplace(): AnyRef =
new scala.runtime.ModuleSerializationProxy(classOf[test$package.type])
def f(c: T^, d: T^): Unit =
{
lazy val x: T^{c} =
{
d
c
}
val f: () ->{x} (ex$1: caps.Exists) -> T^{x} =
{
def $anonfun(): T^{x} = x
closure($anonfun)
}
()
}
}
}Expectation
f should also capture d, but this is not recorded.
Generally, we have spent no thought so far how to capture check lazy vals, and it looks interesting. Maybe someone wants to pick that up?
Metadata
Metadata
Assignees
Labels
area:experimental:ccCapture checking relatedCapture checking relatedcc-experimentIntended to be merged with cc-experiment branch on originIntended to be merged with cc-experiment branch on originitype:bug