diff --git a/ocaml/parsing/jane_syntax.ml b/ocaml/parsing/jane_syntax.ml index 80b73d3850c..90c1d575b46 100644 --- a/ocaml/parsing/jane_syntax.ml +++ b/ocaml/parsing/jane_syntax.ml @@ -351,9 +351,9 @@ module Pattern_guarded = struct let fail_malformed ~loc = Location.raise_errorf ~loc "Malformed pattern guarded case rhs" - let of_case { pc_lhs; pc_rhs } = - match pc_rhs.pexp_desc with - | Pexp_match (scrutinee, cases) -> + let of_case { pc_lhs; pc_guard; pc_rhs } = + match pc_guard, pc_rhs.pexp_desc with + | None, Pexp_match (scrutinee, cases) -> Pg_case { lhs = pc_lhs; scrutinee; cases } | _ -> fail_malformed ~loc:pc_rhs.pexp_loc