diff --git a/src/Compiler/Utilities/Cancellable.fs b/src/Compiler/Utilities/Cancellable.fs index 661dc44519b..ad739b5039e 100644 --- a/src/Compiler/Utilities/Cancellable.fs +++ b/src/Compiler/Utilities/Cancellable.fs @@ -69,7 +69,7 @@ module Cancellable = use _ = Cancellable.UsingToken(ct) oper ct with - | :? OperationCanceledException as e when e.CancellationToken = ct -> ValueOrCancelled.Cancelled e + | :? OperationCanceledException as e when ct.IsCancellationRequested -> ValueOrCancelled.Cancelled e | :? OperationCanceledException as e -> InvalidOperationException("Wrong cancellation token", e) |> raise let fold f acc seq =