Aladdin - Scala Bugtracking
[#735] project: compiler priority: high category: bug
submitter assigned to status date submitted
Sean Martin fixed 2006-09-08 11:03:22.0
subject Resident compilation very very broken for mixins
code
// In two separate files
// test/ScalaExpressions.scala
package test;
trait ScalaExpressions {
  trait ExpressionFactory {
    def foo = 10;
    def bar : Int;
  }
  val values : ValueFactory;
  trait ValueFactory extends ExpressionFactory {
    def bar = 42;
  }
}
// test/ScalaTyper.scala
package test;
trait ScalaTyper extends ScalaExpressions {
  val values = new ValueFactory {}
}
what happened
sean-mcdirmids-computer:~/workspace/test17/src mcdirmid$ ../../scala/build/quick/bin/scalac -d ../bin -resident \
-sourcepath .

nsc> test/ScalaTyper.scala

nsc> test/ScalaTyper.scala
exception when transforming java.lang.Object with ScalaTyper.this.ValueFactory {
  def this(): template $anon = {
    $anon.super.this();
    ()
  };
  private   val $outer : ScalaTyper.this.type = _;
     def $outer(): ScalaTyper.this.type = $anon.this.$outer
}
exception when transforming final  class $anon extends java.lang.Object with ScalaTyper.this.ValueFac\
tory {
  def this(): template $anon = {
    $anon.super.this();
    ()
  }
}
exception when transforming {
  final  class $anon extends java.lang.Object with ScalaTyper.this.ValueFactory {
    def this(): template $anon = {
      $anon.super.this();
      ()
    }
  };
  new template $anon.this()
}
exception when transforming private  val values : java.lang.Object with ScalaTyper.this.ValueFactory = {
\

  final  class $anon extends java.lang.Object with ScalaTyper.this.ValueFactory {
    def this(): template $anon = {
      $anon.super.this();
      ()
    }
  };
  new template $anon.this()
}
exception when transforming java.lang.Object with test.ScalaExpressions with scala.ScalaObject {
  private  val values : java.lang.Object with ScalaTyper.this.ValueFactory = {
    final  class $anon extends java.lang.Object with ScalaTyper.this.ValueFactory {
      def this(): template $anon = {
        $anon.super.this();
        ()
      }
    };
    new template $anon.this()
  };
    def values(): java.lang.Object with ScalaTyper.this.ValueFactory = ScalaTyper.this.values \
;
  def /*ScalaTyper*/$init$(): scala.Unit = ()
}
exception when transforming abstract trait ScalaTyper extends java.lang.Object with test.ScalaExpressions with s\
cala.ScalaObject {
  private  val values : java.lang.Object with ScalaTyper.this.ValueFactory = {
    final  class $anon extends java.lang.Object with ScalaTyper.this.ValueFactory {
      def this(): template $anon = {
        $anon.super.this();
        ()
      }
    };
    new template $anon.this()
  };
    def values(): java.lang.Object with ScalaTyper.this.ValueFactory = ScalaTyper.this.values
\

}
exception when transforming package test {
  abstract trait ScalaTyper extends java.lang.Object with test.ScalaExpressions with scala.ScalaObject {
    private  val values : java.lang.Object with ScalaTyper.this.ValueFactory = {
      final  class $anon extends java.lang.Object with ScalaTyper.this.ValueFactory {
        def this(): template $anon = {
          $anon.super.this();
          ()
        }
      };
      new template $anon.this()
    };
      def values(): java.lang.Object with ScalaTyper.this.ValueFactory = ScalaTyper.this.value\
s
  }
}
Exception in thread "main" java.lang.AssertionError: assertion failed: ScalaExpressions.this.type.trait Expressi\
onFactory$class does no longer exist, phase = erasure
	at scala.Predef$.assert(Predef.scala:182)
	at scala.tools.nsc.symtab.Types$adaptToNewRunMap$.adaptToNewRun(Types.scala:1522)
	at scala.tools.nsc.symtab.Types$adaptToNewRunMap$.apply(Types.scala:1555)
	at scala.tools.nsc.symtab.Types$adaptToNewRunMap$.apply(Types.scala:1511)
	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:1564)
	at scala.tools.nsc.symtab.Types$Type.complete(Types.scala:358)
	at scala.tools.nsc.symtab.Symbols$Symbol.info(Symbols.scala:372)
	at scala.tools.nsc.symtab.Types$TypeRef.parents(Types.scala:854)
	at scala.tools.nsc.symtab.Symbols$Symbol.toInterface(Symbols.scala:666)
	at scala.tools.nsc.symtab.Symbols$TermSymbol.owner(Symbols.scala:919)
	at scala.tools.nsc.symtab.Symbols$Symbol.exists(Symbols.scala:292)
	at scala.tools.nsc.typechecker.Typers$Typer.typedSelect$0(Typers.scala:1323)
	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:220)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$0$$anonfun$6.apply(ExplicitOuter.scal\
a:241)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$0$$anonfun$6.apply(ExplicitOuter.scal\
a:239)
	at scala.List.map(List.scala:651)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$0.addMixinConstructorCalls(ExplicitOu\
ter.scala:239)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$0.transform(ExplicitOuter.scala:296)
\

	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.scala:1060)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:986)
	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:143)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$0.transform(ExplicitOuter.scala:327)
\

	at scala.tools.nsc.ast.Trees$Transformer.transformTemplate(Trees.scala:1048)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$13.apply(Trees.scala:954)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$13.apply(Trees.scala:953)
	at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1068)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:952)
	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:143)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$0.transform(ExplicitOuter.scala:327)
\

	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.scala:1060)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:988)
	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:143)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$0.transform(ExplicitOuter.scala:327)
\

	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$15.apply(Trees.scala:962)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$15.apply(Trees.scala:962)
	at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1068)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:961)
	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:143)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$0.transform(ExplicitOuter.scala:327)
\

	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.scala:1060)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:986)
	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:143)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$0.transform(ExplicitOuter.scala:327)
\

	at scala.tools.nsc.ast.Trees$Transformer.transformTemplate(Trees.scala:1048)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$13.apply(Trees.scala:954)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$13.apply(Trees.scala:953)
	at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1068)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:952)
	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:143)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$0.transform(ExplicitOuter.scala:327)
\

	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.scala:1060)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$12.apply(Trees.scala:949)
	at scala.tools.nsc.ast.Trees$Transformer$$anonfun$12.apply(Trees.scala:949)
	at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1068)
	at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:948)
	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:143)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$0.transform(ExplicitOuter.scala:327)
\

	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anonfun$9.apply(ExplicitOuter.scala:440)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anonfun$9.apply(ExplicitOuter.scala:440)
	at scala.tools.nsc.symtab.SymbolTable.atPhase(SymbolTable.scala:71)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer.transform(ExplicitOuter.scala:439)
	at scala.tools.nsc.ast.Trees$Transformer.transformUnit(Trees.scala:1063)
	at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer.transformUnit(ExplicitOuter.scala:429)
	at scala.tools.nsc.transform.Transform$Phase.apply(Transform.scala:26)
	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:216)
	at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:207)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:471)
	at scala.tools.nsc.Global$Run.compile(Global.scala:535)
	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)
what expected
[back to overview]
Changes of this bug report
Martin  edited on  2006-09-12 01:01:30.0
seems to be fixed after explicit outer change.