feat: only emit Properties setter when it contains elements - #4407
Conversation
TimothyMakkison
commented
Jan 14, 2026
While I can run some tests, anything that relies on |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This is really annoying :( Does the compiler give any sort of error or anything? |
5f52e8c to
49faef8Compare
👍 added. Was thinking of looking at the source generators performance as I assume they contribute to build times. Can't imagine it's possible to do any more incremental generator caching due to the nature of
Just checking; you do have an extension which lets you mass approve verify changes right? I don't want to waste your evening 😅 |
thomhurst
commented
Jan 14, 2026
I wonder if it's failing to run on your machine for some reason (it's a source generator) |
thomhurst
commented
Jan 14, 2026
Yep! |
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
thomhurst
commented
Jan 14, 2026
SummaryThis PR optimizes source generator output by only emitting the Critical IssuesNone found ✅ SuggestionsMinor: Consider extracting loop body to helper methodThe PR author mentioned in the description: "I did think that the loop could be a dedicated helper method inside
However, this would require:
This is not blocking and can be done in a follow-up if desired. Observation: Consistent optimization patternsThe change is applied to both overloads of the property array generation methods ( Verification Checklist✅ Snapshot tests updated: All 100+ Verdict✅ APPROVE - Clean optimization that reduces generated code size without affecting functionality. |
Uh oh!
There was an error while loading. Please reload this page.
Only emit
ClassMetadatareference setter when there are properties cutting down on unneeded generated code. Might have a tiny performance benefit 🤷 the JIT is hard to understand.I did think that the loop could be a dedicated helper method inside
TUnit.Core