From fb89587dde51d63b0de9a4d8ce1781451e8ed37c Mon Sep 17 00:00:00 2001 From: herbelin Date: Fri, 26 Oct 2001 16:23:11 +0000 Subject: Vérification précoce qu'un lemme n'existe pas déjà git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@2142 85f007b7-540e-0410-9357-904b9bb8a0f7 --- toplevel/command.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/toplevel/command.ml b/toplevel/command.ml index 51af38e20e..ab2517b283 100644 --- a/toplevel/command.ml +++ b/toplevel/command.ml @@ -418,7 +418,11 @@ let start_proof_com sopt stre com = let env = Global.env () in let sign = Global.named_context () in let id = match sopt with - | Some id -> id + | Some id -> + (* We check existence here: it's a bit late at Qed time *) + if Nametab.exists_cci (Lib.make_path id CCI) then + errorlabstrm "start_proof" [< pr_id id; 'sTR " already exists" >]; + id | None -> next_ident_away (id_of_string "Unnamed_thm") (Pfedit.get_all_proof_names ()) -- cgit v1.2.3