[Issue 23855] traits getOverloads returns overload when one of the symbols is a templatized function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 29 10:40:15 UTC 2024


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

Nick Treleaven <nick at geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick at geany.org

--- Comment #4 from Nick Treleaven <nick at geany.org> ---
> Deprecation: `__traits(getAttributes)` may only be used for individual functions, not overload sets such as: `test`

I get no deprecation message with recent dmd.

> Note: this is not a matter of the "includeTemplates" argument to `getOverloads`. If I set that to `true`, I still cannot actually get the attributes of the member symbols

This works:

@1
void test()() { }
@2
void test(int) { }

void main() {
    alias thisModule = __traits(parent, main);
    alias overloads = __traits(getOverloads, thisModule, "test", true);
    static foreach (member; overloads) {
        pragma(msg, __traits(getAttributes, member));
    }
}

--


More information about the Digitalmars-d-bugs mailing list