Duplicate :
|
The types MethodHandle and InvokeDynamic support signature-polymorphic calls. This needs to be suitably modeled by the Core Reflection API. Probably getDeclaredMethod needs to return a different Method for every requested set of argument types, for signature-polymorphic names. Clearly getDeclaredMethods cannot return an infinite list of overloads. There does not seem to be a way to specify non-default return value types.