Aladdin - Scala Bugtracking
[#651] project: compiler priority: low category: bug
submitter assigned to status date submitted
Sean Martin fixed 2006-07-10 15:23:09.0
subject private object weirdness
code
package test;

trait Test3 {
  trait MatchableImpl {
    trait MatchImpl;
  }
  
  trait BracePairImpl {
    trait BraceImpl extends MatchableImpl {
      private object MyMatch1 extends MatchImpl;
      protected def match0 : MatchImpl = MyMatch1;
      
    }
  }
}
what happened
tsf-wpa-1-064:~/workspace/test/src mcdirmid$ ~/workspace/scala/build/quick/bin/scalac test/Test3.scala 
exception when traversing Test3$BracePairImpl$BraceImpl$class.this.MyMatch1
exception when traversing Test3$BracePairImpl$BraceImpl$class.this.MyMatch1()
exception when traversing def match0(): test.Test3$MatchableImpl$MatchImpl = Test3$BracePairImpl$BraceImpl$class\
.this.MyMatch1()
exception when traversing java.lang.Object with test.Test3$MatchableImpl with scala.ScalaObject with test.Test3$\
BracePairImpl$BraceImpl {
  final private  def MyMatch1(): object test.Test3$BracePairImpl$BraceImpl$MyMatch1;
  def match0(): test.Test3$MatchableImpl$MatchImpl = Test3$BracePairImpl$BraceImpl$class.this.MyMatch1();
  private   val test$Test3$BracePairImpl$BraceImpl$$$outer : test.Test3$BracePairImpl = _;\

     def test$Test3$BracePairImpl$BraceImpl$$$outer(): test.Test3$BracePairImpl\
 = Test3$BracePairImpl$BraceImpl$class.this.test$Test3$BracePairImpl$BraceImpl$$$outer ;
  def /*Test3$BracePairImpl$BraceImpl$class*/$init$($outer: test.Test3$BracePairImpl): scala.Unit = {
    if ($outer.eq(null))
      throw new java.lang.NullPointerException.this()
    else
      Test3$BracePairImpl$BraceImpl$class.this.test$Test3$BracePairImpl$BraceImpl$$$outer  = $outer;
    ()
  }
}
exception when traversing abstract trait Test3$BracePairImpl$BraceImpl$class extends java.lang.Object with test.\
Test3$MatchableImpl with scala.ScalaObject with test.Test3$BracePairImpl$BraceImpl {
  final private  def MyMatch1(): object test.Test3$BracePairImpl$BraceImpl$MyMatch1;
  def match0(): test.Test3$MatchableImpl$MatchImpl = Test3$BracePairImpl$BraceImpl$class.this.MyMatch1();
  private   val test$Test3$BracePairImpl$BraceImpl$$$outer : test.Test3$BracePairImpl = _;\

     def test$Test3$BracePairImpl$BraceImpl$$$outer(): test.Test3$BracePairImpl\
 = Test3$BracePairImpl$BraceImpl$class.this.test$Test3$BracePairImpl$BraceImpl$$$outer ;
  def /*Test3$BracePairImpl$BraceImpl$class*/$init$($outer: test.Test3$BracePairImpl): scala.Unit = {
    if ($outer.eq(null))
      throw new java.lang.NullPointerException.this()
    else
      Test3$BracePairImpl$BraceImpl$class.this.test$Test3$BracePairImpl$BraceImpl$$$outer  = $outer;
    ()
  }
}
exception when traversing package test {
  abstract trait Test3 extends java.lang.Object with scala.ScalaObject;
  abstract trait Test3$class extends java.lang.Object with scala.ScalaObject with test.Test3 {
    def /*Test3$class*/$init$(): scala.Unit = {
      ()
    }
  };
  abstract trait Test3$MatchableImpl$MatchImpl extends java.lang.Object with scala.ScalaObject;
  abstract trait Test3$MatchableImpl extends java.lang.Object with scala.ScalaObject {
       def test$Test3$MatchableImpl$$$outer(): test.Test3
  };
  final class Test3$BracePairImpl$BraceImpl$MyMatch1 extends java.lang.Object with test.Test3$MatchableImpl$Matc\
hImpl with scala.ScalaObject {
    private   val $outer : test.Test3$BracePairImpl$BraceImpl = _;
       def $outer(): test.Test3$BracePairImpl$BraceImpl = Test3$BracePairImpl$B\
raceImpl$MyMatch1.this.$outer ;
    def this($outer: test.Test3$BracePairImpl$BraceImpl): object test.Test3$BracePairImpl$BraceImpl$MyMatch1 = {\

      if ($outer.eq(null))
        throw new java.lang.NullPointerException.this()
      else
        Test3$BracePairImpl$BraceImpl$MyMatch1.this.$outer  = $outer;
      {
        Test3$BracePairImpl$BraceImpl$MyMatch1.super.this();
        ()
      };
      ()
    }
  };
  abstract trait Test3$BracePairImpl$BraceImpl extends java.lang.Object with test.Test3$MatchableImpl with scala\
.ScalaObject {
    def match0(): test.Test3$MatchableImpl$MatchImpl;
       def test$Test3$BracePairImpl$BraceImpl$$$outer(): test.Test3$BracePairIm\
pl
  };
  abstract trait Test3$BracePairImpl$BraceImpl$class extends java.lang.Object with test.Test3$MatchableImpl with\
 scala.ScalaObject with test.Test3$BracePairImpl$BraceImpl {
    final private  def MyMatch1(): object test.Test3$BracePairImpl$BraceImpl$MyMatch1;
    def match0(): test.Test3$MatchableImpl$MatchImpl = Test3$BracePairImpl$BraceImpl$class.this.MyMatch1();
    private   val test$Test3$BracePairImpl$BraceImpl$$$outer : test.Test3$BracePairImpl = \
_;
       def test$Test3$BracePairImpl$BraceImpl$$$outer(): test.Test3$BracePairIm\
pl = Test3$BracePairImpl$BraceImpl$class.this.test$Test3$BracePairImpl$BraceImpl$$$outer ;
    def /*Test3$BracePairImpl$BraceImpl$class*/$init$($outer: test.Test3$BracePairImpl): scala.Unit = {
      if ($outer.eq(null))
        throw new java.lang.NullPointerException.this()
      else
        Test3$BracePairImpl$BraceImpl$class.this.test$Test3$BracePairImpl$BraceImpl$$$outer  = $outer;
      ()
    }
  };
  abstract trait Test3$BracePairImpl extends java.lang.Object with scala.ScalaObject {
       def test$Test3$BracePairImpl$$$outer(): test.Test3
  };
  abstract trait Test3$MatchableImpl$class extends java.lang.Object with object scala.ScalaObject$class with tes\
t.Test3$MatchableImpl {
    private   val test$Test3$MatchableImpl$$$outer : test.Test3 = _;
       def test$Test3$MatchableImpl$$$outer(): test.Test3 = Test3$MatchableImpl\
$class.this.test$Test3$MatchableImpl$$$outer ;
    def /*Test3$MatchableImpl$class*/$init$($outer: test.Test3): scala.Unit = {
      if ($outer.eq(null))
        throw new java.lang.NullPointerException.this()
      else
        Test3$MatchableImpl$class.this.test$Test3$MatchableImpl$$$outer  = $outer;
      ()
    }
  };
  abstract trait Test3$BracePairImpl$class extends java.lang.Object with object scala.ScalaObject$class with tes\
t.Test3$BracePairImpl {
    private   val test$Test3$BracePairImpl$$$outer : test.Test3 = _;
       def test$Test3$BracePairImpl$$$outer(): test.Test3 = Test3$BracePairImpl\
$class.this.test$Test3$BracePairImpl$$$outer ;
    def /*Test3$BracePairImpl$class*/$init$($outer: test.Test3): scala.Unit = {
      if ($outer.eq(null))
        throw new java.lang.NullPointerException.this()
      else
        Test3$BracePairImpl$class.this.test$Test3$BracePairImpl$$$outer  = $outer;
      ()
    }
  }
}
Exception in thread "main" java.lang.Error: assertion failed: object MyMatch1
        at scala.Predef$.assert(Predef.scala:182)
        at scala.tools.nsc.transform.Mixin$MixinTransformer.scala$tools$nsc$transform$Mixin$MixinTransformer$$po\
stTransform(Mixin.scala:415)
        at scala.tools.nsc.transform.Mixin$MixinTransformer$$anonfun$30.apply(Mixin.scala:437)
        at scala.tools.nsc.transform.Mixin$MixinTransformer$$anonfun$30.apply(Mixin.scala:437)
        at scala.tools.nsc.symtab.SymbolTable.atPhase(SymbolTable.scala:71)
        at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:437)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1031)
        at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:436)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$16.apply(Trees.scala:974)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$16.apply(Trees.scala:973)
        at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1077)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:972)
        at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:436)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$25.apply(Trees.scala:1071)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$25.apply(Trees.scala:1069)
        at scala.List$.loop$0(List.scala:232)
        at scala.List$.mapConserve(List.scala:249)
        at scala.List$.loop$0(List.scala:236)
        at scala.List$.mapConserve(List.scala:249)
        at scala.tools.nsc.ast.Trees$Transformer.transformStats(Trees.scala:1069)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:995)
        at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:436)
        at scala.tools.nsc.ast.Trees$Transformer.transformTemplate(Trees.scala:1057)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$13.apply(Trees.scala:961)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$13.apply(Trees.scala:961)
        at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1077)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:960)
        at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:436)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$25.apply(Trees.scala:1071)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$25.apply(Trees.scala:1069)
        at scala.List$.loop$0(List.scala:232)
        at scala.List$.mapConserve(List.scala:249)
        at scala.List$.loop$0(List.scala:236)
        at scala.List$.mapConserve(List.scala:249)
        at scala.List$.loop$0(List.scala:236)
        at scala.List$.mapConserve(List.scala:249)
        at scala.List$.loop$0(List.scala:236)
        at scala.List$.mapConserve(List.scala:249)
        at scala.List$.loop$0(List.scala:236)
        at scala.List$.mapConserve(List.scala:249)
        at scala.List$.loop$0(List.scala:236)
        at scala.List$.mapConserve(List.scala:249)
        at scala.List$.loop$0(List.scala:236)
        at scala.List$.mapConserve(List.scala:249)
        at scala.tools.nsc.ast.Trees$Transformer.transformStats(Trees.scala:1069)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$12.apply(Trees.scala:957)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$12.apply(Trees.scala:957)
        at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1077)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:956)
        at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:436)
        at scala.tools.nsc.ast.Trees$Transformer.transformUnit(Trees.scala:1072)
        at scala.tools.nsc.transform.Transform$Phase.apply(Transform.scala:22)
        at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:216)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:205)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:205)
        at scala.Iterator$class.foreach(Iterator.scala:304)
        at scala.collection.mutable.ListBuffer$$anon$0.foreach(ListBuffer.scala:216)
        at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:205)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:467)
        at scala.tools.nsc.Global$Run.compile(Global.scala:527)
        at scala.tools.nsc.Main$.process(Main.scala:76)
        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-07-11 16:10:13.0