Overload resolution simplification
Zhong Yu
zhong.j.yu at gmail.com
Mon Aug 19 09:48:17 PDT 2013
On Mon, Aug 19, 2013 at 11:22 AM, Maurizio Cimadamore
<maurizio.cimadamore at oracle.com> wrote:
> On 19/08/13 17:19, Zhong Yu wrote:
>>
>> I don't understand. Code writer/reader look at only one method to
>> figure out the lambda parameter type; from there the meaning of lambda
>> body and its return type is clear. (Though I'm not sure what happens
>> if the return value is another implicit lambda)
>
> What if the API is not as uniform as you'd like? I.e. you have multiple
> overloads suggesting different choices for the lambda parameter types (which
> is discouraged, but technically legal) ?
My preference is that it should be illegal; javac can report that it's
unable to determine a unique type for the lambda parameter from
overloaded methods.
>
> Maurizio
More information about the lambda-spec-observers
mailing list