File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
src/FSharpPlus/Extensions Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -187,8 +187,8 @@ module Dict =
187
187
member __.Count = System.Int32.MaxValue
188
188
member __.ContainsKey ( _key : 'TKey ) = true
189
189
member __.Contains ( item : KeyValuePair < 'TKey , 'TValue >) = obj.ReferenceEquals ( item.Value, source)
190
- member __.GetEnumerator () = Seq.empty.GetEnumerator () :> System .Collections .IEnumerator
191
- member __.GetEnumerator () = Seq.empty.GetEnumerator () : IEnumerator < KeyValuePair < 'TKey , 'TValue >>
190
+ member __.GetEnumerator () = invalidOp " Key set is potentially infinite. " : System .Collections .IEnumerator
191
+ member __.GetEnumerator () = invalidOp " Key set is potentially infinite. " : IEnumerator < KeyValuePair < 'TKey , 'TValue >>
192
192
member __.IsReadOnly = true
193
193
member __.Values = icollection source
194
194
member __.Item
Original file line number Diff line number Diff line change @@ -436,6 +436,18 @@ module Functor =
436
436
Assert.IsInstanceOf< Option< Async< int>>> ( Some testVal10)
437
437
areEqual 2 ( testVal10 |> Async.RunSynchronously)
438
438
439
+ let testVal11 = (+) " h" <!> dict [ 1 , " i" ; 2 , " ello" ]
440
+ CollectionAssert.AreEqual ( dict [( 1 , " hi" ); ( 2 , " hello" )], testVal11)
441
+
442
+ let testVal12 =
443
+ let h : IDictionary < int , string > = result " h"
444
+ try
445
+ (+) <!> h <*> dict [ 1 , " i" ; 2 , " ello" ]
446
+ with _ -> dict [ 0 , " failure" ]
447
+ CollectionAssert.AreEqual ( dict [ 0 , " failure" ], testVal12)
448
+
449
+
450
+
439
451
[<Test>]
440
452
let unzip () =
441
453
let testVal = unzip { Head = ( 1 , 'a' ); Tail = [( 2 , 'b' );( 3 , 'b' )]}
You can’t perform that action at this time.
0 commit comments