aboutsummaryrefslogtreecommitdiff
path: root/toplevel/record.ml
diff options
context:
space:
mode:
authormsozeau2010-11-15 15:40:43 +0000
committermsozeau2010-11-15 15:40:43 +0000
commit2beefbc65d2f571da4918d30cf894a81bcf41662 (patch)
tree026d202d1d32af7196244e6cf2b7c7917c8c5ce7 /toplevel/record.ml
parent347b03a7937f08fb523d37985f87c7558224c498 (diff)
Minor fixes from Gregory Malecha. A typo fixed and a better (located)
error message in case of unnammed record parameters. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13635 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'toplevel/record.ml')
-rw-r--r--toplevel/record.ml9
1 files changed, 9 insertions, 0 deletions
diff --git a/toplevel/record.ml b/toplevel/record.ml
index d67c022a1e..fce531a31b 100644
--- a/toplevel/record.ml
+++ b/toplevel/record.ml
@@ -57,6 +57,15 @@ let binders_of_decls = List.map binder_of_decl
let typecheck_params_and_fields id t ps nots fs =
let env0 = Global.env () in
let evars = ref Evd.empty in
+ let _ =
+ let error (loc, name) =
+ if name = Anonymous then
+ user_err_loc (loc, "record", str "Record parameters must be named")
+ in
+ List.iter
+ (function LocalRawDef (b, _) -> error b
+ | LocalRawAssum (ls, _, ce) -> List.iter error ls) ps
+ in
let (env1,newps), imps = interp_context_evars evars env0 ps in
let fullarity = it_mkProd_or_LetIn (Option.cata (fun x -> x) (Termops.new_Type ()) t) newps in
let env_ar = push_rel_context newps (push_rel (Name id,None,fullarity) env0) in