Closed paul-bennett closed 5 months ago
Worth investigating the Method.getGenericXxx()
methods.
Looks like the trick will be to call t.getActualTypeArguments()
from TextOutput.decodeParameterizedType(ParameterizedType t)
rather than just pass t.getRawType()
down to the decodeType(Type)
method.
90% done... one remaining issue is that typenames used in actual parameters aren't stripped of imported packages yet.
When emitting a method with generic type parameters, Juggle invariably gets the answer wrong.
Compare this output:
with this from
javap
:Note how Juggle drops the wildcards and bounds, and doesn't correctly associate type variables across the entire signature (e.g. the type variable R is switched for T in the return type).