Closed as not planned
Description
Compiler version
3.5.2, 3.6.2
Minimized code
object Main {
def fun(): String = ""
def main(args: Array[String]): Unit = {
fun() // warning here
if (true) {
fun() // no warning
}
}
}
Compile with -Wnonunit-statement
Output
C:\Dev\Sandbox\src\main\scala\Main.scala:4:8
unused value of type String
fun()
Expectation
The warning should be given both on lines 4 and 6, but the discarded value on line 6 is silently ignored.