D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 17333 - Disallow concat of string with integer enum
Summary: Disallow concat of string with integer enum
Status: RESOLVED DUPLICATE of issue 14035
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P1 minor
Assignee: Lucia Cojocaru
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2017-04-19 14:18 UTC by Nick Treleaven
Modified: 2022-10-28 17:39 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Nick Treleaven 2017-04-19 14:18:50 UTC
int n = 2;
//enum int n = 2;
string s = "" ~ n;

The above with dmd v2.074.0 produces:
ctforeachn.d(18): Error: incompatible types for (("") ~ (n)): 'string' and 'int'

However, using enum for n instead, the code compiles. It should produce the same error.
Comment 1 Nick Treleaven 2022-10-28 17:39:20 UTC

*** This issue has been marked as a duplicate of issue 14035 ***