Aladdin - Scala Bugtracking
[#148] project: compiler priority: high category: bug
submitter assigned to status date submitted
Burak Matthias fixed 2003-09-24 12:53:46.0
subject more specific subpatterns fail
code
object gu with Executable {

  def foo( l:Any ) = Pair( l, 1 ).match { 
    case Pair(x:java.lang.Object,1) => System.out.println("hello");
    case Pair(x:String, 2) => System.out.println("foo");
  }

  foo( "jashd" )
}
what happened
Exception in thread "main" java.lang.AssertionError: gu.foo.temp$4 not in {value temp$2=5, value l=1, value t
emp$0=2, value x=7, value x=6, variable $result$0=3, value temp$1=4}
	at scalac.backend.jvm.GenJVM.genLoad(GenJVM.java:421)
	at scalac.backend.jvm.GenJVM.gen(GenJVM.java:156)
	at scalac.backend.jvm.GenJVM.genLoad(GenJVM.java:224)
	at scalac.backend.jvm.GenJVM.genLoad(GenJVM.java:458)
	at scalac.backend.jvm.GenJVM.genLoad(GenJVM.java:465)
	at scalac.backend.jvm.GenJVM.genLoad(GenJVM.java:228)
	at scalac.backend.jvm.GenJVM.genLoad(GenJVM.java:458)
	at scalac.backend.jvm.GenJVM.genLoad(GenJVM.java:228)
	at scalac.backend.jvm.GenJVM.genLoad(GenJVM.java:458)
	at scalac.backend.jvm.GenJVM.genCond(GenJVM.java:700)
	at scalac.backend.jvm.GenJVM.genLoad(GenJVM.java:457)
	at scalac.backend.jvm.GenJVM.genLoad(GenJVM.java:228)
	at scalac.backend.jvm.GenJVM.gen(GenJVM.java:165)
	at scalac.backend.jvm.GenJVM.gen(GenJVM.java:199)
	at scalac.backend.jvm.GenJVM.gen(GenJVM.java:143)
	at scalac.backend.jvm.GenJVM.gen(GenJVM.java:138)
	at scalac.backend.jvm.GenJVM.translate(GenJVM.java:110)
	at scalac.backend.jvm.GenJVMPhase.apply(GenJVMPhase.java:45)
	at scalac.Global.compile(Global.java:293)
	at scalac.Global.compile(Global.java:266)
	at scalac.Main.main(Main.java:32)
what expected compile, and "hello" printed out.
[back to overview]
Changes of this bug report
Burak  edited on  2003-09-24 12:54:09.0
formatting
Matthias  edited on  2003-09-24 15:13:20.0