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

Set state of enumerator object to "after" during disposal #76090

Merged
merged 13 commits into from
Dec 2, 2024

Conversation

jcouv
Copy link
Member

@jcouv jcouv commented Nov 26, 2024

Fixes #76078 (scenarios where resuming iteration after disposal can continue executing user code).
This change is pending on approval for breaking change. This behavior exists as far back as the native compiler.

Note: there are more scenarios left where we don't properly set the state to "after", but the impact is much less impactful. Filed follow-up issue #76089 (scenarios where iterating a second time will allocate a new enumerator instance).

@jcouv jcouv self-assigned this Nov 26, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Nov 26, 2024
@jcouv jcouv marked this pull request as ready for review November 26, 2024 22:29
@jcouv jcouv requested a review from a team as a code owner November 26, 2024 22:29
Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

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

LGTM (commit 13)

Copy link
Member

Choose a reason for hiding this comment

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

Will @BillWagner need to do any manual work to get this published, since it's a new doc? Or will it flow automatically?

@jaredpar jaredpar removed the untriaged Issues and PRs which have not yet been triaged by a lead label Dec 2, 2024
@jcouv
Copy link
Member Author

jcouv commented Dec 2, 2024

The breaking change was approved in email. I'll go ahead and merge.

@jcouv jcouv merged commit c4598d2 into dotnet:main Dec 2, 2024
24 checks passed
@jcouv jcouv deleted the set-after branch December 2, 2024 21:10
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Dec 2, 2024
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.

Enumerators incorrectly allow continued enumerator after disposal
4 participants