We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d05b66 commit 298ae28Copy full SHA for 298ae28
src/FsToolkit.ErrorHandling/TaskValueOptionCE.fs
@@ -237,12 +237,11 @@ type TaskValueOptionBuilder() =
237
if step then
238
sm.Data.SetResult()
239
else
240
- let mutable awaiter =
241
- sm.ResumptionDynamicInfo.ResumptionData
242
- :?> ICriticalNotifyCompletion
243
-
244
- // assert not (isNull awaiter)
245
- sm.Data.MethodBuilder.AwaitUnsafeOnCompleted(&awaiter, &sm)
+ match sm.ResumptionDynamicInfo.ResumptionData with
+ | :? ICriticalNotifyCompletion as awaiter ->
+ let mutable awaiter = awaiter
+ sm.Data.MethodBuilder.AwaitUnsafeOnCompleted(&awaiter, &sm)
+ | awaiter -> assert not (isNull awaiter)
246
247
with exn ->
248
savedExn <- exn
0 commit comments