ambiguation between char[] and dchar[]
BCS
ao at pathlink.com
Tue Jul 10 10:08:46 PDT 2007
Reply to Oskar,
> mandel skrev:
>
>> Hi,
>>
>> recently I stumbled over the problem where I call put("hello") on a
>> library class
>> but got something equivalent to this:
>> Test.d(158): function Test.put called with argument types:
>> (char[4])
>> matches both:
>> Test.put(dchar[])
>> and:
>> Test.put(wchar[])
>> The reason is obviously that class Test implements put(char[] s) and
>> put(dchar[] s) but also put(wchar[] s).
>>
>> Interestingly put(wchar[] s) isn't considered as ambiguous.
>>
> This is a flaw in DMD's error reporting. It only reports the two first
> ambiguous matches. I've been confused by that before.
>
How about:
Test.d(158): function Test.put called with argument types:
(char[4])
matches at least:
Test.put(dchar[])
and:
Test.put(wchar[])
More information about the Digitalmars-d
mailing list