November 03, 2023 [Issue 24223] __traits(initSymbol) should work for enum types | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24223 --- Comment #1 from Paul Backus <snarwin+bugzilla@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. -- |
November 04, 2023 [Issue 24223] __traits(initSymbol) should work for enum types | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24223 Paul Backus <snarwin+bugzilla@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |WONTFIX --- Comment #2 from Paul Backus <snarwin+bugzilla@gmail.com> --- >From kinke on the dlang Slack: > Yeah just checked - no regular init symbol. The TypeInfo.init is a slice to an ad-hoc constant emitted together with the TypeInfo; it's not guaranteed to be available if the TypeInfo is never referenced, and doesn't have a well-defined mangle. So, it seems like this is probably not feasible. Closing as WONTFIX. -- |
Copyright © 1999-2021 by the D Language Foundation