[Issue 20607] [shared] static constructor & co can be called as regular function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 8 18:20:47 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20607

--- Comment #5 from Mathias LANG <pro.mathias.lang at gmail.com> ---
> I don't see how. @system is designed to allow breaking the type system. @trusted code is not allowed to do so.

The compiler doesn't let you change `immutable` values in `@system` functions.

> How is accessing identifiers by internal names accidental?

*Exposing* them was accidental. You can access them at runtime with module
info. It would be good to have a way to access them at compile-time too, and
I'm fine with this being a blocker to solve this issue. E.g. adding
`__traits({ctors, dtor}, SYM)`.

--


More information about the Digitalmars-d-bugs mailing list