-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
@Sporarum mentioned this in https://users.scala-lang.org/t/using-context-function-parameter-by-name-and-not-by-type/10658.
Compiler version
3.4..3.7.3
Minimized code
def foo(f: (x: Int) ?=> Int) = f(using 0)
@main def Main = println(foo(x))Output
Compiles successfully, with x referring to the argument of the context function:
$ scala -S 3.4 ../test.scala
Compiling project (Scala 3.4.3, JVM (17))
Compiled project (Scala 3.4.3, JVM (17))
0Expectation
x should be not found, as in < 3.4:
$ scala -S 3.3 ../test.scala
Compiling project (Scala 3.3.7, JVM (17))
[error] /localhome/bovel/test.scala:2:30
[error] Not found: x
[error] @main def Main = println(foo(x))
[error] ^
Error compiling project (Scala 3.3.7, JVM (17))
Compilation failed