Aladdin - Scala Bugtracking
[#379] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Nikolay Martin fixed 2004-11-18 18:06:39.0
subject [contrib #43] object and self type
code
class B {}
object A:B with B {}
what happened
Exception in thread "main" scala.tools.util.debug.AbortError: invalid type:
        at scala.tools.util.debug.Debug.abort(Debug.java:70)
        at scala.tools.util.debug.Debug.abort(Debug.java:76)
        at scalac.util.Debug.abort(Debug.java:99)
        at scalac.backend.jvm.GenJVM.typeStoJ(GenJVM.java:1490)
        at scalac.backend.jvm.GenJVM.genLoad(GenJVM.java:284)
        at scalac.backend.jvm.GenJVM.genLoadQualifier(GenJVM.java:598)
        at scalac.backend.jvm.GenJVM.genLoad(GenJVM.java:431)
        at scalac.backend.jvm.GenJVM.gen(GenJVM.java:228)
        at scalac.backend.jvm.GenJVM.genLoad(GenJVM.java:263)
        at scalac.backend.jvm.GenJVM.gen(GenJVM.java:228)
        at scalac.backend.jvm.GenJVM.genLoad(GenJVM.java:263)
        at scalac.backend.jvm.GenJVM.gen(GenJVM.java:192)
        at scalac.backend.jvm.GenJVM.gen(GenJVM.java:237)
        at scalac.backend.jvm.GenJVM.gen(GenJVM.java:167)
        at scalac.backend.jvm.GenJVM.gen(GenJVM.java:153)
        at scalac.backend.jvm.GenJVM.translate(GenJVM.java:125)
        at scalac.backend.jvm.GenJVMPhase.apply(GenJVMPhase.java:45)
        at scalac.Global.compile(Global.java:393)
        at scalac.Global.compile(Global.java:363)
        at scala.tools.scalac.Main$.main1(Main.scala:45)
        at scala.tools.scalac.Main$.main(Main.scala:28)
        at scala.tools.scalac.Main.main(Main.scala:28)
what expected Silent compilation.
[back to overview]
Changes of this bug report
Nikolay  edited on  2004-11-18 18:10:59.0
The development version breaks at the tree checks in MakeBoxingExplicit. That's why I assigned it Philippe.
Philippe  edited on  2004-11-29 17:17:46.0

The problem comes from the analyzer or maybe from RefCheck which assigns the wrong selftype to the class associated to the object. Here is an example:

class A;
class C:A with A;
object O:A with A;
After RefCheck the selftype of class C is C, but the selftype of class O is A. It should be O.

Martin  edited on  2006-03-30 18:41:17.0
Not reproducible in version 2