www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2606] New: string literals unnecessarily prone to wide conversion

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: andrei 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.


-- 
Jan 23 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2606


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au


--- Comment #1 from Don <clugdbug yahoo.com.au> 2010-04-27 11:31:01 PDT ---
I think this is the same as bug 2367 (although with a stronger example).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 27 2010