Open
Description
Compiler version
3.4.2
3.5 nightly
Minimized code
import language.experimental.captureChecking
class A:
val b: A = this
def test(a: A^, c: AnyRef^) =
val c1: A^{c} = a
val c2: A^{c} = a.b
Output
> scala-cli compile -S 3.4 Stest.scala
Compiling project (Scala 3.4.2, JVM (21))
[error] ./Stest.scala:249:19
[error] Found: (a : A^)
[error] Required: A^{c}
[error] val c1: A^{c} = a
[error] ^
Error compiling project (Scala 3.4.2, JVM (21))
Compilation failed
Expectation
a.b
should capture a
, and both c1
and c2
should produce errors.