D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7402 - Appending enum string causes type change?
Summary: Appending enum string causes type change?
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid, wrong-code
Depends on:
Blocks:
 
Reported: 2012-01-30 15:17 UTC by Justin Whear
Modified: 2012-05-24 15:28 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Justin Whear 2012-01-30 15:17:00 UTC
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.
Comment 1 yebblies 2012-01-30 18:07:31 UTC
Probably related to issue 6504.
Comment 2 SomeDude 2012-04-19 14:53:53 UTC
Compiles on 2.059
Comment 3 Justin Whear 2012-05-24 15:28:15 UTC
Fixed in 2.058.