Overload resolution simplification

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Mon Aug 12 02:48:57 PDT 2013


On 12/08/13 03:11, Neal Gafter wrote:
> On Sun, Aug 11, 2013 at 2:23 AM, maurizio cimadamore 
> <maurizio.cimadamore at oracle.com 
> <mailto:maurizio.cimadamore at oracle.com>> wrote:
>
>     On 10-Aug-13 10:52 PM, Remi Forax wrote:
>
>         You mean if you have overloads that are generics ?
>
>     No - in general; as soon as you start type-checking a lambda once
>     per overload I think it's unavoidable to end up in a combinatorial
>     scenario for lambda such as this:
>
>     m(x->g(y->f(...)))
>
>     where m, g, f are overloads.
>
>
> This is true.  However in practice
>
>  1. the compiler can cache the results of the conversion of each
>     lambda to each target type that is attempted, which eliminates
>     most of the work, and
>  2. people do not write code such as this except to stress your compiler.
>
For the records, Javac already does (1).

Maurizio
> Cheers,
> Neal



More information about the lambda-spec-observers mailing list