@@ -551,31 +551,31 @@ module AsyncSeq =
551551 let state = ref ( TryWithState.NotStarted inp)
552552 { new IAsyncSeqEnumerator< 'T> with
553553 member x.MoveNext() =
554- async { match ! state with
554+ async { match state.Value with
555555 | TryWithState.NotStarted inp ->
556556 let res = ref Unchecked.defaultof<_>
557557 try
558- res := Choice1Of2 ( inp.GetEnumerator())
558+ res.Value <- Choice1Of2 ( inp.GetEnumerator())
559559 with exn ->
560- res := Choice2Of2 exn
560+ res.Value <- Choice2Of2 exn
561561 match res.Value with
562562 | Choice1Of2 r ->
563563 return !
564- ( state := TryWithState.HaveBodyEnumerator r
564+ ( state.Value <- TryWithState.HaveBodyEnumerator r
565565 x.MoveNext())
566566 | Choice2Of2 exn ->
567567 return !
568568 ( x.Dispose()
569569 let enum = ( handler exn) .GetEnumerator()
570- state := TryWithState.HaveHandlerEnumerator enum
570+ state.Value <- TryWithState.HaveHandlerEnumerator enum
571571 x.MoveNext())
572572 | TryWithState.HaveBodyEnumerator e ->
573573 let res = ref Unchecked.defaultof<_>
574574 try
575575 let! r = e.MoveNext()
576- res := Choice1Of2 r
576+ res.Value <- Choice1Of2 r
577577 with exn ->
578- res := Choice2Of2 exn
578+ res.Value <- Choice2Of2 exn
579579 match res.Value with
580580 | Choice1Of2 res ->
581581 return
@@ -587,7 +587,7 @@ module AsyncSeq =
587587 return !
588588 ( x.Dispose()
589589 let e = ( handler exn) .GetEnumerator()
590- state := TryWithState.HaveHandlerEnumerator e
590+ state.Value <- TryWithState.HaveHandlerEnumerator e
591591 x.MoveNext())
592592 | TryWithState.HaveHandlerEnumerator e ->
593593 let! res = e.MoveNext()
@@ -597,9 +597,9 @@ module AsyncSeq =
597597 | _ ->
598598 return None }
599599 member x.Dispose() =
600- match ! state with
600+ match state.Value with
601601 | TryWithState.HaveBodyEnumerator e | TryWithState.HaveHandlerEnumerator e ->
602- state := TryWithState.Finished
602+ state.Value <- TryWithState.Finished
603603 dispose e
604604 | _ -> () }) :> AsyncSeq< 'T>
605605
@@ -617,11 +617,11 @@ module AsyncSeq =
617617 let state = ref ( TryFinallyState.NotStarted inp)
618618 { new IAsyncSeqEnumerator< 'T> with
619619 member x.MoveNext() =
620- async { match ! state with
620+ async { match state.Value with
621621 | TryFinallyState.NotStarted inp ->
622622 return !
623623 ( let e = inp.GetEnumerator()
624- state := TryFinallyState.HaveBodyEnumerator e
624+ state.Value <- TryFinallyState.HaveBodyEnumerator e
625625 x.MoveNext())
626626 | TryFinallyState.HaveBodyEnumerator e ->
627627 let! res = e.MoveNext()
@@ -633,9 +633,9 @@ module AsyncSeq =
633633 | _ ->
634634 return None }
635635 member x.Dispose() =
636- match ! state with
636+ match state.Value with
637637 | TryFinallyState.HaveBodyEnumerator e->
638- state := TryFinallyState.Finished
638+ state.Value <- TryFinallyState.Finished
639639 dispose e
640640 compensation()
641641 | _ -> () }) :> AsyncSeq< 'T>
@@ -770,10 +770,10 @@ module AsyncSeq =
770770 let state = ref ( MapState.NotStarted inp)
771771 { new IAsyncSeqEnumerator< 'T> with
772772 member x.MoveNext() =
773- async { match ! state with
773+ async { match state.Value with
774774 | MapState.NotStarted inp ->
775775 let e = inp.GetEnumerator()
776- state := MapState.HaveEnumerator e
776+ state.Value <- MapState.HaveEnumerator e
777777 return ! x.MoveNext()
778778 | MapState.HaveEnumerator e ->
779779 return
@@ -784,9 +784,9 @@ module AsyncSeq =
784784 None)
785785 | _ -> return None }
786786 member x.Dispose() =
787- match ! state with
787+ match state.Value with
788788 | MapState.HaveEnumerator e ->
789- state := MapState.Finished
789+ state.Value <- MapState.Finished
790790 dispose e
791791 | _ -> () }) :> AsyncSeq< 'T>
792792
@@ -2167,7 +2167,7 @@ module AsyncSeq =
21672167 while cur.Value.IsSome do
21682168 yield cur.Value.Value
21692169 let! next = ie.MoveNext()
2170- cur := next
2170+ cur.Value <- next
21712171 finally
21722172 ie.Dispose() }
21732173 return first, rest }
@@ -2500,7 +2500,7 @@ module AsyncSeq =
25002500 | None ->
25012501 let t = System.Threading.Tasks.TaskCompletionSource()
25022502 tasks.[ i] <- t.Task // result never gets set
2503- fin := fin .Value - 1
2503+ fin.Value <- fin.Value - 1
25042504 }
25052505
25062506 let combineLatestWithAsync ( f : 'a -> 'b -> Async < 'c >) ( source1 : AsyncSeq < 'a >) ( source2 : AsyncSeq < 'b >) : AsyncSeq < 'c > =
0 commit comments