From 37f3cad1265a64e53d558ed469056fe92ff473b0 Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Mon, 28 Oct 2024 21:21:14 +0100 Subject: [PATCH] [interpreter] Fix subtype condition for result patterns --- interpreter/script/js.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/interpreter/script/js.ml b/interpreter/script/js.ml index adc072cb1c..30bbb796e9 100644 --- a/interpreter/script/js.ml +++ b/interpreter/script/js.ml @@ -358,7 +358,12 @@ let rec type_of_result res = let assert_return ress ts at = let rec test (res, t) = - if not (Match.match_val_type [] t (type_of_result res)) then + if + not ( + Match.match_val_type [] t (type_of_result res) || + Match.match_val_type [] (type_of_result res) t + ) + then [ Br (0l @@ at) @@ at ] else match res.it with