Aladdin - Scala Bugtracking
[#276] project: compiler priority: low category: bug
submitter assigned to status date submitted
Philippe Martin fixed 2004-01-19 17:45:56.0
subject Inferred type of method contains local variable.
code
package test;

object Foo {

  trait Tic {
    type T;
    def t: T;
  }

  trait Tac {
    def fun(tics: List[Tic]) = tics map { tic => tic.t };
  }

}
what happened

The inferred type of method Foo.Tac.fun is scala.List[tic.C] which illegally refer\ s to the local variable t. The problem shows up when one tries to compile a file containing the fol\ lowing code:

import test.Foo._;

This generates the following exception:

Exception in thread "main" java.lang.AssertionError: