aboutsummaryrefslogtreecommitdiff
path: root/pretyping/typeclasses.ml
diff options
context:
space:
mode:
authorGaëtan Gilbert2019-02-22 17:44:43 +0100
committerGaëtan Gilbert2019-02-25 14:08:25 +0100
commit46665f87bbdd2d5fe0c302eae63912d6418d7207 (patch)
tree9e845e7a9358ba5442c8508036926596e6e56d8c /pretyping/typeclasses.ml
parentfc76c77ac6e509c1bccc2823ce2037d21a53276a (diff)
Fix #9631: Instance: anomaly grounding non evar-free term
Diffstat (limited to 'pretyping/typeclasses.ml')
-rw-r--r--pretyping/typeclasses.ml8
1 files changed, 5 insertions, 3 deletions
diff --git a/pretyping/typeclasses.ml b/pretyping/typeclasses.ml
index d732544c5c..1496712bbc 100644
--- a/pretyping/typeclasses.ml
+++ b/pretyping/typeclasses.ml
@@ -124,12 +124,14 @@ let typeclass_univ_instance (cl, u) =
let class_info c =
try GlobRef.Map.find c !classes
- with Not_found -> not_a_class (Global.env()) (EConstr.of_constr (printable_constr_of_global c))
+ with Not_found ->
+ let env = Global.env() in
+ not_a_class env (Evd.from_env env) (EConstr.of_constr (printable_constr_of_global c))
let global_class_of_constr env sigma c =
try let gr, u = Termops.global_of_constr sigma c in
- class_info gr, u
- with Not_found -> not_a_class env c
+ GlobRef.Map.find gr !classes, u
+ with Not_found -> not_a_class env sigma c
let dest_class_app env sigma c =
let cl, args = EConstr.decompose_app sigma c in