Skip to content

Commit 37f3cad

Browse files
rossbergbackes
authored andcommitted
[interpreter] Fix subtype condition for result patterns
1 parent bef38ba commit 37f3cad

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

interpreter/script/js.ml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,12 @@ let rec type_of_result res =
358358

359359
let assert_return ress ts at =
360360
let rec test (res, t) =
361-
if not (Match.match_val_type [] t (type_of_result res)) then
361+
if
362+
not (
363+
Match.match_val_type [] t (type_of_result res) ||
364+
Match.match_val_type [] (type_of_result res) t
365+
)
366+
then
362367
[ Br (0l @@ at) @@ at ]
363368
else
364369
match res.it with

0 commit comments

Comments
 (0)