Closed
Description
Compiler version
3.6.0
Minimized example
class C
def test(x: C^) =
val f = () =>
def foo() =
x
()
println(s"hey: $x")
() => foo()
val _: () -> () ->{x} Unit = f // should be error, but compiles
()
Output
compiles
Expectation
An error, since the outer lambda also captures x
in its println statement.