effekt-lang / effekt-lang/effekt

Error messages referring to inferred capabilities are not helpful

Open
#135 1 comment 1 reaction 0 assignees View on GitHub
errormessage requires-design
Dominant language
Scala
Stars
469
Forks
41
Avg merge
1d 16h
Merged PRs (30d)
23

Description

In the following example the generated error message refers to an implicitly inferred capability. It is never bound and impossible to understand:

```
effect Yield(): Unit

def foo() = {
var x in global = 42;
x = x + 1
def bar(): Unit / {} = do Yield();
println(x)
fun() { bar() }
}

def main() = try {
foo()
} with Yield { resume(()) }
```

![image](https://user-images.githubusercontent.com/408265/189333690-ebebd6ed-818c-403b-af4f-9048aacf7560.png)

The inferred type of `foo` also mentions the capability (which is equally hard to understand)

![image](https://user-images.githubusercontent.com/408265/189333744-27c8d655-f290-4674-ba4a-d1bea46f5999.png)

We need a proper way to refer to capabilities that are introduced for effects.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.