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.
*** This issue has been marked as a duplicate of issue 14035 ***