There is one particular issue in scala which bites me every time. and each time it bites me ... it bites very hard...
why does this line compile
val x = "10" if (x != 10) { print("do something") } This line compiles and executes but for a "typesafe" language like scala ... this line should result in an compile error
===operator to get what you want. stackoverflow.com/a/30243825/408047610does not equal to"10", so the result you are getting is correct. Why do you think it should be impossible to compare objects of different types?==is simply a method, not an operator, how would you do it differently?