Open
Description
Compiler version
3.3.5, 3.6.3
Minimized code
//> using scala 3.6.3
//> using options -Wnonunit-statement, -Xfatal-warnings
object Main {
def foo(): String = "foo"
def code = scala.compiletime.codeOf {
foo()
foo()
}
}
Output
Compiler warning / error:
unused value of type String
foo()
Expectation
This code should not emit any warnings as the foo()
statement is not discarded. This behaviour (checking for non-unit statements) is causing an issue for zio-test
users that have this warning enabled; see zio/zio#9233 and zio/zio#9552.