Aladdin - Scala Bugtracking
[#1276] project: compiler priority: high category: bug
submitter assigned to status date submitted
Sean Burak fixed 2007-08-19 09:58:15.0
subject Pattern matcher lies
code
package test
object Go { 
  val NoContext = new Object
  def main(args : Array[String]) = {
    val x : Any = if (args.length == 0) NoContext else new Object  
    Console.println(x match {
    case that : AnyRef if this eq that => 0
    case NoContext => 1
    case _ => 2
    })
  }
}

what happened
prints 2
what expected prints 1
[back to overview]
Changes of this bug report
Burak  edited on  2007-08-19 12:16:06.0
fixed in rev 12565