Aladdin - Scala Bugtracking
[#490] project: nsc priority: low category: bug
submitter assigned to status date submitted
Iulian Martin fixed 2005-11-17 18:01:46.0
subject wrong symbol referenced for mixed in objects
code
trait Definitions: Symtab {
  object definitions {
    val str = "String";
  }
}

class Symtab extends AnyRef with Definitions {
  def main: Unit = {
    definitions.str;
  }
}
what happened
The reference to 'definitions' in method main will reference an non-existing symbol:
  class Symtab#2263 extends java.lang.Object#802 with Definitions#2262 with scala.ScalaObject#456 {
    def main#2270(): scala.Unit#345 = {
      Symtab#2263.this.definitions#2266().str#2272();
      ()
    };
    def #2269(): Symtab#2263 = {
      Symtab#2263.super.#1554();
      Definitions$class#2311.$init$#2298(Symtab#2263.this);
      scala#234.ScalaObject$class#2312.$init$#2301(Symtab#2263.this);
      ()
    };
    private   var definitions$module#2313: Definitions$definitions#2267 = _;
    final  def definitions#2309(): Definitions$definitions#2267 = {
      if (Symtab#2263.this.definitions$module#2313.eq#1566(null))
        Symtab#2263.this.definitions$module#2313 = new Definitions$definitions#2267.#2271(Symtab#2263.this\
);
      Symtab#2263.this.definitions$module#2313
    };
    def $tag#2310(): scala.Int#447 = scala#234.ScalaObject$class#2312.$tag#2308(Symtab#2263.this)
  };
what expected ..
[back to overview]
Changes of this bug report
Iulian  edited on  2005-11-17 18:14:20.0
Martin  edited on  2005-11-21 13:47:06.0