aboutsummaryrefslogtreecommitdiff
path: root/toplevel
diff options
context:
space:
mode:
authorMatthieu Sozeau2014-07-29 12:11:22 +0200
committerMatthieu Sozeau2014-07-29 14:57:12 +0200
commit9ba2016b81b6ce1d6f024ce674375f7ed54bae85 (patch)
tree88e5c2bfbea63bd2a6c016b63e7fdb3f1fefbdf7 /toplevel
parent625facdbf7c0a6e1386b3e6baa762b61fa0e7e02 (diff)
Fix bug #3453, not recognizing primitive projections in Coercion declarations.
Diffstat (limited to 'toplevel')
-rw-r--r--toplevel/class.ml10
1 files changed, 8 insertions, 2 deletions
diff --git a/toplevel/class.ml b/toplevel/class.ml
index a6591f0d3b..6e95a930d0 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