Aladdin - Scala Bugtracking
[#821] project: compiler priority: low category: feature
submitter assigned to status date submitted
Burak _ _ 2006-11-14 16:26:58.0
subject warning for equality mistakes
code
def f(x:AnyRef) = scala.Unit == x

def fInt(x:Int) = scala.Unit == x
def fChar(x:Char) = scala.Unit == x
...// x some value type that is not unit

def g(x:AnyVal, y:AnyRef) = x == y
what happened
what expected all functions constantly return false. The compiler ought to help the programmer realize that.
[back to overview]
Changes of this bug report
Burak  edited on  2006-11-14 16:27:25.0
I add this feature request as a reminder, as discussed in today's Scala meeting
Burak  edited on  2006-11-14 16:27:51.0