effekt-lang / effekt-lang/effekt
"Effects need to be fully known" when calling effectful function that uses generic effect referencing input block type
- Dominant language
- Scala
- Stars
- 469
- Forks
- 41
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 23
Description
Both examples intentionally don't specify effects in `bar2` to show that this issue remains even if #1189 is fixed
```effekt
effect Foo[C]: Unit
def bar[T](t: T): Unit / Foo[T] = do Foo[T]
def f(): Unit = ()
def bar2() = bar(box f) // Effects need to be fully known, but effect Foo[() => Unit at ?C]'s type parameter(s) ?XXXXX could not be inferred.
```
Obviously, I can just specify the type parameter, but it's still a failure of type inference. This doesn't happen if, instead of a boxed block type , I pass in a normal value type (like an Int).
The weirder case is this:
```effekt
effect Foo[C]: Unit
def bar{this: Region}: Unit / Foo[=> Unit at this] = do Foo[=> Unit at this]
def bar2{this: Region} = bar{this} // Effects need to be fully known, but effect Foo[() => Unit at ?C]'s type parameter(s) ?XXXXX could not be inferred.
```
I'm surprised that `bar` even compiles (the return type is not even necessary, so perhaps that's why this compiles vs something like #1207). Unsure if that's intentional. Regardless, `bar`, AFAICT, cannot be called.
Not sure if these 2 have the same underlying issue or not.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.