pragma msg field name?
Steven Schveighoffer
schveiguy at gmail.com
Wed Jun 28 01:28:57 UTC 2023
On 6/27/23 6:34 PM, Adam D Ruppe wrote:
> On Tuesday, 27 June 2023 at 22:20:22 UTC, Chris Katko wrote:
>> pragma(msg, t.stringof); // does not see any new fields!
>
> D's declarations are all order-independent, in theory those foreaches
> are done simultaneously, so it is kinda a race condition.
In particular the practice of adding new members based on introspecting
other members is suspect. I've done it too, but I think it probably
would be better if we didn't allow this kind of stuff, or came up with a
sane way to do this.
This leads to all kinds of weird stuff. Like if you instantiate a
template with the current type being compiled, that template is locked
to that type *at that point in compilation*. Then you look at it outside
the type, and the value is already cached.
-Steve
More information about the Digitalmars-d-learn
mailing list