Skip to content

Commit a934868

Browse files
authored
Fix exceptions handling in task dynamic invocation (#360)
1 parent a4a153b commit a934868

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/FsToolkit.ErrorHandling/TaskOptionCE.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,7 @@ type TaskOptionBuilder() =
299299
// If the `sm.Data.MethodBuilder` has already been set somewhere else (like While/WhileDynamic), we shouldn't continue
300300
if sm.Data.IsTaskCompleted then
301301
()
302-
303-
if step then
302+
elif step then
304303
sm.Data.SetResult()
305304
else
306305
match sm.ResumptionDynamicInfo.ResumptionData with

src/FsToolkit.ErrorHandling/TaskValueOptionCE.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,7 @@ type TaskValueOptionBuilder() =
306306
// If the `sm.Data.MethodBuilder` has already been set somewhere else (like While/WhileDynamic), we shouldn't continue
307307
if sm.Data.IsTaskCompleted then
308308
()
309-
310-
if step then
309+
elif step then
311310
sm.Data.SetResult()
312311
else
313312
match sm.ResumptionDynamicInfo.ResumptionData with

src/FsToolkit.ErrorHandling/ValueTaskValueOptionCE.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,7 @@ type ValueTaskValueOptionBuilder() =
242242
// If the `sm.Data.MethodBuilder` has already been set somewhere else (like While/WhileDynamic), we shouldn't continue
243243
if sm.Data.IsTaskCompleted then
244244
()
245-
246-
if step then
245+
elif step then
247246
sm.Data.SetResult()
248247
else
249248
match sm.ResumptionDynamicInfo.ResumptionData with

0 commit comments

Comments
 (0)