aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Herbelin2020-02-20 01:44:32 +0100
committerHugo Herbelin2020-02-20 01:58:57 +0100
commita5b552175253726a3cd73471a96b33215ee19af2 (patch)
tree1a2437f26e67a4c19c1b684eedf79feb5bc1fcd5
parent2b72b403d82c15d0420603142e14ab50c7e590c1 (diff)
Fixes #10917 (missing lift in building return clause by inversion).
-rw-r--r--pretyping/cases.ml1
-rw-r--r--test-suite/bugs/closed/bug_10917.v4
2 files changed, 5 insertions, 0 deletions
diff --git a/pretyping/cases.ml b/pretyping/cases.ml
index abc16f621e..55c1f41c2c 100644
--- a/pretyping/cases.ml
+++ b/pretyping/cases.ml
@@ -1817,6 +1817,7 @@ let build_inversion_problem ~program_mode loc env sigma tms t =
List.rev_append patl patl',acc_sign,acc
| (t, NotInd (bo,typ)) :: tms ->
let pat,acc = make_patvar t acc in
+ let typ = lift n typ in
let d = LocalAssum (annotR (alias_of_pat pat),typ) in
let patl,acc_sign,acc = aux (n+1) (snd (push_rel ~hypnaming:KeepUserNameAndRenameExistingButSectionNames sigma d env)) (d::acc_sign) tms acc in
pat::patl,acc_sign,acc in
diff --git a/test-suite/bugs/closed/bug_10917.v b/test-suite/bugs/closed/bug_10917.v
new file mode 100644
index 0000000000..cdb132ede0
--- /dev/null
+++ b/test-suite/bugs/closed/bug_10917.v
@@ -0,0 +1,4 @@
+(* This was raising an anomaly *)
+
+Definition m (h : 0 = 1) P : P 1 -> P 0 :=
+ fun H => match h, H with end.