[Issue 24223] __traits(initSymbol) should work for enum types
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Nov 3 02:24:09 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=24223
--- Comment #1 from Paul Backus <snarwin+bugzilla at gmail.com> ---
Addendum: it turns out that __traits(initSymbol) will compile without error for
enum types whose base types are class, struct, or union types. However, it
returns the initializer of the base type, not the initializer of the enum type.
Example:
---
struct S { int n; }
enum E : S { a = S(123) }
void main()
{
assert(__traits(initSymbol, E) is __traits(initSymbol, S));
}
---
Obviously, this behavior is incorrect.
--
More information about the Digitalmars-d-bugs
mailing list