csharp: emit property nodes for record positional parameters - #481
Merged
Conversation
zzet
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the #478 review comment: positional record parameters — the synthesized public properties that are a record's defining members — emitted nothing.
public record Medal(int Id, string Motto)produced theMedaltype node with noMedal.IdorMedal.Motto.Unlike the #478 gap, there is no declaration node for the member walk to find: the properties exist only in the compiler's synthesis. So the record's container emission now fabricates one property node per positional parameter, with the declared parameter type riding as
field_type, public visibility, apositional: trueprovenance marker, and the usual defines/member_of edges. One grammar wrinkle handled along the way: a record'sparameter_listcarries no field name (unlike method parameters), so it is found by child-type scan.Container emission precedes the body's member matches in tree order, so an explicit redeclaration of a positional property (legal C# — it replaces the synthesized one) deduplicates to a single node for the same logical member. Covers
recordandrecord struct.Tests: property nodes for both positional parameters plus the record-struct case (kind, receiver, declared type, visibility, member_of edge), coexistence with explicit body members, and the redeclaration dedupe. Written first, watched fail.
internal/parser/languagesfully green; resolver and indexer at their pre-existing Windows baselines.Validated live on a counted C# fixture repo: all six authored positional properties emit (across
record,record struct, and a record with mixed positional + explicit members), pinned as counted battery cells, green twice.Bumps the
csharpextractor version 6→7 to restage.csfiles.