effekt icon indicating copy to clipboard operation
effekt copied to clipboard

Check return type annotation of object operations

Open jiribenes opened this issue 1 year ago • 1 comments

Following up on #148, we should type check the return type annotation of object operations.

As of right now, we reject all return type annotations given by the user on an object operation. Instead, we should properly check both the return type and the given set of effects. There is some subtlety required to do this properly -- capability passing should be informed by the declared effects, not by the user-annotated effects. See the discussion in #148 for more details.

Relevant code to be changed: https://github.com/effekt-lang/effekt/blob/a6201f56e7c33d7674708d192e9ee39b41a2fc09/effekt/shared/src/main/scala/effekt/Typer.scala#L357-L368

jiribenes avatar Sep 27 '22 11:09 jiribenes