Array as an argument, ambiguous behaviour.

Cooler kulkin at hotbox.ru
Wed Jan 29 05:15:29 PST 2014


On Wednesday, 29 January 2014 at 12:40:00 UTC, Tobias Pankrath 
wrote:
> On Wednesday, 29 January 2014 at 11:46:23 UTC, Cooler wrote:
>> Thank you for detailed explanation. But the question is - "Is 
>> that correct that language allows ambiguous behavior?"
>
> Where is it ambiguous?

Ambiguity is here...
When I call fun1() or fun2() I know the behavior directly from 
function signature (read the comments in my first post). For 
fun3() case the caller side don't know the behavior directly from 
function signature. To know what will happen with array "a", the 
caller must see to fun3() body.
Ambiguity is - in first and second cases the caller knows what 
happens with "a", but in third case the caller does not know what 
happens with "a".


More information about the Digitalmars-d-learn mailing list