-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Compiler version
3.7.3-RC1-bin-SNAPSHOT-nonbootstrapped-git-42fdd76
Minimized code
import language.experimental.captureChecking
import annotation.constructorOnly
import caps.*
trait IO:
def run(): Unit
case class Box[T](value: T)
def hideIO(io: IO^): IO =
class LocalIOBox extends Box(io), IO:
def run(): Unit = value.run()
val pure: IO = new LocalIOBox
pure
class IOBox(@constructorOnly io: IO^) extends Box(io), IO:
def run(): Unit = value.run()
def hideIO2(io: IO^): IO =
val pure: IO = new IOBox(io)
pure
Output
Compile success
Expectation
The constructor of *IOBox
should refine the parent field value
and charge io
to the capture set.