You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importjava.jvm.annotation.EnumReflectionInformation;
classMain {
staticpublicfunctionmain() {
varexprDefClass=Type.resolveClass("haxe.macro.ExprDef");
varexprDefNative=exprDefClass.native(); // same value but typed as java.lang.Classvarannotation:java.lang.annotation.Annotation=exprDefNative.getAnnotation(castEnumReflectionInformation);
}
}
This seems a bit tricky. The JVM wants us to use the applied type parameters, but we can't just drop the type of FInstance in there because that might contain basic types, and these are not assignable to type parameters without boxing. This means that we would have to know which basic types were assigned to type parameters, but I don't think we retain this information in our typed AST.
I think we could apply + box the class type parameters, but we can't do that with field type parameters because we don't have a type list for them.
I think what we're actually supposed to do here is generate singly-constrained type parameters as their constraint type. We have to be careful with #30 though.
This currently errors:
java.lang.NoSuchMethodError: java.lang.Class.getAnnotation(Ljava/lang/Class;)Ljava/lang/Object;
I think it's because of the return type being `Ljava/lang/Object;``.
The Haxe dump looks fine:
I have to check that the generator uses the correct type for this.
The text was updated successfully, but these errors were encountered: