effekt
effekt copied to clipboard
No supertype allowed in handler return
The following program gives the annotated error:
interface Done {
def done(): Nothing
}
def main() = {
try {
do done()
} with Done {
def done() = () // Error: Expected Nothing but got Unit.
}
}
Is this the behaviour we want?
Note that this also disallows, e.g., a hole instead of do done()
.