Michel edited on 2003-06-30 09:49:18.0
|
This seems to be more a problem with lambda lifting, which doesn't lift the (implicit) class declaration introduced by the anonymous function in the call to M's constructor. The following example illustrates this more clearly:
class C1(x: Object) {};
class C2 extends C1({ class A extends Object {}; (new A) : Object }) {};
In my opinion, LambdaLift should lift the definition of class A to the same level as C2, because this definition does not happen in the context of C2, but really in the context of its constructor, i.e. a function.
|
Martin edited on 2003-07-04 16:24:12.0
|
I fixed so that now the inner class is lifted. However I get (for Michel's simplified example):
Exception in thread "main" java.lang.AssertionError: A$0 is interface
at scalac.transformer.AddConstructors.getConstructor(AddConstructors.java:84)
at scalac.transformer.AddConstructors.getConstructor(AddConstructors.java:73)
at scalac.transformer.AddConstructors.transform(AddConstructors.java:238)
at scalac.ast.Transformer.transform(Transformer.java:203)
at scalac.transformer.AddConstructors.transform(AddConstructors.java:249)
at scalac.ast.Transformer.transform(Transformer.java:190)
at scalac.transformer.AddConstructors.transform(AddConstructors.java:249)
at scalac.ast.Transformer.transform(Transformer.java:193)
at scalac.transformer.AddConstructors.transform(AddConstructors.java:249)
at scalac.ast.Transformer.transform(Transformer.java:252)
at scalac.ast.Transformer.transform(Transformer.java:153)
at scalac.transformer.AddConstructors.transform(AddConstructors.java:249)
at scalac.ast.Transformer.transform(Transformer.java:252)
at scalac.transformer.AddConstructors.transform(AddConstructors.java:171)
at scalac.ast.Transformer.transform(Transformer.java:257)
at scalac.ast.Transformer.apply(Transformer.java:71)
at scalac.ast.Transformer.apply(Transformer.java:66)
at scalac.ast.Transformer.apply(Transformer.java:62)
at scalac.transformer.AddConstructorsPhase.apply(AddConstructorsPhase.java:36)
at scalac.Global.compile(Global.java:268)
at scalac.Global.compile(Global.java:244)
at scalac.Main.main(Main.java:32)
|
Nikolay edited on 2003-07-10 15:50:17.0
|
Reassigned to Michel:
It seems that (for Michel's example) AddInterfaces does not substitute the new A$0() expression with new A$0$class().
|
Michel edited on 2003-07-10 16:27:20.0
|
|