From 427ade64e48deffad6bc889d93d5f2239d57b0cb Mon Sep 17 00:00:00 2001 From: Brian Campbell Date: Fri, 8 Mar 2024 11:18:04 +0000 Subject: [PATCH] Preserve location when type checking P_app on a constructor Fixes #467 --- src/lib/type_check.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/type_check.ml b/src/lib/type_check.ml index 791a380f2..25d39aa02 100644 --- a/src/lib/type_check.ml +++ b/src/lib/type_check.ml @@ -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) ->