aboutsummaryrefslogtreecommitdiffhomepage
path: root/toplevel/class.ml
diff options
context:
space:
mode:
authorGravatar Matthieu Sozeau <matthieu.sozeau@inria.fr>2014-07-29 12:11:22 +0200
committerGravatar Matthieu Sozeau <matthieu.sozeau@inria.fr>2014-07-29 14:57:12 +0200
commit9ba2016b81b6ce1d6f024ce674375f7ed54bae85 (patch)
tree88e5c2bfbea63bd2a6c016b63e7fdb3f1fefbdf7 /toplevel/class.ml
parent625facdbf7c0a6e1386b3e6baa762b61fa0e7e02 (diff)
Fix bug #3453, not recognizing primitive projections in Coercion declarations.
Diffstat (limited to 'toplevel/class.ml')
-rw-r--r--toplevel/class.ml10
1 files changed, 8 insertions, 2 deletions
diff --git a/toplevel/class.ml b/toplevel/class.ml
index a6591f0d3..6e95a930d 100644
--- a/toplevel/class.ml
+++ b/toplevel/class.ml
@@ -96,7 +96,9 @@ let uniform_cond nargs lt =
aux (nargs,lt)
let class_of_global = function
- | ConstRef sp -> CL_CONST sp
+ | ConstRef sp ->
+ if Environ.is_projection sp (Global.env ())
+ then CL_PROJ sp else CL_CONST sp
| IndRef sp -> CL_IND sp
| VarRef id -> CL_SECVAR id
| ConstructRef _ as c ->
@@ -140,7 +142,11 @@ let get_target t ind =
if (ind > 1) then
CL_FUN
else
- pi1 (find_class_type Evd.empty t)
+ match pi1 (find_class_type Evd.empty t) with
+ | CL_CONST p when Environ.is_projection p (Global.env ()) ->
+ CL_PROJ p
+ | x -> x
+
let prods_of t =
let rec aux acc d = match kind_of_term d with