@@ -150,8 +150,10 @@ module TaskBase =
150150 /// <returns>a Task that executes computation and compensation afterwards or
151151 /// when an exception is raised.</returns>
152152 member inline _.TryFinally
153- ( computation : TaskBaseCode < 'TOverall , 'T , 'Builder >, compensation : unit -> unit )
154- : TaskBaseCode < 'TOverall , 'T , 'Builder > =
153+ (
154+ computation : TaskBaseCode < 'TOverall , 'T , 'Builder >,
155+ [<InlineIfLambda>] compensation : unit -> unit
156+ ) : TaskBaseCode < 'TOverall , 'T , 'Builder > =
155157 ResumableCode.TryFinally(
156158 computation,
157159 ResumableCode<_, _>( fun _ ->
@@ -173,10 +175,10 @@ module TaskBase =
173175 ) : bool =
174176
175177 let cont =
176- ( TaskBaseResumptionFunc< 'TOverall, 'Builder>( fun sm ->
178+ TaskBaseResumptionFunc< 'TOverall, 'Builder>( fun sm ->
177179 let result = Awaiter.GetResult awaiter
178180 ( continuation result) .Invoke(& sm)
179- ))
181+ )
180182
181183 // shortcut to continue immediately
182184 if Awaiter.IsCompleted awaiter then
@@ -277,7 +279,7 @@ module TaskBase =
277279 ) : TaskBaseCode < 'TOverall , 'T , 'Builder > =
278280 ResumableCode.TryFinallyAsync(
279281 computation,
280- ResumableCode<_, _>( fun sm -> x.Bind(( compensation ()), ( x.Zero) ) .Invoke(& sm))
282+ ResumableCode<_, _>( fun sm -> x.Bind( compensation (), x.Zero) .Invoke(& sm))
281283 )
282284
283285 /// <summary>Creates a Task that runs binder(resource).
@@ -311,30 +313,26 @@ module TaskBase =
311313 )
312314
313315 member inline internal x.WhileAsync
314- ( [<InlineIfLambda>] condition : unit -> 'Awaitable , body : TaskBaseCode < _ , unit , 'Builder >) : TaskBaseCode <
315- _ ,
316- _ ,
317- 'Builder
318- >
319- =
316+ ( // Fantomas ignore
317+ [<InlineIfLambda>] condition : unit -> 'Awaitable ,
318+ body : TaskBaseCode < _ , unit , 'Builder >
319+ ) : TaskBaseCode < _ , _ , 'Builder > =
320320 let mutable condition_res = true
321321
322322 x.While(
323323 ( fun () -> condition_ res),
324324 ResumableCode<_, _>( fun sm ->
325325 x
326326 .Bind(
327- ( condition () ),
327+ condition (),
328328 ( fun result ->
329- condition_ res <- result
330-
331329 ResumableCode<_, _>( fun sm ->
330+ condition_ res <- result
332331 if condition_ res then body.Invoke(& sm) else true
333332 )
334333 )
335334 )
336335 .Invoke(& sm)
337-
338336 )
339337 )
340338
@@ -346,7 +344,10 @@ module TaskBase =
346344 source.GetAsyncEnumerator CancellationToken.None,
347345 ( fun ( e : IAsyncEnumerator < 'T >) ->
348346 this.WhileAsync(
349- ( fun () -> Awaitable.GetAwaiter( e.MoveNextAsync())),
347+ ( fun () ->
348+ __ debugPoint " ForLoop.InOrToKeyword"
349+ Awaitable.GetAwaiter( e.MoveNextAsync())
350+ ),
350351 ( fun sm -> ( body e.Current) .Invoke(& sm))
351352 )
352353 )
0 commit comments