Closed Simn closed 5 years ago
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.
Hmm...
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.