Aladdin - Scala Bugtracking
[#1171] project: compiler priority: low category: bug
submitter assigned to status date submitted
Burak Martin fixed 2007-06-09 01:07:04.0
subject minor parser bug related to @unchecked
code
object foo {
  val f = { case 1::2::Nil => 0 } : @unchecked
}
what happened
Exception in thread "main" java.lang.AssertionError: assertion failed:  match {
  case $colon$colon(1, $colon$colon(2, Nil)) => 0
}: @unchecked
        at scala.Predef$.assert(Predef.scala:90)
        at scala.tools.nsc.ast.Trees$ValDef.(Trees.scala:302)
        at scala.tools.nsc.ast.parser.TreeBuilder.makePatDef(TreeBuilder.scala:392)
        at scala.tools.nsc.ast.parser.Parsers$Parser.mkDefs$0(Parsers.scala:1881)
        at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$8.apply(Parsers.scala:1895)
        at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$8.apply(Parsers.scala:1895)
        at scala.List.flatMap(List.scala:986)
        at scala.tools.nsc.ast.parser.Parsers$Parser.patDefOrDcl(Parsers.scala:1895)
        at scala.tools.nsc.ast.parser.Parsers$Parser.defOrDcl(Parsers.scala:1848)
        at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$16.apply(Parsers.scala:2265)
        at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$16.apply(Parsers.scala:2265)
        at scala.tools.nsc.ast.parser.Parsers$Parser.joinComment(Parsers.scala:311)
        at scala.tools.nsc.ast.parser.Parsers$Parser.templateStatSeq(Parsers.scala:2265)
        at scala.tools.nsc.ast.parser.Parsers$Parser.templateBody(Parsers.scala:2162)
        at scala.tools.nsc.ast.parser.Parsers$Parser.templateBodyOpt(Parsers.scala:2170)
        at scala.tools.nsc.ast.parser.Parsers$Parser.templateOpt(Parsers.scala:2147)
        at scala.tools.nsc.ast.parser.Parsers$Parser.objectDef(Parsers.scala:2084)
        at scala.tools.nsc.ast.parser.Parsers$Parser.tmplDef(Parsers.scala:2035)
        at scala.tools.nsc.ast.parser.Parsers$Parser.tmplDefHooked(Parsers.scala:2021)
        at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$15.apply(Parsers.scala:2225)
        at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$15.apply(Parsers.scala:2225)
        at scala.tools.nsc.ast.parser.Parsers$Parser.joinComment(Parsers.scala:311)
        at scala.tools.nsc.ast.parser.Parsers$Parser.topStatSeq(Parsers.scala:2225)
        at scala.tools.nsc.ast.parser.Parsers$Parser.compilationUnit(Parsers.scala:2360)
        at scala.tools.nsc.ast.parser.Parsers$Parser.parse(Parsers.scala:130)
        at scala.tools.nsc.ast.parser.SyntaxAnalyzer$ParserPhase.apply(SyntaxAnalyzer.scala:20)
        at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:245)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$2.apply(Global.scala:234)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$2.apply(Global.scala:234)
        at scala.Iterator$class.foreach(Iterator.scala:364)
        at scala.collection.mutable.ListBuffer$$anon$0.foreach(ListBuffer.scala:245)
        at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:234)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:502)
        at scala.tools.nsc.Global$Run.compile(Global.scala:580)
        at scala.tools.nsc.Main$.process(Main.scala:61)
        at scala.tools.nsc.Main$.main(Main.scala:81)
        at scala.tools.nsc.Main.main(Main.scala)
what expected nothing special (once the crash is fixed, one could think about using this as a way to suppress incompleteness warning though, since there is no scrutinee to annotate)
[back to overview]
Changes of this bug report
Martin  edited on  2007-07-14 13:04:20.0