First draft of translation document - contravariance

Rémi Forax forax at univ-mlv.fr
Tue May 18 02:10:18 PDT 2010


Le 18/05/2010 11:01, Howard Lovatt a écrit :
> I am guessing that the following will fail with the suggested
> MethodHandle translation (it is hard to say from the JSR292
> literature):
>
> #String(Object) so = #String(final Object o) (o.toString());
> #Object(String) os = so;
>
> Assuming it does fail, this failure may not be important since the use
> case is rare. Therefore this is post is a request for clarification
> rather than a criticism.
>
>    -- Howard.
>
>    

#String(Object) and #Object(String) will be erased to java.dyn.MethodHandle
so it doesn't fail.

BTW, jdk7 beta binaries already contain a preview of JSR 292 API,
this is not the final API and there are some known bugs
but you can already play with it.

cheers,
Rémi





More information about the lambda-dev mailing list