DIP 1019--Named Arguments Lite--Community Review Round 2

Walter Bright newshound2 at digitalmars.com
Fri Jun 7 06:30:15 UTC 2019


On 6/6/2019 2:43 PM, Aliak wrote:
> On Thursday, 6 June 2019 at 20:04:15 UTC, Walter Bright wrote:
>>    discovered as necessary behavior. Consider:
>>
>>     void snoopy(T t, int i, S s);     // A
>>     void snoopy(S s, int i = 0; T t); // B
>>
>> and calling it:
>>
>>     snoopy(t:t, i, s:s); // A
>>     snoopy(s:s, t:t, i); // A
> 
> Trying to understand why the last two call A and are not ambiguous?

Argument `i` is not named, and so can only appear after `t` in A, and only after 
`s` in B. This only works for A.



More information about the Digitalmars-d mailing list