Bug 24626 – hasUDA does not handle multiple UDAs of the same symbol
Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-06-24T06:48:43Z
Last change time
2024-06-25T02:07:43Z
Keywords
pull
Assigned to
No Owner
Creator
Li Junxiang
Comments
Comment #0 by kduice — 2024-06-24T06:48:43Z
This code fails to compile with ldc 1.38.0
import core.internal.traits : hasUDA;
enum SomeUDA;
struct Test
{
int woUDA;
@SomeUDA int oneUDA;
@SomeUDA @SomeUDA int twoUDAs;
}
static assert(hasUDA!(Test.oneUDA, SomeUDA));
static assert(hasUDA!(Test.twoUDAs, SomeUDA));
static assert(!hasUDA!(Test.woUDA, SomeUDA));
Error message:
Error: variable `test.Test.hasUDA!(twoUDAs, SomeUDA).__anonymous.hasUDA` conflicts with variable `test.Test.hasUDA!(twoUDAs, SomeUDA).hasUDA` at /opt/homebrew/Cellar/ldc/1.38.0/include/dlang/ldc/core/internal/traits.d(818)
test.d(13): Error: template instance `test.Test.hasUDA!(twoUDAs, SomeUDA)` error instantiating
test.d(13): while evaluating: `static assert(hasUDA!(twoUDAs, SomeUDA))`
Comment #1 by dlang-bot — 2024-06-24T07:00:18Z
@0-v-0 updated dlang/dmd pull request #16617 "fix hasUDA template to handle multiple UDAs" fixing this issue:
- Fix bugzilla 24626 - hasUDA does not handle multiple UDAs of the same symbol
https://github.com/dlang/dmd/pull/16617
Comment #2 by dlang-bot — 2024-06-25T02:07:43Z
dlang/dmd pull request #16617 "fix hasUDA template to handle multiple UDAs" was merged into master:
- be7f3fc65393accd492c1303abae9427b2a3aeb8 by 0-v-0:
Fix bugzilla 24626 - hasUDA does not handle multiple UDAs of the same symbol
https://github.com/dlang/dmd/pull/16617