From 277f84a031e51f15b2e7df09c92f9a79bd3b23df Mon Sep 17 00:00:00 2001 From: Simon Krajewski Date: Thu, 12 Dec 2013 07:57:35 +0100 Subject: [PATCH] use same expected type for or-patterns (closes #2459) --- matcher.ml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/matcher.ml b/matcher.ml index 9cd07d2734b..c5a8c76cd17 100644 --- a/matcher.ml +++ b/matcher.ml @@ -541,7 +541,6 @@ let to_pattern ctx e t = | Some t -> Type.map dup t) | _ -> Type.map dup t in - let t2 = dup t in let pat1 = loop pctx e1 t in begin match pat1.p_def with | PAny | PVar _ -> @@ -554,7 +553,7 @@ let to_pattern ctx e t = pc_reify = pctx.pc_reify; pc_is_complex = pctx.pc_is_complex; } in - let pat2 = loop pctx2 e2 t2 in + let pat2 = loop pctx2 e2 t in pctx.pc_is_complex <- pctx2.pc_is_complex; PMap.iter (fun s (_,p) -> if not (PMap.mem s pctx2.pc_locals) then verror s p) pctx.pc_locals; mk_pat (POr(pat1,pat2)) pat2.p_type (punion pat1.p_pos pat2.p_pos);