Function types versus arrays
Howard Lovatt
howard.lovatt at iee.org
Mon Feb 8 19:44:34 PST 2010
There is:
http://www.artima.com/weblogs/viewpost.jsp?thread=278567
That does indeed allow:
#int()[] ils = new #int()[1];
and catches:
ils[0] = #double() (1); // error
ils[0] = (#int()) #double() (1); // error
and would allow:
#T()[] tls = (#T()[]) new Object[1]; // unchecked warning
and would behave like generics:
tls[0] = #double() (1); // error
tls[0] = (#T()) #double() (1); // unchecked warning
but would catch at runtime:
tls[0] = (#T()) #double() (1); // unchecked warning
ils = (#int()) tls; // runtime error
-- Howard.
On 9 February 2010 01:54, Neal Gafter <neal at gafter.com> wrote:
> On Mon, Feb 8, 2010 at 5:33 PM, Howard Lovatt <howard.lovatt at iee.org>
> wrote:
> > If you have reified lambdas then you don't have a problem, if you have
> > erased lambdas then it is the same as generics.
>
> Right. And so far, we do not have any proposal that demonstrates how
> to do one without the other.
>
> Cheers,
> Neal
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
--
-- Howard.
More information about the lambda-dev
mailing list