http://d.puremagic.com/issues/show_bug.cgi?id=2606

           Summary: string literals unnecessarily prone to wide conversion
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzi...@digitalmars.com
        ReportedBy: and...@metalanguage.com


void f(const(char)[] s) {}
void f(const(dchar)[] s) {}

void main()
{
    f("abc");
    auto a = "abc";
    f(a);
}

The first call issues an ambiguity. This is inconsistent with the second call
through a named variable.

String literals should receive an implicit preferred type and that should not
make calls ambiguous.


-- 

Reply via email to