Aladdin - Scala Bugtracking
[#722] project: compiler priority: high category: bug
submitter assigned to status date submitted
Sean Martin fixed 2006-09-01 15:39:22.0
subject resident compiler crash
code
// FILE: Parser.scala
package test;
trait Parser {
  trait Link  {
    def foo = {}
  }
}
// FILE: ScanBased.scala
package test;
trait ScanBased extends Parser {
  trait AdjacentLink extends Link {
    override def foo = super.foo;
  }
  trait WhitespaceLink extends AdjacentLink {
    override def foo = super.foo;
  }
}
// FILE: IfElse.scala
package test;
trait IfEse extends ScanBased {
  object condition extends WhitespaceLink;
}
what happened
sean-mcdirmids-computer:~/workspace/test11/src mcdirmid$ ../../scala/build/quick/bin/scalac -resident -sourcepat\
h . -d ../bin

nsc> test/Parser.scala test/IfElse.scala

nsc> test/Parser.scala test/IfElse.scala
exception when transforming java.lang.Object with IfEse.this.WhitespaceLink with scala.ScalaObject {
  def this(): object IfEse.this.condition = {
    condition.super.this();
    ()
  };
  private   val $outer : IfEse.this.type = _;
     def $outer(): IfEse.this.type = condition.this.$outer
}
exception when transforming final class condition extends java.lang.Object with IfEse.this.WhitespaceLink with s\
cala.ScalaObject {
  def this(): object IfEse.this.condition = {
    condition.super.this();
    ()
  }
}
exception when transforming java.lang.Object with test.ScanBased with scala.ScalaObject {
  final class condition extends java.lang.Object with IfEse.this.WhitespaceLink with scala.ScalaObject {
    def this(): object IfEse.this.condition = {
      condition.super.this();
      ()
    }
  };
  final  def condition(): object IfEse.this.condition;
  def /*IfEse*/$init$(): scala.Unit = ()
}
exception when transforming abstract trait IfEse extends java.lang.Object with test.ScanBased with scala.ScalaOb\
ject {
  final class condition extends java.lang.Object with IfEse.this.WhitespaceLink with scala.ScalaObject {
    def this(): object IfEse.this.condition = {
      condition.super.this();
      ()
    }
  };
  final  def condition(): object IfEse.this.condition
}
exception when transforming package test {
  abstract trait IfEse extends java.lang.Object with test.ScanBased with scala.ScalaObject {
    final class condition extends java.lang.Object with IfEse.this.WhitespaceLink with scala.ScalaObject {
      def this(): object IfEse.this.condition = {
        condition.super.this();
        ()
      }
    };
    final  def condition(): object IfEse.this.condition
  }
}
Exception in thread "main" java.lang.AssertionError: assertion failed: ScanBased.this.type.trait Link$classdoes \
no longer exist!
	at scala.Predef$.assert(Predef.scala:182)
	at scala.tools.nsc.symtab.Types$adaptToNewRunMap$.adaptToNewRun(Types.scala:1514)
	at scala.tools.nsc.symtab.Types$adaptToNewRunMap$.apply(Types.scala:1547)
	at scala.tools.nsc.symtab.Types$adaptToNewRunMap$.apply(Types.scala:1503)
	at scala.List$.loop$0(List.scala:232)
	at scala.List$.mapConserve(List.scala:249)
	at scala.tools.nsc.symtab.Types$adaptToNewRunMap$.apply(Types.scala:1556)
	at scala.tools.nsc.symtab.Types$Type.complete(Types.scala:355)
	at scala.tools.nsc.symtab.Symbols$Symbol.info(Symbols.scala:366)
	at scala.tools.nsc.symtab.Types$TypeRef.closure(Types.scala:890)
	at scala.tools.nsc.symtab.Types$CompoundType$$anonfun$3.apply(Types.scala:651)
	at scala.tools.nsc.symtab.Types$CompoundType$$anonfun$3.apply(Types.scala:650)
	at scala.List.foreach(List.scala:680)
	at scala.tools.nsc.symtab.Types$CompoundType.computeClosure$0(Types.scala:650)
	at scala.tools.nsc.symtab.Types$CompoundType.closure(Types.scala:709)
	at scala.tools.nsc.symtab.Symbols$Symbol.closureLength$0(Symbols.scala:491)
	at scala.tools.nsc.symtab.Symbols$Symbol.isLess(Symbols.scala:494)
	at scala.tools.nsc.symtab.Types$Type.closurePos(Types.scala:316)
	at scala.tools.nsc.symtab.Symbols$Symbol.isNonBottomSubClass(Symbols.scala:510)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.toPrefix$0(Types.scala:1340)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1347)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1333)
	at scala.List$.loop$0(List.scala:232)
	at scala.List$.mapConserve(List.scala:249)
	at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:1278)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1378)
	at scala.tools.nsc.symtab.Types$Type.asSeenFrom(Types.scala:199)
	at scala.tools.nsc.symtab.Types$Type.memberType(Types.scala:226)
	at scala.tools.nsc.typechecker.Infer$Inferencer.checkAccessible(Infer.scala:283)
	at scala.tools.nsc.typechecker.Typers$Typer.typedSelect$0(Typers.scala:1339)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1746)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1815)
	at scala.tools.nsc.typechecker.Typers$Typer.typedOperator(Typers.scala:1856)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$0.mixinConstructorCall$0(ExplicitOute\
r.scala:217)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$0$$anonfun$6.apply(ExplicitOuter.scal\
a:238)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$0$$anonfun$6.apply(ExplicitOuter.scal\
a:236)
	at scala.List.map(List.scala:651)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$0.addMixinConstructorCalls(ExplicitOu\
ter.scala:236)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$0.transform(ExplicitOuter.scala:293)
\

	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$25.apply(Trees.scala:1062)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$25.apply(Trees.scala:1060)
	at scala.List$.loop$0(List.scala:232)
	at scala.List$.mapConserve(List.scala:249)
	at scala.tools.nsc.ast.Trees$Transformer.transformStats(Trees.sca
(complete trace won't paste because their appears to be garbage in the signature of Trees$Transformer).
what expected
[back to overview]
Changes of this bug report
Sean  edited on  2006-09-01 15:40:26.0
Sean  edited on  2006-09-01 19:17:22.0
Found simple example of bug. To quote, "Scala bug reports should be as simple as possible, and not any simpler".
Sean  edited on  2006-09-01 19:17:42.0
Martin  edited on  2006-09-03 16:58:28.0
The cut-down example helped a lot. It was still pretty hard to diagnose and fix, though!