[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 13:59:58 UTC 2020


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

--- Comment #3 from Mathias LANG <pro.mathias.lang at gmail.com> ---
> I don't see why this is a problem as long as it's @system.

Because it breaks the type system, and even in `@system` code it is not
allowed.

> Allowing users to access D implementation plumbing at various levels is useful for things like custom unittest runners, allocation libraries, things like std.algorithm.move, etc.

Agreed, but accessing it should be conscious, not an accident. It was clearly
never intended to be accessed this way. I would prefer if we had a pragma for
this, for example, instead of magic names (we have the same problem with ctors
/ dtors in aggregate, where we can't name them but sometimes want to access
them).

--


More information about the Digitalmars-d-bugs mailing list