File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ type Iterate =
45
45
static member Iterate ( x : Choice < 'T , 'E > , action ) = match x with Choice1Of2 x -> action x | _ -> ()
46
46
static member Iterate ( KeyValue ( _ : 'Key , x : 'T ), action ) = action x : unit
47
47
static member Iterate ( x : Map < 'Key , 'T > , action ) = Map.iter ( const' action) x
48
- static member Iterate ( x : Dictionary < 'Key , 'T > , action ) = Dictionary .iterValues action x
48
+ static member Iterate ( x : IDictionary < 'Key , 'T >, action ) = Dict .iterValues action x
49
49
static member Iterate ( x : _ ResizeArray , action ) = ResizeArray.iter action x
50
50
51
51
// Restricted
Original file line number Diff line number Diff line change @@ -487,6 +487,21 @@ module Functor =
487
487
let nel = zip ( NonEmptyList.ofList [ 1 ; 2 ]) ( NonEmptyList.ofList [ " a" ; " b" ; " c" ])
488
488
CollectionAssert.AreEqual ( NonEmptyList.ofList [ 1 , " a" ; 2 , " b" ], nel)
489
489
490
+ [<Test>]
491
+ let iterTests () =
492
+ let di = new Dictionary< int, int>()
493
+ di.Add ( 1 , 2 )
494
+ di.Add ( 3 , 4 )
495
+ let id = dict [ 1 , 2 ; 3 , 4 ]
496
+ let ir = readOnlyDict [ 1 , 2 ; 3 , 4 ]
497
+
498
+ let r = ResizeArray< string> []
499
+
500
+ iter ( fun x -> r.Add ( string x)) di
501
+ iter ( fun x -> r.Add ( string x)) id
502
+ iter ( fun x -> r.Add ( string x)) ir
503
+ CollectionAssert.AreEqual ( ResizeArray [ " 2" ; " 4" ; " 2" ; " 4" ], r)
504
+
490
505
491
506
492
507
module Foldable =
You can’t perform that action at this time.
0 commit comments