-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Enumerators incorrectly allow continued enumerator after disposal #76078
Comments
Do we have a driving customer scenario for breaking behavior here? |
@jaredpar This surfaced when the runtime repo tried to update their reference to roslyn. Since last week, we include logic to clear locals in the The options are:
|
Just curious, but could you explain this bit in the changelog?
Why was that incorrect? The spec explicitly says doing so is UB, no? By eg. updating the logic to do manual cleanup from |
The case that is unspecified behavior is when |
The current implementation allows continuing the enumeration of an enumerator after its disposal:
According to Spec for MoveNext and Dispose for enumerators,
MoveNext
should returnfalse
after disposal:The text was updated successfully, but these errors were encountered: