www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23776] New: getSymbolsByUDA fails to fetch symbols from module

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

          Issue ID: 23776
           Summary: getSymbolsByUDA fails to fetch symbols from module
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: hsteoh qfbox.info

Code:
-------mod.d--------
struct Tag {}
 Tag struct MyStructA {}
 Tag struct MyStructB {}
 Tag struct MyStructC {}
--------------------

-------test.d-------
import std.traits : getSymbolsByUDA;
import mod;
alias components = getSymbolsByUDA!(mod, Tag);
static assert(components.length > 0);
--------------------

Compile command: dmd -main -i test.d

Expected behaviour: assert shouldn't trigger, getSymbolsByUDA should return a
list with MyStructA, MyStructB, and MyStructC.

Git bisect shows that the offending commit is:
e305dc9f79cc98579257f588308bb2322fd843df



applied there does not cover the above case, as both dmd git master
(9d2d21f48762) and LDC 1.32.0 exhibit this problem.

--
Mar 12 2023