effekt-lang / effekt-lang/effekt

False positive "Capture parameter count does not match () => Unit vs. () => Unit / { Foo }" when passing `box {}` to generic function

Open
#1,201 0 comments 0 reactions 0 assignees View on GitHub
area:typer
Dominant language
Scala
Stars
469
Forks
41
Avg merge
1d 16h
Merged PRs (30d)
23

Description

```effekt
interface Foo {}
def bar[C](b: C) = ()

def main() = {
bar[=> Unit / Foo at {}](box{})
}
```
Note that this works:
```effekt
interface Foo {}
def bar(b: => Unit / Foo at {}) = ()

def main() = {
bar(box{})
}
```
but this doesn't:
```effekt
interface Foo {}
def bar(b: => Unit / Foo at {}) = ()

def main() = {
val a = box {}
bar(a)
}
```
The best solution would be to just make all examples compile, meaning that `=> Unit at {}` is a subtype of `=> Unit / {...} at {}`, and similarly for all functions.

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.