Open
Description
Compiler version
Scala 3.2.2 and latest snapshot (250757732398b92cb6fc8f02e50526573f1ba2b9
).
Minimized code
import language.experimental.captureChecking
def fn(ap: String ?=> Int)(using str: String): {ap} Int = ap(using str)
Output
Compile error:
4 |def fn(ap: String ?=> Int)(using str: String): {ap} Int = ap(using str)
| ^^
| ap.apply(str): Int is not a legal element of a capture set
1 error found
It compiles as expected if ap
is a normal (non-context) function.
Expectation
Successful compilation, like with a normal function.