[Issue 21252] New: parameters inherit function UDAs
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Sep 16 01:45:03 UTC 2020
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 at puremagic.com
Reporter: elpenguino+D at 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.
Note that the second assert will fail until issue #21251 is fixed.
--
More information about the Digitalmars-d-bugs
mailing list