Bug 23977 – [REG2.102] cannot use getSymbolsByUDA on template struct with alias member

Status
NEW
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-06-07T22:06:30Z
Last change time
2024-12-01T16:41:28Z
Keywords
industry, pull, rejects-valid
Assigned to
No Owner
Creator
johanengelen
Moved to GitHub: phobos#10524 →

Comments

Comment #0 by johanengelen — 2023-06-07T22:06:30Z
Testcase: ``` struct S(string str) { alias strstr = str; int i; } struct A {} import std.traits; alias B = getSymbolsByUDA!(S!("a"), A); ``` Since dlang 2.102 this gives the error: Error: first argument is not a symbol Error: template instance `std.traits.getUDAs!("a", A)` error instantiating instantiated from here: `hasUDA!("a", A)` instantiated from here: `getSymbolsByUDAImpl!(S!"a", A, "strstr", "i")` <source>(10): instantiated from here: `getSymbolsByUDA!(S!"a", A)` Probably introduced by this PR: https://github.com/dlang/phobos/pull/8631
Comment #1 by dlang-bot — 2023-06-29T11:42:32Z
@RazvanN7 created dlang/phobos pull request #8775 "Fix Issue 23977 - [REG2.102] cannot use getSymbolsByUDA on template s[REG2.102] cannot use getSymbolsByUDA on template struct with alias member" fixing this issue: - Fix Issue 23977 - [REG2.102] cannot use getSymbolsByUDA on template struct with alias member https://github.com/dlang/phobos/pull/8775
Comment #2 by johanengelen — 2024-04-03T23:40:24Z
Workaround: change `alias` into `enum`: ``` struct S(string str) { enum strstr = str; int i; } ```
Comment #3 by robert.schadek — 2024-12-01T16:41:28Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10524 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB