[Issue 2606] New: string literals unnecessarily prone to wide conversion

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 23 11:16:26 PST 2009


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: bugzilla at digitalmars.com
        ReportedBy: andrei at 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.


-- 



More information about the Digitalmars-d-bugs mailing list