From 5f45871feefc09f080bde2b5af349f8ccda16a84 Mon Sep 17 00:00:00 2001 From: Gaƫtan Gilbert Date: Thu, 29 Mar 2018 17:18:16 +0200 Subject: Fix #7113: Program Let Fixpoint in section causes anomaly --- test-suite/bugs/closed/7113.v | 10 ++++++++++ vernac/obligations.ml | 7 +++---- 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 test-suite/bugs/closed/7113.v 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 dfc51a990..c3c551934 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) -- cgit v1.2.3