[Issue 9968] New: Common type of string literal and null does not convert to const(char)*
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Apr 20 06:21:41 PDT 2013
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 at puremagic.com
ReportedBy: yebblies at gmail.com
--- Comment #0 from yebblies <yebblies at 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: -------
More information about the Digitalmars-d-bugs
mailing list