From 2d1820fe445b50f1c7a78d1822b01bf93a82b49d Mon Sep 17 00:00:00 2001 From: Vesa Karvonen Date: Mon, 14 Oct 2024 19:48:26 +0300 Subject: [PATCH] Explicitly call to raise error from tail position --- lib/picos/picos.ocaml5.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/picos/picos.ocaml5.ml b/lib/picos/picos.ocaml5.ml index 8f418cf6..be3e784c 100644 --- a/lib/picos/picos.ocaml5.ml +++ b/lib/picos/picos.ocaml5.ml @@ -392,8 +392,8 @@ module Computation = struct -> unit Effect.t let cancel_after computation ~seconds exn bt = - if not (0.0 <= seconds) then error_negative_or_nan (); - Effect.perform (Cancel_after { seconds; exn; bt; computation }) + if not (0.0 <= seconds) then error_negative_or_nan () + else Effect.perform (Cancel_after { seconds; exn; bt; computation }) (* BEGIN COMPUTATION COMMON *)