[Issue 21790] New: Finding template UDAs is not possible

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 2 14:08:00 UTC 2021


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

          Issue ID: 21790
           Summary: Finding template UDAs is not possible
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: eyal at weka.io

import std.traits: hasUDA, getUDAs;

    struct uda(T) {}
    @uda int var;

    static assert(hasUDA!(var, uda)); // fails
    static assert(getUDAs!(var, uda).length == 1); // fails
    static assert(is(getUDAs!(var, uda)[0] == uda)); // fails

--


More information about the Digitalmars-d-bugs mailing list