Skip to content

Commit

Permalink
Preserve location when type checking P_app on a constructor
Browse files Browse the repository at this point in the history
Fixes #467
  • Loading branch information
bacam committed Mar 8, 2024
1 parent a368260 commit 427ade6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/type_check.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2467,7 +2467,7 @@ and bind_pat env (P_aux (pat_aux, (l, uannot)) as pat) typ =
end
| P_app (f, pats) when Env.is_union_constructor f env || Env.is_mapping f env ->
(* Treat Ctor(x, y) as Ctor((x, y)), and the same for mappings *)
bind_pat env (P_aux (P_app (f, [mk_pat (P_tuple pats)]), (l, uannot))) typ
bind_pat env (P_aux (P_app (f, [mk_pat ~loc:l (P_tuple pats)]), (l, uannot))) typ
| P_app (f, _) when (not (Env.is_union_constructor f env)) && not (Env.is_mapping f env) ->
typ_error l (string_of_id f ^ " is not a union constructor or mapping in pattern " ^ string_of_pat pat)
| P_as (pat, id) ->
Expand Down

0 comments on commit 427ade6

Please sign in to comment.