effekt-lang / effekt-lang/effekt
Unhelpful error on ambiguous type-parametrised capability
- Dominant language
- Scala
- Stars
- 469
- Forks
- 41
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 23
Description
The following program reports an error that "get[T] is not allowed in this context",
even though there are `get[A]` _and_ `get[B]` available in the context.
The real issue is, I assume, that there's no _unique_ capability in sight.
Related to #1194.
```scala
effect get[T](): Int
def foo[A, B](): Int / {get[A], get[B]} =
do get() // <- error: Effect get[T] is not allowed in this context.
```
and same error here:
```scala
effect get[T](): Int
effect got { body: [A, B] () => Int / {get[A], get[B]} }: Int
def foo[A, B]: Int / got = do got { [X, Y] () => do get() } // <- error: Effect get[T] is not allowed in this context.
```
and here:
```scala
effect get[T](): Int
def foo[A, B](): Int = try {
do get() // <- error: Effect get[T] is not allowed in this context.
} with get[A] { resume(42)
} with get[B] { resume(100) }
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.