Skip to content

Commit b5f484e

Browse files
committed
Fake.Core.Process: stop using old ref-cell operators
The new version of the F# compiler now flags these occurrences as deprecated. The messages are of two kinds: 1) info FS3370: The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. 2) info FS3370: The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'.
1 parent 07f41df commit b5f484e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/app/Fake.Core.Process/InternalStreams.fs

+10-10
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ module internal InternalStreams =
100100
let asyncResult = ref null
101101
Async.FromBeginEnd(
102102
(fun (callback, state) ->
103-
asyncResult := beginAction(callback, state)
104-
!asyncResult),
103+
asyncResult.Value <- beginAction(callback, state)
104+
asyncResult.Value),
105105
(fun res ->
106106
endAction res),
107107
cancelAction = (fun () ->
108-
while !asyncResult = null do Thread.Sleep 20
109-
cancelAction(!asyncResult)))
108+
while asyncResult.Value = null do Thread.Sleep 20
109+
cancelAction(asyncResult.Value)))
110110
open AsyncHelper
111111

112112
type ConcurrentQueueMessage<'a> =
@@ -232,12 +232,12 @@ module internal InternalStreams =
232232
while not cts.IsCancellationRequested do
233233
let! data = innerStream.Read()
234234
let finished = ref false
235-
while not !finished do
235+
while not finished.Value do
236236
let! (asyncResult:MyIAsyncReadResult<'a>) = queue.DequeAsync()
237237
if not asyncResult.IsCanceled then
238238
try
239239
asyncResult.End(data)
240-
finished := true
240+
finished.Value <- true
241241
with ReadCanceledException -> () // find next
242242
return ()
243243
}, cancellationToken = workerCts.Token)
@@ -466,7 +466,7 @@ module internal InternalStreams =
466466
//let raw = infiniteStream()
467467
let readFinished = ref false
468468
let read () =
469-
if !readFinished then
469+
if readFinished.Value then
470470
async.Return None
471471
else
472472
async {
@@ -477,16 +477,16 @@ module internal InternalStreams =
477477
match s with
478478
| Some d -> Some d
479479
| None ->
480-
readFinished := true
480+
readFinished.Value <- true
481481
None
482482
| None ->
483483
failwith "stream should not be limited as we are using an infiniteStream!" }
484484
let isFinished = ref false
485485
let finish () = async {
486486
do! raw.Write None
487-
isFinished := true }
487+
isFinished.Value <- true }
488488
let write item =
489-
if !isFinished then
489+
if isFinished.Value then
490490
failwith "stream is in finished state so it should not be written to!"
491491
raw.Write (Some item)
492492
finish,

0 commit comments

Comments
 (0)