effekt icon indicating copy to clipboard operation
effekt copied to clipboard

No supertype allowed in handler return

Open marzipankaiser opened this issue 5 months ago • 1 comments

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().

marzipankaiser avatar Sep 24 '24 12:09 marzipankaiser