Open
Description
Compiler version
3.3.1+ (tested on nightly as well)
Minimized code
This shows several places where it works and the one where it doesn't
//> using scala 3.nightly
//> using option -Wnonunit-statement
def method: List[Int] = List(25)
@main def repro =
method // WARNING here ✅
val _ = for
x <- method
_ = method // Nothing here ❌
yield x
method.flatMap: x =>
method.map: y=>
method // WARNING here ✅
List()
Output
// TODO add output here
Expectation
I expected a warning because it's a non-unit statement (?).