aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-06-14 14:51:44 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-06-14 14:51:44 +0000
commita70eb94dc94a41c9e931b7c13ac3ca254f0bcda9 (patch)
tree3d18740f19a60edd4008d3528ba2da7dd9826c23
parent9f58c0f8a5176c64c3c264ea8331bce9d35bbcbc (diff)
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
-rw-r--r--test-suite/bugs/closed/shouldsucceed/2181.v3
-rw-r--r--toplevel/record.ml5
2 files changed, 7 insertions, 1 deletions
diff --git a/test-suite/bugs/closed/shouldsucceed/2181.v b/test-suite/bugs/closed/shouldsucceed/2181.v
new file mode 100644
index 000000000..62820d869
--- /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 36d29c1a1..6d94e9a85 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