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

Mr. Smith <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from Mr. Smith <[email protected]> ---
Have the same bug. Example:

---
import std.traits : getUDAs;
void main(){}
struct Struct {
    int value;
}
enum Enum {
    @Struct(42) first,
}
static assert(getUDAs!(Enum.first, Struct)[0] == Struct(42));
static assert(__traits(getAttributes, Enum.first)[0] == Struct(42)); // this
version always works
---
app.d(7): Error: undefined identifier Struct
app.d(9): Error: template instance std.traits.getUDAs!(cast(Enum)0, Struct)
error instantiating
app.d(9):        while evaluating: static assert((__error)[0] == Struct(42))


However if I swap static asserts it compiles:

---
import std.traits : getUDAs;
void main(){}
struct Struct {
    int value;
}
enum Enum {
    @Struct(42) first,
}
static assert(__traits(getAttributes, Enum.first)[0] == Struct(42));
static assert(getUDAs!(Enum.first, Struct)[0] == Struct(42));
---

--

Reply via email to