Compiler version
3.8
Minimized example
class IO extends caps.SharedCapability:
def write(): Unit = ()
class C(val io: IO):
val c = C(io)
val l1 = () => c.io.write()
val _: () -> Unit = l1 // should be error
Output
Compiles
Expectation
l1 should have type () ->{c.io} Unit, so the last line should not typecheck.