Skip to content

Commit

Permalink
use same expected type for or-patterns (closes #2459)
Browse files Browse the repository at this point in the history
  • Loading branch information
Simn committed Dec 12, 2013
1 parent adb90b7 commit 277f84a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions matcher.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 _ ->
Expand All @@ -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);
Expand Down

0 comments on commit 277f84a

Please sign in to comment.