Aladdin - Scala Bugtracking
[#1094] project: compiler priority: low category: bug
submitter assigned to status date submitted
Burak Burak fixed 2007-05-09 15:54:58.0
subject [contrib #461] Sequence pattern crash
code
def foo(ps : String*) = "Foo"
case class X(p : String, ps : String*)
def bar = {
    X("a", "b") match {
        case X(p, ps @ _*) =>
            foo(ps : _*)
    }
}
print(bar)
what happened
java.lang.Error: symbol value ps does not exist in $scala5cr1p7-haX0R.Main.bar$0
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$\
genLoad(GenICode.scala:869)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadArguments(GenICode.scala:1044)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$\
genLoad(GenICode.scala:789)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$\
genLoad(GenICode.scala:394)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$\
genLoad(GenICode.scala:886)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$\
genLoad(GenICode.scala:886)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$\
genLoad(GenICode.scala:442)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$\
genLoad(GenICode.scala:886)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$\
genLoad(GenICode.scala:442)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$\
genLoad(GenICode.scala:886)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:110)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$0.apply(GenICode.scala:69)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$0.apply(GenICode.scala:69)
        at scala.List.foreach(List.scala:699)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:69)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:132)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:87)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$0.apply(GenICode.scala:69)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$0.apply(GenICode.scala:69)
        at scala.List.foreach(List.scala:699)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:69)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:79)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:65)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.apply(GenICode.scala:61)
        at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:241)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$2.apply(Global.scala:230)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$2.apply(Global.scala:230)
        at scala.Iterator$class.foreach(Iterator.scala:369)
        at scala.collection.mutable.ListBuffer$$anon$0.foreach(ListBuffer.scala:245)
        at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:230)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.run(GenICode.scala:54)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:498)
        at scala.tools.nsc.Global$Run.compile(Global.scala:572)
        at scala.tools.nsc.CompileServer$.session(CompileServer.scala:132)
        at scala.tools.util.SocketServer$$anonfun$0.apply(SocketServer.scala:69)
        at scala.tools.util.SocketServer$$anonfun$0.apply(SocketServer.scala:69)
        at scala.util.Fluid.withValue(Fluid.scala:68)
        at scala.Console$.withOut(Console.scala:84)
        at scala.Console$.withOut(Console.scala:102)
        at scala.tools.util.SocketServer.run(SocketServer.scala:68)
        at scala.tools.nsc.CompileServer$.main(CompileServer.scala:173)
        at scala.tools.nsc.CompileServer.main(CompileServer.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:75)
        at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:106)
        at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
what expected Compiles and prints "Foo".
[back to overview]
Changes of this bug report
Burak  edited on  2007-05-09 15:55:39.0