Aladdin - Scala Bugtracking
[#179] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Matthias Burak fixed 2003-10-07 01:45:50.0
subject Analyzer crash for pattern in parenthesis
code
case class One();
object Foo with Executable {
  def test(xs: List[Any]) = xs match {
    case List(((((One(), One())*) | (One(), One())), One())) =>
      Console.println("case")
    case _ =>
      Console.println("default");
  }
}
what happened
Crashes during semantic analysis:
Exception in thread "main" java.lang.AssertionError
        at scalac.typechecker.Analyzer.transformArgs(Analyzer.java:1688)
        at scalac.typechecker.Analyzer.transform(Analyzer.java:2292)
        at scalac.typechecker.Analyzer.transform(Analyzer.java:1730)
        at scalac.typechecker.Analyzer.transformCase(Analyzer.java:1526)
        at scalac.typechecker.Analyzer.transformVisitor(Analyzer.java:1509)
        at scalac.typechecker.Analyzer.transform(Analyzer.java:2276)
        at scalac.typechecker.Analyzer.transform(Analyzer.java:1730)
        at scalac.typechecker.Analyzer.transform(Analyzer.java:1745)
        at scalac.typechecker.Analyzer.defineSym(Analyzer.java:1027)
        at scalac.typechecker.Analyzer$LazyTreeType.complete(Analyzer.java:629)
        at scalac.symtab.Symbol.info(Symbol.java:762)
        at scalac.symtab.Symbol.initialize(Symbol.java:728)
        at scalac.typechecker.Analyzer.transform(Analyzer.java:1778)
        at scalac.typechecker.Analyzer.transform(Analyzer.java:1749)
        at scalac.typechecker.Analyzer.transformStatSeq(Analyzer.java:1552)
        at scalac.typechecker.Analyzer.transformTemplate(Analyzer.java:1611)
        at scalac.typechecker.Analyzer.transform(Analyzer.java:1825)
        at scalac.typechecker.Analyzer.transform(Analyzer.java:1749)
        at scalac.typechecker.Analyzer.transformStatSeq(Analyzer.java:1552)
        at scalac.typechecker.Analyzer.apply(Analyzer.java:111)
        at scalac.ast.Transformer.apply(Transformer.java:62)
        at scalac.typechecker.Analyzer.apply(Analyzer.java:59)
        at scalac.typechecker.AnalyzerPhase.apply(AnalyzerPhase.java:107)
        at scalac.Global.compile(Global.java:293)
        at scalac.Global.compile(Global.java:266)
        at scalac.Main.main(Main.java:32)
what expected Compiles without crash.
[back to overview]
Changes of this bug report
Burak  edited on  2003-10-28 14:34:28.0
fixed. an assertion in Analyzer was too restrictive. This entailed a change in UnCurry, which now adds a Sequence node if an Alternative is "sequenceValued" (see TreeInfo).