Aladdin - Scala Bugtracking
[#108] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Matthias Martin fixed 2003-09-03 00:43:09.0
subject Non-linear case patterns
code
object O {
  def foo(xs: List[Int]) = xs match {
    case x :: x => "first"
  }
}
what happened
The program compiles.
what expected Compiler error due to the non-linear pattern.
[back to overview]
Changes of this bug report
Martin  edited on  2003-09-03 17:51:16.0
I now implemented double definition checks which check that - only template members can be overloaded - all but one of a set of overloaded alternatives must be methods, defined by a `def'. We still need another check in erasure that detects that no two methods with the same name and signature have been generated.
Martin  edited on  2003-09-03 18:45:57.0