diff options
author | Matthieu Sozeau <matthieu.sozeau@inria.fr> | 2018-06-04 14:39:34 +0200 |
---|---|---|
committer | Matthieu Sozeau <matthieu.sozeau@inria.fr> | 2018-06-04 14:39:34 +0200 |
commit | 3d10815dd3929f718fc4ede5d5a2a1fe5ccdc351 (patch) | |
tree | 3e752cb896831a46b51c089eddb9ce3767ccc541 | |
parent | 39cde6238489fafd706dfe7709052df0089ab3d5 (diff) | |
parent | 5f45871feefc09f080bde2b5af349f8ccda16a84 (diff) |
Merge PR #7114: Fix #7113: Program Let Fixpoint in section causes anomaly
-rw-r--r-- | test-suite/bugs/closed/7113.v | 10 | ||||
-rw-r--r-- | vernac/obligations.ml | 7 |
2 files changed, 13 insertions, 4 deletions
diff --git a/test-suite/bugs/closed/7113.v b/test-suite/bugs/closed/7113.v new file mode 100644 index 000000000..976e60f20 --- /dev/null +++ b/test-suite/bugs/closed/7113.v @@ -0,0 +1,10 @@ +Require Import Program.Tactics. +Section visibility. + + (* used to anomaly *) + Program Let Fixpoint ev' (n : nat) : bool := _. + Next Obligation. exact true. Qed. + + Check ev'. +End visibility. +Fail Check ev'. diff --git a/vernac/obligations.ml b/vernac/obligations.ml index 8843e52f4..00f1760c2 100644 --- a/vernac/obligations.ml +++ b/vernac/obligations.ml @@ -565,9 +565,8 @@ let declare_mutual_definition l = List.iter (Metasyntax.add_notation_interpretation (Global.env())) first.prg_notations; Declare.recursive_message (fixkind != IsCoFixpoint) indexes fixnames; let gr = List.hd kns in - let kn = match gr with GlobRef.ConstRef kn -> kn | _ -> assert false in Lemmas.call_hook fix_exn first.prg_hook local gr first.prg_ctx; - List.iter progmap_remove l; kn + List.iter progmap_remove l; gr let decompose_lam_prod c ty = let open Context.Rel.Declaration in @@ -774,8 +773,8 @@ let update_obls prg obls rem = let progs = List.map (fun x -> get_info (ProgMap.find x !from_prg)) prg'.prg_deps in if List.for_all (fun x -> obligations_solved x) progs then let kn = declare_mutual_definition progs in - Defined (GlobRef.ConstRef kn) - else Dependent) + Defined kn + else Dependent) let is_defined obls x = not (Option.is_empty obls.(x).obl_body) |