I have this little scala example:
object Test {
def add(x: Int, y: Int) = {
val z = x - y
x match {
case 0 => 0 - y
case 1 => 1 - y
case _ => x - y
}
x + y
}
def main(args: Array[String]) {
println(add(5, 6))
}
}
I feel that scala should warn about 'z' and the 'x match ...' being unused. I did not notice any compiler options to turn on more warnings. I'm using scala 2.10.1.
Thoughts?
java
compiler does not show a warning either. – Viridis"-Ywarn-value-discard"
compiler option. – Primeval