www.digitalmars.com         C & C++   DMDScript  

D - [BUG] function overloading: char[] vs wchar[]

reply "Andrew Edwards" <edwardsac spamfreeusa.com> writes:
void foo(char[] s)
{
}

void foo(wchar[] s)
{
}

void main()
{
  foo("test");
  foo(`test`);
}
Apr 20 2004
parent J C Calvarese <jcc7 cox.net> writes:
Andrew Edwards wrote:
 void foo(char[] s)
 {
 }
 
 void foo(wchar[] s)
 {
 }
 
 void main()
 {
   foo("test");
   foo(`test`);
 }

I think that's the intended behavior. Add a cast(char[]) or cast(wchar[]) to select which overload to use. See also: D/26437 -- Justin http://jcc_7.tripod.com/d/
Apr 21 2004