[Issue 18829] New: pragma msg of int incoherent

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat May 5 14:06:06 UTC 2018


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

          Issue ID: 18829
           Summary: pragma msg of int incoherent
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: oli_r at fg4f.de

When working with pragma(msg,...) in relation to
https://issues.dlang.org/show_bug.cgi?id=7947 I stumbled upon the following
behaviour:

pragma(msg, typeof(int.init)); // Works: int
pragma(msg, int); // Fails:
    // Error: found `)` when expecting `.` following int
    // Error: found `;` when expecting identifier following `int`.
    // ...

// but, obviously:
static assert(is(typeof(int.init) == int));

This seems to be related to `int` being a keyword, as everything works when
using an arbitrary struct.

--


More information about the Digitalmars-d-bugs mailing list