Repository navigation
Conversation
Minimal, sound variant of dlang#23990: __SymbolSlice fields are immutable and only @System code can construct one, the class must have completed semantic, interfaceSymbol requires a generated ClassInfo, and symbol declarations are cached on the aggregate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| */ | ||
| struct __SymbolSlice(T) | ||
| { | ||
| @system size_t _length; |
There was a problem hiding this comment.
Shouldn't this be immutable too? and if we're here, why not just make the instance immutable?
|
Oh, I have another one with a bunch of edits going too... should I abandon mine? |
DMD perf check
Breakdown — compile hello.d
All measurements
0dbd861 vs merge-base 92ac966 · about these metrics |
I don't know if it's better either, I just wanted to test if the new |
|
I think determineVtbl was redundant; my Claude decided the reasons he did it was to facilitate some additional use cases, which yours here rejects as a forward reference. Like, I think your one here will fail if you do some variation of: class C
{
enum x = __traits(xxSymbol, C).length;
}There was a series of cases like this which determineVtbl solved, but I'm not sure they add value, and a forward-reference error is probably fine? |
Illustration for #23991