www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9968] New: Common type of string literal and null does not convert to const(char)*

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

           Summary: Common type of string literal and null does not
                    convert to const(char)*
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: yebblies gmail.com


--- Comment #0 from yebblies <yebblies gmail.com> 2013-04-20 23:21:39 EST ---
This code:

void main()
{
    const(char)* type = true ? "main" : null;
}

Gives this error:

testx.d(4): Error: cannot implicitly convert expression ("main") of type string
to const(char)*

Even though both expressions can implicitly convert to const(char)*

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