DIP 1020--Named Parameters--Community Review Round 1

Yuxuan Shui yshuiv7 at gmail.com
Mon Apr 8 13:31:24 UTC 2019


On Monday, 8 April 2019 at 13:11:51 UTC, ShadoLight wrote:
> On Monday, 8 April 2019 at 12:01:39 UTC, Yuxuan Shui wrote:
>
> [..]
>
>
>>> The compiler will directly reject...
>>>
>>> void fun(int a, int b) {...}
>>> void fun(int c, int d) {...}
>>>
>>> ...  before you even try to call 'fun'.
>>
>> Contrary to popular belief, it won't.
>>
>> https://d.godbolt.org/z/Bmc-Qb
>
>
> In line with popular belief it will. Try calling 1 of the 2 
> functions i.e.:
>
> int x = fun(3,4);
>
> You have to call one of them for the compiler to be (un)able to 
> resolve the call.

Yes. But the post I was replying to says: "The compiler will 
directly reject...  before you even try to call 'fun'.", which is 
not true.


More information about the Digitalmars-d mailing list