Aladdin - Scala Bugtracking
[#88] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Philippe Martin fixed 2003-08-13 16:39:46.0
subject local classes with missing targs after lambdalift
code
trait Foo[a];

object Bar {
  def foo[a] = {
    class Anon extends Foo[a];
    val v: Anon = new Anon;
    0
  };
}
what happened
The tree (with types) after lambdalift:

abstract class Foo[a]() extends scala{scala}.Object{()scala.Object}(){scala.Object};
final class Bar() extends scala{scala}.Object{()scala.Object}(){scala.Object} {
  final def foo[a$0](): scala.Int = {
    ;
    val v: Bar.Anon$0 =
      new Anon$0{[a$0]()Bar.Anon$0}[a$0{a$0}]{()Bar.Anon$0}
        (){Bar.Anon$0}{Bar.Anon$0};
    0{scala.Int}
  }{scala.Int};
  class Anon$0[a$0]() extends Foo{[a]()Foo[a]}[a$0]{()Foo[a$0]}(){Foo[a$0]}
};
final /*object*/ val Bar: Bar = new Bar{()Bar}(){Bar}{Bar};

The type of v and the type of the trees forming its rhs are wrong: the type argument to class Anon$0 is missing.\

what expected All types Anon$0 should have exactly one type argument.
[back to overview]
Changes of this bug report
Philippe  edited on  2003-08-14 17:38:19.0
Changed LambdaLiftPhase.transform to use nextInfo of primary construcors. This used to be the case, but was lost in last update. Added code to LambdaLift.liftSymbol to fix the result type of primary constructors.