Aladdin - Scala Bugtracking
[#183] project: compiler priority: low category: bug
submitter assigned to status date submitted
Philippe Martin fixed 2003-10-07 10:12:57.0
subject Crash in RefCheck due to late parsing
code
object Test {
  new Foo(0);
  class Foo(x: Int);
}
what happened
Exception in thread "main" java.lang.AssertionError: cannot create instance of Throw after phase analyzer, curre\
nt phase is refcheck
	at scalac.checkers.CheckTreeNodes.check(CheckTreeNodes.java:555)
	at scalac.checkers.CheckTreeNodes.checkNode(CheckTreeNodes.java:815)
	at scalac.ast.Tree$Throw.(Tree.java:319)
	at scalac.ast.DefaultTreeFactory.Throw(DefaultTreeFactory.java:221)
	at scalac.ast.parser.Parser.expr(Parser.java:882)
	at scalac.ast.parser.Parser.expr(Parser.java:806)
	at scalac.ast.parser.Parser.equalsExpr(Parser.java:774)
	at scalac.ast.parser.Parser.funDefOrDcl(Parser.java:1769)
	at scalac.ast.parser.Parser.defOrDcl(Parser.java:1664)
	at scalac.ast.parser.Parser.templateStatSeq(Parser.java:1984)
	at scalac.ast.parser.Parser.templateBody(Parser.java:1911)
	at scalac.ast.parser.Parser.classTemplate(Parser.java:1866)
	at scalac.ast.parser.Parser.objectDef(Parser.java:1849)
	at scalac.ast.parser.Parser.clsDef(Parser.java:1699)
	at scalac.ast.parser.Parser.topStatSeq(Parser.java:1960)
	at scalac.ast.parser.Parser.compilationUnit(Parser.java:2056)
	at scalac.ast.parser.Parser.parse(Parser.java:54)
	at scalac.ast.parser.ParserPhase.apply(ParserPhase.java:33)
	at scalac.symtab.SourceCompleter.complete(SourceCompleter.java:42)
	at scalac.symtab.Symbol.info(Symbol.java:762)
	at scalac.symtab.Symbol.type(Symbol.java:886)
	at scalac.typechecker.ImportList.importType(ImportList.java:45)
	at scalac.typechecker.ImportList.importedSymbol(ImportList.java:53)
	at scalac.typechecker.Analyzer.transformIdent(Analyzer.java:1387)
	at scalac.typechecker.Analyzer.transform(Analyzer.java:2427)
	at scalac.typechecker.Analyzer.transform(Analyzer.java:1749)
	at scalac.typechecker.Analyzer.defineSym(Analyzer.java:1038)
	at scalac.typechecker.Analyzer$LazyTreeType.complete(Analyzer.java:629)
	at scalac.symtab.Symbol.info(Symbol.java:762)
	at scalac.symtab.Type$Map.map(Type.java:862)
	at scalac.symtab.Type$Map.map(Type.java:904)
	at scalac.symtab.Type$Map.map(Type.java:898)
	at scalac.symtab.Type$Map.map(Type.java:835)
	at scalac.symtab.Type$AsSeenFromMap.apply(Type.java:1078)
	at scalac.symtab.Type.asSeenFrom(Type.java:1125)
	at scalac.symtab.Type.memberType(Type.java:1143)
	at scalac.ast.TreeGen.Select(TreeGen.java:281)
	at scalac.ast.TreeGen.mkRef(TreeGen.java:220)
	at scalac.typechecker.Analyzer.transform(Analyzer.java:2209)
	at scalac.typechecker.Analyzer.transform(Analyzer.java:1730)
	at scalac.typechecker.Analyzer.transform(Analyzer.java:2053)
	at scalac.typechecker.Analyzer.transform(Analyzer.java:1730)
	at scalac.typechecker.Analyzer.transform(Analyzer.java:1745)
	at scalac.typechecker.Analyzer.transformStatSeq(Analyzer.java:1549)
	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:294)
	at scalac.Global.compile(Global.java:266)
	at scalai.Interpreter.interpret(Interpreter.java:73)
	at scalai.InterpreterShell.load(InterpreterShell.java:237)
	at scalai.InterpreterShell.main(InterpreterShell.java:91)
	at scalai.Main.main(Main.java:34)
what expected

no error

[back to overview]
Changes of this bug report
Philippe  edited on  2003-10-07 10:16:08.0

Fixed by adding global.currentPhase changes in SourceCompleter.

Philippe  edited on  2003-10-07 10:16:18.0

Fixed by adding global.currentPhase changes in SourceCompleter.