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

Yuxuan Shui yshuiv7 at gmail.com
Mon Apr 8 12:01:39 UTC 2019


On Monday, 8 April 2019 at 10:41:25 UTC, Daniel N wrote:
> On Monday, 8 April 2019 at 10:10:14 UTC, Yuxuan Shui wrote:
>> On Sunday, 7 April 2019 at 21:19:20 UTC, Walter Bright wrote:
>>> On 4/7/2019 10:14 AM, Yuxuan Shui wrote:
>>>> this proposal seems to mandate the inclusion of parameter 
>>>> names in mangled name of functions.
>>>
>>> Nope.
>>
>> OK, I probably misunderstood, but what happens in the 
>> following case?
>>
>> void fun(int a, int b) {...}
>> void fun(int c, int d) {...}
>>
>> fun(c:1, d:1);
>>
>>
>> Is it ambiguous? Or does it invoke the second function? If the 
>> latter, then you have to include the parameter names in 
>> mangled name.
>
> 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


More information about the Digitalmars-d mailing list