Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Consistently Throw NotSupportedException on Enumerator Reset #2959

Merged
merged 1 commit into from
Aug 28, 2015

Conversation

JonHanna
Copy link
Contributor

Fixes #2879

Have Enumerable.Iterator's implementation of IEnumerator.Reset throw
NotSupportedException instead of NotImplementedException as both more
appropriate in itself, and more consistent with other IEnumerator.Reset
implementations.

Fixes #2879

Have Enumerable.Iterator<TSource>'s implementation of IEnumerator.Reset throw
NotSupportedException instead of NotImplementedException as both more
appropriate in itself, and more consistent with other IEnumerator.Reset
implementations.
@dnfclas
Copy link

dnfclas commented Aug 24, 2015

Hi @JonHanna, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla2.dotnetfoundation.org.

TTYL, DNFBOT;

@dnfclas
Copy link

dnfclas commented Aug 25, 2015

@JonHanna, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, DNFBOT;

@stephentoub
Copy link
Member

cc: @VSadov

@stephentoub
Copy link
Member

If this is a change we want to make, it LGTM. @VSadov, do you want to change the exception employed here?

@VSadov
Copy link
Member

VSadov commented Aug 28, 2015

Compiler-generated Reset throws NotSupportedException, so it makes sense for hand-written substitutes to throw that as well.

I do not think there is a compat issue here since calling Reset on iterators is rare, dependency on a particular exception thrown even more so, in particular since LINQ operators implemented as C# iterators (most of the operators) throw NSE.

@VSadov
Copy link
Member

VSadov commented Aug 28, 2015

LGTM

VSadov added a commit that referenced this pull request Aug 28, 2015
Consistently Throw NotSupportedException on Enumerator Reset
@VSadov VSadov merged commit 565dbb0 into dotnet:master Aug 28, 2015
@JonHanna JonHanna deleted the throw_not_supported_from_reset branch August 29, 2015 15:14
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…ed_from_reset

Consistently Throw NotSupportedException on Enumerator Reset

Commit migrated from dotnet/corefx@565dbb0
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants