-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area:experimental:ccCapture checking relatedCapture checking relateditype:bugitype:soundnessSoundness bug (it lets us compile code that crashes at runtime with a ClassCastException)Soundness bug (it lets us compile code that crashes at runtime with a ClassCastException)
Description
Compiler version
3.8.0
Minimized example
import language.experimental.captureChecking
import language.experimental.separationChecking
import caps.*
def par(p1: () => Unit, p2: () => Unit): Unit = ???
def test(c: () => Unit): Unit =
trait Runner:
def runPar(p2: () ->{c} Unit): Unit
class SomeRunner(p1: () => Unit) extends Runner:
def runPar(p2: () ->{c} Unit): Unit =
par(p1, p2)
val bad = (p1: () => Unit) =>
val r = SomeRunner(p1)
r
val runner: Runner^{c} = bad(c)
runner.runPar(c) // boom, will run `c` and `c` in parallel
Output
Compiles
Expectation
Should give an error because we end up doing a par
with c
and c
.
Metadata
Metadata
Assignees
Labels
area:experimental:ccCapture checking relatedCapture checking relateditype:bugitype:soundnessSoundness bug (it lets us compile code that crashes at runtime with a ClassCastException)Soundness bug (it lets us compile code that crashes at runtime with a ClassCastException)