Closed
Description
Compiler version
3.3.1
Minimized code
//> using scala "3.3.1"
//> using options -Wnonunit-statement -Werror
class Context
object Foo {
def run(program: Context ?=> String): Unit = ???
}
def bar(using Context): String = ???
@main def run = Foo.run:
bar
bar
Output - givens not available, no linting warn:
Compiling project (Scala 3.3.1, JVM)
[error] ./Foo.scala:13:6
[error] No given instance of type Context was found for parameter x$1 of method bar
[error] bar
[error] ^
[error] ./Foo.scala:14:6
[error] No given instance of type Context was found for parameter x$1 of method bar
[error] bar
[error] ^
Error compiling project (Scala 3.3.1, JVM)
Removing -Werror
causes the givens to be available again, and unused warn is reported:
Compiling project (Scala 3.3.1, JVM)
[warn] ./Foo.scala:13:3
[warn] unused value of type String
[warn] bar
[warn] ^^^
Compiled project (Scala 3.3.1, JVM)
Reported in VirtusLab/besom#200
Expectation
Givens should be available, and linting error should be reported.