First draft of translation document - contravariance
Reinier Zwitserloot
reinier at zwitserloot.com
Tue May 18 17:32:04 PDT 2010
Now I'm a bit confused. That sounds like this:
#void(Integer) vi = #void(Integer i) { };
#void(String) vs = vi;
would be legal as well which should be wrong, no?
--Reinier Zwitserloot
On Tue, May 18, 2010 at 11:10 AM, Rémi Forax <forax at univ-mlv.fr> wrote:
> 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