Class declarations create a class type declaration in signature: no need to check twice.

master
alainfrisch 2017-05-09 14:15:54 +02:00
parent e7e7afd280
commit fa9e40496e
3 changed files with 4 additions and 12 deletions

View File

@ -32,14 +32,7 @@ let class_type_declarations ~loc env cty1 cty2 =
cty1.clty_params cty1.clty_type
cty2.clty_params cty2.clty_type
let class_declarations ~loc env cty1 cty2 =
Builtin_attributes.check_deprecated_inclusion
~def:cty1.cty_loc
~use:cty2.cty_loc
loc
cty1.cty_attributes cty2.cty_attributes
(Path.last cty1.cty_path);
let class_declarations env cty1 cty2 =
match cty1.cty_new, cty2.cty_new with
None, Some _ ->
[Ctype.CM_Virtual_class]

View File

@ -26,7 +26,6 @@ val class_type_declarations:
Env.t -> class_type_declaration -> class_type_declaration ->
class_match_failure list
val class_declarations:
loc:Location.t ->
Env.t -> class_declaration -> class_declaration ->
class_match_failure list

View File

@ -91,9 +91,9 @@ let class_type_declarations ~loc ~old_env env cxt subst id decl1 decl2 =
raise(Error[cxt, old_env,
Class_type_declarations(id, decl1, decl2, reason)])
let class_declarations ~loc ~old_env env cxt subst id decl1 decl2 =
let class_declarations ~old_env env cxt subst id decl1 decl2 =
let decl2 = Subst.class_declaration subst decl2 in
match Includeclass.class_declarations ~loc env decl1 decl2 with
match Includeclass.class_declarations env decl1 decl2 with
[] -> ()
| reason ->
raise(Error[cxt, old_env, Class_declarations(id, decl1, decl2, reason)])
@ -417,7 +417,7 @@ and signature_components ~loc old_env env cxt subst paired =
modtype_infos ~loc env cxt subst id1 info1 info2;
comps_rec rem
| (Sig_class(id1, decl1, _), Sig_class(_id2, decl2, _), pos) :: rem ->
class_declarations ~loc ~old_env env cxt subst id1 decl1 decl2;
class_declarations ~old_env env cxt subst id1 decl1 decl2;
(pos, Tcoerce_none) :: comps_rec rem
| (Sig_class_type(id1, info1, _),
Sig_class_type(_id2, info2, _), _pos) :: rem ->