www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21251] New: parameter UDA type not equal to itself


          Issue ID: 21251
           Summary: parameter UDA type not equal to itself
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: elpenguino+D gmail.com

enum A;
static if (is(typeof(& func) Fsym : Fsym*)) {
    static if (is(Fsym P == function)) {
        static assert(is(A == A)); //okay
        static assert(is(__traits(getAttributes, P[0 .. 1])[0] == A)); //wait,
what? A != A?

void func( A int) {}

The static asserts in this code should both pass. Interestingly, DMD 2.084 -
2.091 seem to crash instead of producing any errors.

Sep 15 2020