Aladdin - Scala Bugtracking
[#398] project: compiler priority: high category: bug
submitter assigned to status date submitted
Martin Burak fixed 2005-02-16 16:35:17.0
subject Pattern matching compiles incorrectly
code
object Test with Application {

  def f(ss: List[int]): unit = ss match {
    case List(1) => System.out.print("_");
    case x :: ss1 => System.out.print(x);
  }
  f(List(2));
}
what happened
Exception in thread "main" scala.MatchError: for object List(2) in 'cases.scala' at line 3
	
what expected prints "2"
[back to overview]
Changes of this bug report
Martin  edited on  2005-02-16 16:37:27.0
If I change the first pattern to
1 :: Nil
it compiles correctly.
Burak  edited on  2005-02-21 17:50:12.0