[Issue 17333] New: Disallow CT concat of string with integer

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Apr 19 07:18:50 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17333

          Issue ID: 17333
           Summary: Disallow CT concat of string with integer
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: nick at geany.org

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.

--


More information about the Digitalmars-d-bugs mailing list