@@ -13,6 +13,7 @@ open System.Threading.Tasks.Sources
1313
1414open FSharp.Core .CompilerServices
1515open FSharp.Core .CompilerServices .StateMachineHelpers
16+ open FSharp.Control
1617
1718
1819[<AutoOpen>]
@@ -279,14 +280,14 @@ and [<NoComparison; NoEquality>] TaskSeq<'Machine, 'T
279280 if this._ machine.ResumptionPoint = - 1 then // can't use as IAsyncEnumerator before IAsyncEnumerable
280281 logInfo " at MoveNextAsync: Resumption point = -1"
281282
282- ValueTask< bool >()
283+ ValueTask.False
283284
284285 elif this._ machine.Data.completed then
285286 logInfo " at MoveNextAsync: completed = true"
286287
287288 // return False when beyond the last item
288289 this._ machine.Data.promiseOfValueOrEnd.Reset()
289- ValueTask< bool >()
290+ ValueTask.False
290291
291292 else
292293 logInfo " at MoveNextAsync: normal resumption scenario"
@@ -343,18 +344,18 @@ and [<NoComparison; NoEquality>] TaskSeq<'Machine, 'T
343344 // the Current value
344345 data.current <- ValueNone
345346
346- ValueTask< bool >( result)
347+ ValueTask.FromResult result
347348
348349 | ValueTaskSourceStatus.Faulted
349350 | ValueTaskSourceStatus.Canceled
350351 | ValueTaskSourceStatus.Pending as state ->
351352 logInfo ( " at MoveNextAsyncResult: case " , state)
352353
353- ValueTask< bool >( this, version) // uses IValueTaskSource<'T>
354+ ValueTask.ofIValueTaskSource this version
354355 | _ ->
355356 logInfo " at MoveNextAsyncResult: Unexpected state"
356357 // assume it's a possibly new, not yet supported case, treat as default
357- ValueTask< bool >( this, version) // uses IValueTaskSource<'T>
358+ ValueTask.ofIValueTaskSource this version
358359
359360and TaskSeqCode < 'T > = ResumableCode< TaskSeqStateMachineData< 'T>, unit>
360361and TaskSeqStateMachine < 'T > = ResumableStateMachine< TaskSeqStateMachineData< 'T>>
0 commit comments