Bug 17333 – Disallow concat of string with integer enum

Status
RESOLVED
Resolution
DUPLICATE
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2017-04-19T14:18:50Z
Last change time
2022-10-28T17:39:20Z
Keywords
accepts-invalid
Assigned to
Lucia Cojocaru
Creator
Nick Treleaven

Comments

Comment #0 by nick — 2017-04-19T14:18:50Z
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 by nick — 2022-10-28T17:39:20Z
*** This issue has been marked as a duplicate of issue 14035 ***