Aladdin - Scala Bugtracking
[#129] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Matthias Burak fixed 2003-09-11 14:24:33.0
subject Pattern typechecking too liberal
code
case class PT(x: PT) {
  def foo(x: Any) = x match {
    case PT(a@PT(a)) =>
  }
}
what happened
Exception in thread "main" scalac.ApplicationError: cannot handle a @ PT(a)
        at scalac.transformer.matching.AlgebraicMatcher.patternNode(AlgebraicMatcher.java:225)
        at scalac.transformer.matching.AlgebraicMatcher.enter1(AlgebraicMatcher.java:309)
        at scalac.transformer.matching.PatternMatcher.enter(PatternMatcher.java:522)
        at scalac.transformer.matching.AlgebraicMatcher.enter1(AlgebraicMatcher.java:344)
        at scalac.transformer.matching.AlgebraicMatcher.addCase(AlgebraicMatcher.java:122)
        at scalac.transformer.matching.AlgebraicMatcher.addCase(AlgebraicMatcher.java:112)
        at scalac.transformer.matching.AlgebraicMatcher.construct(AlgebraicMatcher.java:57)
        at scalac.transformer.matching.AlgebraicMatcher.construct(AlgebraicMatcher.java:46)
        at scalac.transformer.TransMatch.transform(TransMatch.java:103)
        at scalac.transformer.TransMatch.transform(TransMatch.java:125)
        at scalac.transformer.OwnerTransformer.transform(OwnerTransformer.java:41)
        at scalac.transformer.OwnerTransformer.transform(OwnerTransformer.java:116)
        at scalac.transformer.TransMatch.transform(TransMatch.java:136)
        at scalac.transformer.OwnerTransformer.transform(OwnerTransformer.java:41)
        at scalac.transformer.OwnerTransformer.transformTemplateStat(OwnerTransformer.java:87)
        at scalac.transformer.OwnerTransformer.transformTemplateStats(OwnerTransformer.java:76)
        at scalac.transformer.OwnerTransformer.transform(OwnerTransformer.java:68)
        at scalac.transformer.OwnerTransformer.transform(OwnerTransformer.java:100)
        at scalac.transformer.TransMatch.transform(TransMatch.java:136)
        at scalac.ast.Transformer.transform(Transformer.java:276)
        at scalac.transformer.OwnerTransformer.apply(OwnerTransformer.java:35)
        at scalac.transformer.TransMatch.apply(TransMatch.java:92)
        at scalac.transformer.TransMatchPhase.apply(TransMatchPhase.java:33)
        at scalac.Global.compile(Global.java:293)
        at scalac.Global.compile(Global.java:266)
        at scalac.Main.main(Main.java:32)
what expected Rejects the program with a regular error message.
[back to overview]
Changes of this bug report
Burak  edited on  2003-09-12 15:31:51.0
says this now
failingPatterns.scala:10: recursive patterns not allowed
        case PT(a@PT(a)) =>