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

[Bug] Double-evaluation of selector in SelectMany #20143

Closed
jamesqo opened this issue Feb 8, 2017 · 4 comments
Closed

[Bug] Double-evaluation of selector in SelectMany #20143

jamesqo opened this issue Feb 8, 2017 · 4 comments

Comments

@jamesqo
Copy link
Contributor

jamesqo commented Feb 8, 2017

I found out my changes from dotnet/corefx#14675 introduced a double-evaluation of a selector in SelectMany.ToArray: https://github.com/dotnet/corefx/blob/master/src/System.Linq/src/System/Linq/SelectMany.cs#L245 This will be fixed shortly in an upcoming PR, but I am opening a tracking issue just in case I forget or that PR gets closed.

@stephentoub
Copy link
Member

Thanks, @jamesqo. I thought we'd added tests to help avoid such bugs... I guessed we missed some cases. It'd be great to get a more thorough set for this. cc: @JonHanna

@JonHanna
Copy link
Contributor

JonHanna commented Feb 8, 2017

You put forward the idea of having tests that both guarded against double evaluation of enumerables and against changes to how often delegates where called. At the time you said that I was already working on the first part of that, and submitted a PR saying I'd look at the other part "soon". Soon has yet to happen.

@stephentoub
Copy link
Member

Ah, gotcha, I misremembered. Thanks!

@JonHanna
Copy link
Contributor

JonHanna commented Feb 8, 2017

Or you remembered my saying "soon" too well. It's definitely something we should have, but ensuring it has coverage would be a bit tricky. Maybe a trait could help there.

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.0.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants