From a70eb94dc94a41c9e931b7c13ac3ca254f0bcda9 Mon Sep 17 00:00:00 2001 From: herbelin Date: Tue, 14 Jun 2011 14:51:44 +0000 Subject: Fixing bug #2181 (Class mechanism can create dependencies over unnamed fields of records). git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14201 85f007b7-540e-0410-9357-904b9bb8a0f7 --- test-suite/bugs/closed/shouldsucceed/2181.v | 3 +++ toplevel/record.ml | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 test-suite/bugs/closed/shouldsucceed/2181.v diff --git a/test-suite/bugs/closed/shouldsucceed/2181.v b/test-suite/bugs/closed/shouldsucceed/2181.v new file mode 100644 index 0000000000..62820d8699 --- /dev/null +++ b/test-suite/bugs/closed/shouldsucceed/2181.v @@ -0,0 +1,3 @@ +Class C. +Parameter P: C -> Prop. +Fail Record R: Type := { _: C; u: P _ }. diff --git a/toplevel/record.ml b/toplevel/record.ml index 36d29c1a17..6d94e9a856 100644 --- a/toplevel/record.ml +++ b/toplevel/record.ml @@ -146,7 +146,10 @@ let subst_projection fid l c = match List.nth l (k-depth-2) with | Projection t -> lift depth t | NoProjection (Name id) -> bad_projs := id :: !bad_projs; mkRel k - | NoProjection Anonymous -> assert false + | NoProjection Anonymous -> + errorlabstrm "" (str "Field " ++ pr_id fid ++ + str " depends on the " ++ str (ordinal (k-depth-1)) ++ str + " field which has no name.") else mkRel (k-lv) | _ -> map_constr_with_binders succ substrec depth c -- cgit v1.2.3