aboutsummaryrefslogtreecommitdiffhomepage
path: root/toplevel
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2001-01-18 23:39:09 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2001-01-18 23:39:09 +0000
commitcf31d668a077e49ca0f4a9886769b811c92a6d16 (patch)
treef078b5ba69cd460663114c3d5f2d5e9f03117d58 /toplevel
parentbf1d33dfc394b7cf2203ea57336d5e9c6483260f (diff)
Bug Identity Coercion
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@1255 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'toplevel')
-rw-r--r--toplevel/class.ml8
1 files changed, 5 insertions, 3 deletions
diff --git a/toplevel/class.ml b/toplevel/class.ml
index b6824dac7..37ef4eb92 100644
--- a/toplevel/class.ml
+++ b/toplevel/class.ml
@@ -265,7 +265,7 @@ let build_id_coercion idf_opt ids =
(Typing.type_of env Evd.empty val_f) typ_f
with _ ->
error ("cannot be defined as coercion - "^
- "may be a bad number of arguments")
+ "maybe a bad number of arguments")
in
let idf =
match idf_opt with
@@ -274,8 +274,10 @@ let build_id_coercion idf_opt ids =
id_of_string ("Id_"^(string_of_id ids)^"_"^
(string_of_class (fst (constructor_at_head t))))
in
- let constr_entry =
- { const_entry_body = val_f; const_entry_type = None } in
+ let constr_entry = (* Cast is necessary to express [val_f] is identity *)
+
+ { const_entry_body = mkCast (val_f, typ_f);
+ const_entry_type = None } in
declare_constant idf (ConstantEntry constr_entry,NeverDischarge,false);
idf