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
I think that it might have value to have something like this in GenericTypeReflector directly, this way it could be optimized as well, the current implementation has to re-annotate the type that was discarded in GenericTypeReflector internally.
The text was updated successfully, but these errors were encountered:
I'll look into adding an optional leaf transformation step during type resolution, that way an extra descent down the structure wouldn't be needed. But at the very least I'll add methods that avoid re-annotation. I'll notify you here when the next version is out.
Btw, you might want to always call reduceBounded in your current code, not only for variables, because I assume you'd also want wildcards and parameterized types reduced e.g. ? extends Number to Number or List<T extends Number to List<Number> etc.
I just wanted to avoid calling reduceBounded for the cases where it is already a simple type, e.g., String.
Do you have any performance measurements? Is it worth caching results or is it so cheap to calculate that it doesn't really matter?
On a related note, what would you suggest to resolve cases like this one below, where I have access to the parameter array of an invocation and would like to know the return type for that invocation? Of course the class param could be one of multiple parameters at different indexes and with different type variables.
Coming from coekie#5 (comment)
I gave it a spin and came up with this:
it seems to work, but I'm not sure its the best way. You can see the full change here https://github.com/leonard84/spock/tree/replace_gentyref_with_geantyref
I think that it might have value to have something like this in
GenericTypeReflector
directly, this way it could be optimized as well, the current implementation has to re-annotate the type that was discarded inGenericTypeReflector
internally.The text was updated successfully, but these errors were encountered: