manifold-systems / manifold

Manifold is a Java compiler plugin, its features include Metaprogramming, Properties, Extension Methods, Operator Overloading, Templates, a Preprocessor, and more.
http://manifold.systems/
Apache License 2.0
2.43k stars 125 forks source link

Compile error on extension class involving super constructor generic parameter referencing the super class's type var #392

Closed rsmckinney closed 2 years ago

rsmckinney commented 2 years ago

Compile error on extension class involving super constructor generic parameter referencing the super class's type var.

The essential bits:

Super-class

package abc;

public class SuperClass<T extends SuperClass<T>> {
    public SuperClass(Class<T> classT) {
        . . .
    }
}

Subclass

package abc;

public class SubClass extends SuperClass<SubClass>{
    public SubClass() {
        super(SubClass.class);
    }
}

Extension class

package myproject.extensions.abc.SubClass;
. . .
@Extension
public class SubClassExt {
  public static void myMethod(@This SubClass thiz) {
    . . .
  }
}

Error: Cannot find symbol class T

rsmckinney commented 2 years ago

Fix available with release 2022.1.22