Skip to content

Commit 513ce76

Browse files
committed
Thin direct calls to IEnumerable.GetEnumerator
1 parent 65f78eb commit 513ce76

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/fsharp/FSharp.Core/seqcore.fs

+6
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,9 @@ namespace Microsoft.FSharp.Collections.SeqComposition
479479
count <- count + 1
480480
count
481481

482+
interface IEnumerable<'T> with
483+
member __.GetEnumerator () = enumerable.GetEnumerator ()
484+
482485
type DelayedEnumerable<'T>(delayed:unit->ISeq<'T>, pipeIdx:PipeIdx) =
483486
inherit EnumerableBase<'T>()
484487

@@ -590,6 +593,9 @@ namespace Microsoft.FSharp.Collections.SeqComposition
590593
override __.Length () = array.Length
591594
override __.GetRaw () = upcast array
592595

596+
interface IEnumerable<'T> with
597+
member __.GetEnumerator () = (array:>IEnumerable<'T>).GetEnumerator ()
598+
593599
type SingletonEnumerable<'T>(item:'T) =
594600
inherit EnumerableBase<'T>()
595601

src/fsharp/FSharp.Core/seqcore.fsi

+2
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ namespace Microsoft.FSharp.Collections.SeqComposition
118118
type internal ThinArrayEnumerable<'T> =
119119
inherit ArrayEnumerable<'T, 'T>
120120
new : array<'T> -> ThinArrayEnumerable<'T>
121+
interface IEnumerable<'T>
121122

122123
type internal VanillaEnumerable<'T,'U> =
123124
inherit SeqFactoryBase<'T,'U>
@@ -127,6 +128,7 @@ namespace Microsoft.FSharp.Collections.SeqComposition
127128
type internal ThinEnumerable<'T> =
128129
inherit VanillaEnumerable<'T,'T>
129130
new : IEnumerable<'T> -> ThinEnumerable<'T>
131+
interface IEnumerable<'T>
130132

131133
type internal UnfoldEnumerable<'T,'U,'GeneratorState> =
132134
inherit SeqFactoryBase<'T,'U>

0 commit comments

Comments
 (0)