Compiler version
main
Minimized code
File 1:
import language.experimental.captureChecking
import caps.*
class IO extends SharedCapability:
def println(msg: String): Unit = ()
val io: IO = new IO
def assertPure(op: () -> Unit): Unit = ()
File 2:
import language.experimental.captureChecking
import caps.*
def test1(): Unit =
assertPure(() => io.println("hello")) // error, as expected
def test2(): Unit =
def test(): Unit = io.println("hello")
assertPure: () => // should be error, but ok
test()
Output
Only one error in test1.
Expectation
Both should be error.
Note that this is only triggered when the code is separate in two files. When test2 is in the same file with io, the error shows up as expected.
Compiler version
mainMinimized code
File 1:
File 2:
Output
Only one error in
test1.Expectation
Both should be error.
Note that this is only triggered when the code is separate in two files. When
test2is in the same file withio, the error shows up as expected.