call operator and orthogonality with existing VM internals
Neal Gafter
neal at gafter.com
Tue Mar 9 09:57:32 PST 2010
On Tue, Mar 9, 2010 at 9:24 AM, Jakob Praher <jp at hapra.at> wrote:
>> BGGA manages to handle function types with covariant returns and
>> contravariant argument types by treating then as instances of generic
>> interfaces using wildcards.
>
> Makes sense. Thought about that but had problems since one has to specify
> that in the formal parameters. This relation is not (easily) encodable in
> the type definition itself. Function1<? extends R, ? super T> (leaving out
> exceptions) has to be used as formal parameters otherwise no "subtyping will
> be posisble".
Which is why BGGA provides a special syntax for function types that
inserts the wildcards for you.
> This is also what I meant that here the out-of-box usablity of function
> types (as interfaces) is limited. (Was this also one of the reason that you
> introduced the {..=>..) syntax?)
Exactly.
More information about the lambda-dev
mailing list