Bug 7402 – Appending enum string causes type change?
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-01-30T15:17:00Z
Last change time
2012-05-24T15:28:15Z
Keywords
rejects-valid, wrong-code
Assigned to
nobody
Creator
justin
Comments
Comment #0 by justin — 2012-01-30T15:17:00Z
This program:
enum TEST = "test";
string valid = "this is a " ~ TEST;
char[] sabotage = cast( char[] )"this is a " ~ TEST;
string no_longer_valid = "this is a " ~ TEST;
void main() {}
Fails to compile with this error:
Error: cannot implicitly convert expression ("this is a test") of type char[] to string
Commenting out the "char[] sabotage..." allows the program to compile.