Aladdin - Scala Bugtracking
[#654] project: compiler priority: high category: bug
submitter assigned to status date submitted
Stephane Burak fixed 2006-07-11 16:14:00.0
subject java.lang.Error in TransMatch
code
case class Foo(i: Int, chars: Char*)
object test {
  Foo(0, 'a') match {
    case Foo(i, chars @ _*) =>
      Foo(i, chars.toList:_*)
    case _ =>
      null
  }
}
what happened
Exception in thread "main" java.lang.Error: head of empty list
        at scala.Predef$.error(Predef.scala:166)
        at scala.Nil$.head(List.scala:1084)
        at scala.Nil$.head(List.scala:1082)
        at scala.List.apply(List.scala:640)
        at scala.tools.nsc.matching.TransMatcher$TransMatch.isRegular1$0(TransMatcher.scala:227)
        at scala.tools.nsc.matching.TransMatcher$TransMatch.isRegular(TransMatcher.scala:268)
        at scala.tools.nsc.matching.TransMatcher$TransMatch.handle(TransMatcher.scala:291)
        at scala.tools.nsc.matching.TransMatcher$TransMatch.transform(TransMatcher.scala:364)

[...]
what expected
[back to overview]
Changes of this bug report
Burak  edited on  2006-07-12 14:24:45.0