Bug 9968 – Common type of string literal and null does not convert to const(char)*

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-04-20T06:21:39Z
Last change time
2024-12-13T18:06:15Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
yebblies
Moved to GitHub: dmd#18568 →

Comments

Comment #0 by yebblies — 2013-04-20T06:21:39Z
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)*
Comment #1 by robert.schadek — 2024-12-13T18:06:15Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18568 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB