Aladdin - Scala Bugtracking
[#495] project: nsc priority: low category: bug
submitter assigned to status date submitted
Iulian Martin fixed 2005-11-23 12:15:25.0
subject Wrong symbol referenced when local variable collides with case class constructor name
code
class A;
case class B(sym: Symbol) extends A;
trait C;

class Foo {
  def ThisType(sym: Symbol): A = 
    new B(sym) with C;
}
what happened
    def ThisType(sym: scala.Symbol): A = {
      final  class $anon extends B with C {
        def (): $anon = {
          $anon.super.($anon.this.sym);
          ()
        }
      };
The anonymous' class constructor references $anon.this.sym (coming from its constructor) instead of method's par\ ameter 'sym'.
what expected
[back to overview]
Changes of this bug report
Martin  edited on  2005-11-24 14:05:59.0