www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21790] New: Finding template UDAs is not possible

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 puremagic.com
          Reporter: eyal 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

--
Apr 02