Skip to content

Commit

Permalink
[interpreter] Fix subtype condition for result patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
rossberg authored and backes committed Oct 29, 2024
1 parent bef38ba commit 37f3cad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion interpreter/script/js.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 37f3cad

Please sign in to comment.