Skip to content

Conversation

@KevinRansom
Copy link
Contributor

Fixes #5910

The coreclr has a bug with SZGenericArrayEnumerators. The bug causes it to not throw when accessing Current for an exhausted collection. The Coreclr team will fix this bug, however.

This PR introduces a correctly operating enumerator where we have a dependence on SZGenericArrayEnumerator.

We missed this in testing because we use an old version of the coreclr which doesn't have the bug.

This PR, continues to use the framework implementation on FSharp.Core.dll built for the NETFramework, because that code is correct and ngened in all scenarios.

@KevinRansom KevinRansom requested a review from dsyme November 17, 2018 06:56
let kvps = [| for (KeyValue (k,v)) in t -> KeyValuePair (getKey k, v) |] :> seq<_>
kvps.GetEnumerator()
#else
let endIndex = t.Count
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer this be called count since that's how it's used, but this isn't a hill I'm going to die on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@brettfo endindex is the name for that value in the original bcl source code. I too chuckled over the ridiculousness of the name.

@KevinRansom KevinRansom merged commit f1558b7 into dotnet:master Nov 19, 2018
@KevinRansom KevinRansom deleted the fix5910 branch February 28, 2019 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dict has invalid enumerator on dotnet core

3 participants