aboutsummaryrefslogtreecommitdiff
path: root/pretyping
diff options
context:
space:
mode:
authorHugo Herbelin2019-12-03 00:47:28 +0100
committerHugo Herbelin2019-12-03 01:30:24 +0100
commit645447c1e05a95e90d09b946b322a5b587482e8e (patch)
treed154e12819fc51590fb63977f937a791cdc6ca14 /pretyping
parentbe04b1536fe250e8f761701f9e99650bede608d6 (diff)
Fixes #11231 (missing dependency in pattern-matching decompilation).
The missing dependency impacted the algorithm for detecting default clauses.
Diffstat (limited to 'pretyping')
-rw-r--r--pretyping/detyping.ml8
1 files changed, 6 insertions, 2 deletions
diff --git a/pretyping/detyping.ml b/pretyping/detyping.ml
index 862865bd90..037006bc47 100644
--- a/pretyping/detyping.ml
+++ b/pretyping/detyping.ml
@@ -455,7 +455,9 @@ let rec decomp_branch tags nal flags (avoid,env as e) sigma c =
(avoid', add_name_opt na' body t env) sigma c
let rec build_tree na isgoal e sigma ci cl =
- let mkpat n rhs pl = DAst.make @@ PatCstr((ci.ci_ind,n+1),pl,update_name sigma na rhs) in
+ let mkpat n rhs pl =
+ let na = update_name sigma na rhs in
+ na, DAst.make @@ PatCstr((ci.ci_ind,n+1),pl,na) in
let cnl = ci.ci_pp_info.cstr_tags in
List.flatten
(List.init (Array.length cl)
@@ -485,7 +487,9 @@ and align_tree nal isgoal (e,c as rhs) sigma = match nal with
and contract_branch isgoal e sigma (cdn,mkpat,rhs) =
let nal,rhs = decomp_branch cdn [] isgoal e sigma rhs in
let mat = align_tree nal isgoal rhs sigma in
- List.map (fun (ids,hd,rhs) -> ids,mkpat rhs hd,rhs) mat
+ List.map (fun (ids,hd,rhs) ->
+ let na, pat = mkpat rhs hd in
+ (Nameops.Name.fold_right Id.Set.add na ids, pat, rhs)) mat
(**********************************************************************)
(* Transform internal representation of pattern-matching into list of *)