www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21252] New: parameters inherit function UDAs

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

          Issue ID: 21252
           Summary: parameters inherit function UDAs
           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;
enum B;
static if (is(typeof(& func) Fsym : Fsym*)) {
    static if (is(Fsym P == function)) {
        static assert(__traits(getAttributes, P[0 .. 1]).length == 1);
        static assert(is(__traits(getAttributes, P[0 .. 1])[0] == A));
    }
}

 A
void func( B int) {}
```

The first parameter appears to have both  A and  B applied to it. I would only
expect  B.



--
Sep 15 2020