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? Thanks!
As you can see here, "unused" warnings will be introduced in the next version of scala, 2.11.
You can try them using the last milestone.