Bug 9862 – dchar concat "string literal" is not allowed

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2013-04-02T09:54:52Z
Last change time
2024-12-13T18:05:48Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
bearophile_hugs
Moved to GitHub: dmd#18555 →

Comments

Comment #0 by bearophile_hugs — 2013-04-02T09:54:52Z
void main() { dchar c = 'A'; dstring s0 = "bcd"; // OK auto s1 = c ~ s0; // OK auto s2 = c ~ "bcd"; // Error, bad. string s3 = "bcd"; auto s4 = c ~ s3; // Error, good. } dmd 2.063alpha gives: temp.d(5): Error: incompatible types for ((c) ~ ("bcd")): 'dchar' and 'string' temp.d(7): Error: incompatible types for ((c) ~ (s3)): 'dchar' and 'string' The line of s4 is an expected error. But I think the error with s2 should not happen.
Comment #1 by robert.schadek — 2024-12-13T18:05:48Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18555 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB