Flag proposal

Nick Sabalausky a at a.a
Tue Jun 14 12:55:39 PDT 2011


"Michel Fortin" <michel.fortin at michelf.com> wrote in message 
news:it7kq2$26ha$1 at digitalmars.com...
>
> Also, with reordering, if you have two overloaded functions of this form:
>
> void fun(int a, string b) {}
> void fun(string b, int a) {}
>
> which one does this calls:
>
> fun(a: 1, b: "hello");
>
> ? Does the call become ambiguous when using named arguments?

I'd say "yes". But even if you said "no, the winner is whichever matches the 
order given, if there is a perfect match", that would be fine too.

I'd further argue that either way it's not a significant problem, because it 
seems that situation would be extremely rare. And the only realistic case I 
can think of where it would might occur is if the callee wants to allow 
re-ordered params. But that would already solved by re-orderable names 
arguments anyway.

> It wouldn't be ambiguous if reordering wasn't allowed. What does C# does 
> with this?
>




More information about the Digitalmars-d mailing list