Signature of MethodHandleInfo.reflectAs is not specific enough

Peter Levart peter.levart at gmail.com
Mon Nov 11 00:35:49 PST 2013


On 11/11/2013 08:14 AM, Peter Levart wrote:
> The method could simply be:
>
>     public <T extends Member> T reflect(Lookup lookup);

But if one needs to hint the compiler, explicit type parameters can be 
used as an escape hatch as always:
>
>     Object o = info.<Method>reflect(lookup);
>

Well, well, explicit type parameters for method invocation are not 
needed in above example:

     Object o = info.reflect(lookup); // compiles

One would only need them in situations like:

     info.<Method>reflect(lookup).invoke(...);


Regards, Peter



More information about the mlvm-dev mailing list