Aladdin - Scala Bugtracking
[#40] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Michel Philippe fixed 2003-06-18 13:28:51.0
subject crash after error in parser
code
object M {
  val v = for (1 == 0) yield 1;
}
what happened
an error message is correctly reported, because the contents of the for is invalid, but then an assertion error \
is raised:
Exception in thread "main" java.lang.AssertionError: null symbol
	at scalac.ast.Tree$ExtBad.setSymbol(Tree.java:624)
	at scalac.ast.StrictTreeCopier.Bad(StrictTreeCopier.java:38)
	at scalac.ast.Transformer.transform(Transformer.java:81)
	at scalac.ast.Tree.duplicate(Tree.java:597)
	at scalac.ast.parser.Parser.generator(Parser.java:970)
	at scalac.ast.parser.Parser.enumerators(Parser.java:953)
	at scalac.ast.parser.Parser.expr(Parser.java:698)
	at scalac.ast.parser.Parser.equalsExpr(Parser.java:649)
	at scalac.ast.parser.Parser.patDefOrSig(Parser.java:1534)
	at scalac.ast.parser.Parser.defOrDcl(Parser.java:1455)
	at scalac.ast.parser.Parser.templateStatSeq(Parser.java:1770)
	at scalac.ast.parser.Parser.templateBody(Parser.java:1698)
	at scalac.ast.parser.Parser.classTemplate(Parser.java:1653)
	at scalac.ast.parser.Parser.moduleDef(Parser.java:1636)
	at scalac.ast.parser.Parser.topDef(Parser.java:1507)
	at scalac.ast.parser.Parser.topStatSeq(Parser.java:1745)
	at scalac.ast.parser.Parser.compilationUnit(Parser.java:1856)
	at scalac.ast.parser.Parser.parse(Parser.java:48)
	at scalac.ast.parser.ParserPhase.apply(ParserPhase.java:35)
	at scalac.ast.parser.ParserPhase.apply(ParserPhase.java:30)
	at scalac.Global.compile(Global.java:268)
	at scalac.Global.compile(Global.java:244)
	at scalac.Main.main(Main.java:32)
what expected error message without assertion errors
[back to overview]
Changes of this bug report
Martin  edited on  2003-07-02 17:36:12.0
Philippe  edited on  2003-07-02 17:53:42.0
Fixed MetaStrictTreeCopier. The problem was that setSymbol was invoked even if the source tree's symbol was null.