Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EnC: Generate correct state mapping for methods containing await foreach #69806

Merged
merged 6 commits into from
Sep 26, 2023

Conversation

tmat
Copy link
Member

@tmat tmat commented Sep 3, 2023

await foreach emits two async calls: MoveNextAsync and DisposeAsync. Both are associated with the same syntax node (offset), which caused a collision in a syntax offset to state number map.

The PR adds general support for language features that emit multiple awaits for a single syntax node. Currently that's only await foreach in C#, but in future it may be other new language features.

Each await associated with the same syntax node needs to be assigned a unique relative state ordinal. This number is then included in the key of the mapping.

Fixes #69805

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Sep 3, 2023
@tmat tmat force-pushed the EncAsyncIteratorFix branch from 7e06ae0 to 19de570 Compare September 12, 2023 23:50
@tmat tmat force-pushed the EncAsyncIteratorFix branch from 19de570 to d8718a5 Compare September 15, 2023 16:14
@tmat tmat marked this pull request as ready for review September 15, 2023 20:57
@tmat tmat requested a review from a team as a code owner September 15, 2023 20:57
@tmat
Copy link
Member Author

tmat commented Sep 15, 2023

@cston @AlekseyTs @davidwengier @dotnet/roslyn-compiler PTAL

@jaredpar jaredpar added this to the 17.8 milestone Sep 19, 2023
@jaredpar
Copy link
Member

@tmat consider retargeting to release/dev17.8 before merging as snap has occured.

@tmat tmat changed the base branch from main to release/dev17.8 September 26, 2023 18:59
@tmat tmat merged commit 482645e into dotnet:release/dev17.8 Sep 26, 2023
@tmat tmat deleted the EncAsyncIteratorFix branch September 26, 2023 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EnC fails in method containing await foreach
4 participants