[Issue 24626] New: hasUDA does not handle multiple UDAs of the same symbol
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jun 24 06:48:43 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24626
Issue ID: 24626
Summary: hasUDA does not handle multiple UDAs of the same
symbol
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: trivial
Priority: P1
Component: druntime
Assignee: nobody at puremagic.com
Reporter: kduice at qq.com
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))`
--
More information about the Digitalmars-d-bugs
mailing list