effekt
effekt copied to clipboard
Effectful signatures are not implemented for objects
It looks like we forgot to implement capability passing for the new object feature:
effect Exc(): Unit
interface MyClass {
def get(): Int / { Exc }
}
def impl = new MyClass {
def get() = { do Exc(); 42 }
}
The same mechanism does already work for bidirectional effects:
effect Exc(): Unit
interface MyClass {
def get(): Int / { Exc }
}
def impl() =
try { o.get() }
with o: MyClass {
def get() = { resume { do Exc(); 42 } }
}
with Exc { 0 }
we simply forgot to implement it for objects.
@jiribenes this is related to what we discussed before (#148).