Soundness Bug with Capture
b-studios opened this issue · comments
Jonathan Immanuel Brachthäuser commented
interface Exc { def op(): Unit }
def read {t: Exc}: Unit = t.op()
def foo() {arr: Exc} = box {} { () => read {arr} }
def crashMe() = {
val cap = try {
foo {arr}
} with arr: Exc { def op() = resume(println("hey")) }
(unbox cap)()
}
It should be rejected (and will by the paper), but is accepted in the current implementation. Maybe something is broken in how the captures flow through an application.