Skip to content

Fix syntax map for unmodified partial constructor#80417

Merged
tmat merged 1 commit intodotnet:mainfrom
tmat:PartialInit
Sep 24, 2025
Merged

Fix syntax map for unmodified partial constructor#80417
tmat merged 1 commit intodotnet:mainfrom
tmat:PartialInit

Conversation

@tmat
Copy link
Member

@tmat tmat commented Sep 23, 2025

Fixes #79320

@tmat tmat requested a review from a team as a code owner September 23, 2025 02:02
@tmat
Copy link
Member Author

tmat commented Sep 23, 2025

@DustinCampbell ptal

using var _1 = PooledHashSet<ISymbol>.GetInstance(out var addedSymbolsBuilder);
using var _2 = ArrayBuilder<(ISymbol? oldSymbol, ISymbol? newSymbol)>.GetInstance(edits.Count, out var resolvedSymbols);

foreach (var edit in edits)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extracted to ResolveSymbols


return otherNode;

static int GetChildIndex(SyntaxNode parent, SyntaxNode node)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be implemented more efficiently in the compiler, or if the SyntaxNode exposed SlotIndex API.

Copy link
Member

@DustinCampbell DustinCampbell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@tmat tmat merged commit e0de963 into dotnet:main Sep 24, 2025
25 checks passed
@tmat tmat deleted the PartialInit branch September 24, 2025 20:37
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Sep 24, 2025
@tmat
Copy link
Member Author

tmat commented Sep 25, 2025

/backport to release/dev18.0

@github-actions
Copy link
Contributor

phil-allen-msft added a commit that referenced this pull request Sep 30, 2025
…constructor (#80462)

Backport of #80417 to release/dev18.0

/cc @tmat

## Customer Impact

## Regression

- [ ] Yes
- [x] No

[If yes, specify when the regression was introduced. Provide the PR or
commit if known.]

## Testing

[How was the fix verified? How was the issue missed previously? What
tests were added?]

## Risk

[High/Medium/Low. Justify the indication by mentioning how risks were
measured and addressed.]
@davidwengier davidwengier modified the milestones: Next, 18.3 Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HR fails when removing a property with an initializer from a partial class

3 participants