Aladdin - Scala Bugtracking
[#785] project: compiler priority: low category: bug
submitter assigned to status date submitted
Sean Martin fixed 2006-10-23 05:42:07.0
subject resident compiler crash
code
// In two files
// test/ScalaNewTyper.scala
package test;
trait ScalaNewTyperX {
  private var typed : String = null;
  trait HasSymbol { 
    protected def foo : Unit = {}
  }
  trait HasArgsTypeParametersImpl extends HasSymbol {
    private var argss : List[List[String]] = Nil;
  }
}
// test/ScalaTrees.scala
package test;

trait ScalaTreesX extends ScalaNewTyperX {
  trait TraitClassImpl extends HasArgsTypeParametersImpl {
    argss(null);
    protected def argss(tree : String) : List[List[String]] = Nil;
  }
}

<pre>sean-mcdirmids-computer:~/workspace/test21/src mcdirmid$ ../../scala/build/quick/bin/scalac -sourcepath . -d ../bin/ -resident

nsc> test/ScalaTreesX.scala

nsc> test/ScalaTreesX.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: ScalaNewTyperX.this.type.trait HasSymbol$class does no longer exist, phase = erasure
at scala.Predef$.assert(Predef.scala:92)
at scala.tools.nsc.symtab.Types$adaptToNewRunMap$.adaptToNewRun(Types.scala:1601)
at scala.tools.nsc.symtab.Types$adaptToNewRunMap$.apply(Types.scala:1634)
at scala.tools.nsc.symtab.Types$adaptToNewRunMap$.apply(Types.scala:1590)
at scala.List$.loop$0(List.scala:238)
at scala.List$.mapConserve(List.scala:255)
at scala.tools.nsc.symtab.Types$adaptToNewRunMap$.apply(Types.scala:1643)
at scala.tools.nsc.symtab.Types$Type.complete(Types.scala:370)
at scala.tools.nsc.symtab.Symbols$Symbol.info(Symbols.scala:395)
at scala.tools.nsc.symtab.Symbols$Symbol.closureLength$0(Symbols.scala:523)
at scala.tools.nsc.symtab.Symbols$Symbol.isLess(Symbols.scala:526)
at scala.tools.nsc.symtab.Types$Type.closurePos(Types.scala:331)
at scala.tools.nsc.symtab.Symbols$Symbol.isNonBottomSubClass(Symbols.scala:542)
at scala.tools.nsc.symtab.Types$AsSeenFromMap.toPrefix$0(Types.scala:1410)
at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1417)
at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1403)
at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:1322)
at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1448)
at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1403)
at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:1355)
at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1448)
at scala.tools.nsc.symtab.Types$Type.asSeenFrom(Types.scala:201)
at scala.tools.nsc.symtab.Types$Type.memberType(Types.scala:229)
at scala.tools.nsc.symtab.Types$Type.findMember(Types.scala:447)
at scala.tools.nsc.symtab.Types$Type.member(Types.scala:176)
at scala.tools.nsc.typechecker.Typers$Typer.typedIdent$0(Typers.scala:1474)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1862)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1933)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1783)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1933)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1961)
at scala.tools.nsc.typechecker.Typers$Typer.typedStat$0(Typers.scala:1104)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$47.apply(Typers.scala:1125)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$47.apply(Typers.scala:1125)
at scala.List$.loop$0(List.scala:238)
at scala.List$.mapConserve(List.scala:255)
at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1125)
at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:786)
at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:707)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1565)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1933)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1961)
at scala.tools.nsc.typechecker.Typers$Typer.typedStat$0(Typers.scala:1104)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$47.apply(Typers.scala:1125)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$47.apply(Typers.scala:1125)
at scala.List$.loop$0(List.scala:238)
at scala.List$.mapConserve(List.scala:255)
at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1125)
at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:786)
at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:707)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1565)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1933)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1961)
at scala.tools.nsc.typechecker.Typers$Typer.typedStat$0(Typers.scala:1104)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$47.apply(Typers.scala:1125)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$47.apply(Typers.scala:1125)
at scala.List$.loop$0(List.scala:238)
at scala.List$.mapConserve(List.scala:255)
at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1125)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1561)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1933)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1961)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$1.apply(Analyzer.scala:38)
at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:218)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:207)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:207)
at scala.Iterator$class.foreach(Iterator.scala:316)
at scala.collection.mutable.ListBuffer$$anon$0.foreach(ListBuffer.scala:220)
at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:207)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:472)
at scala.tools.nsc.Global$Run.compile(Global.scala:541)
at scala.tools.nsc.Main$$anonfun$0.apply(Main.scala:39)
at scala.tools.nsc.Main$$anonfun$0.apply(Main.scala:36)
at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:17)
at scala.tools.nsc.Main$.loop(Main.scala:16)
at scala.tools.nsc.EvalLoop$class.loop(EvalLoop.scala:18)
at scala.tools.nsc.Main$.loop(Main.scala:16)
at scala.tools.nsc.Main$.resident(Main.scala:36)
at scala.tools.nsc.Main$.process(Main.scala:71)
at scala.tools.nsc.Main$.main(Main.scala:98)
at scala.tools.nsc.Main.main(Main.scala)
sean-mcdirmids-computer:~/workspace/test21/src mcdirmid$</pre>

This bug was hard to track down. Its seems fairly arbitrary in how it is triggered (everything in the above code is significant for the crash, remove anything and the crash does not occur). In particular, the argss var and argss def must have the same name.


what happened
what expected
[back to overview]
Changes of this bug report
Martin  edited on  2006-10-26 16:14:44.0