Class declarations create a class type declaration in signature: no need to check twice.
parent
e7e7afd280
commit
fa9e40496e
|
@ -32,14 +32,7 @@ let class_type_declarations ~loc env cty1 cty2 =
|
||||||
cty1.clty_params cty1.clty_type
|
cty1.clty_params cty1.clty_type
|
||||||
cty2.clty_params cty2.clty_type
|
cty2.clty_params cty2.clty_type
|
||||||
|
|
||||||
let class_declarations ~loc env cty1 cty2 =
|
let class_declarations 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);
|
|
||||||
|
|
||||||
match cty1.cty_new, cty2.cty_new with
|
match cty1.cty_new, cty2.cty_new with
|
||||||
None, Some _ ->
|
None, Some _ ->
|
||||||
[Ctype.CM_Virtual_class]
|
[Ctype.CM_Virtual_class]
|
||||||
|
|
|
@ -26,7 +26,6 @@ val class_type_declarations:
|
||||||
Env.t -> class_type_declaration -> class_type_declaration ->
|
Env.t -> class_type_declaration -> class_type_declaration ->
|
||||||
class_match_failure list
|
class_match_failure list
|
||||||
val class_declarations:
|
val class_declarations:
|
||||||
loc:Location.t ->
|
|
||||||
Env.t -> class_declaration -> class_declaration ->
|
Env.t -> class_declaration -> class_declaration ->
|
||||||
class_match_failure list
|
class_match_failure list
|
||||||
|
|
||||||
|
|
|
@ -91,9 +91,9 @@ let class_type_declarations ~loc ~old_env env cxt subst id decl1 decl2 =
|
||||||
raise(Error[cxt, old_env,
|
raise(Error[cxt, old_env,
|
||||||
Class_type_declarations(id, decl1, decl2, reason)])
|
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
|
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 ->
|
| reason ->
|
||||||
raise(Error[cxt, old_env, Class_declarations(id, decl1, decl2, 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;
|
modtype_infos ~loc env cxt subst id1 info1 info2;
|
||||||
comps_rec rem
|
comps_rec rem
|
||||||
| (Sig_class(id1, decl1, _), Sig_class(_id2, decl2, _), pos) :: 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
|
(pos, Tcoerce_none) :: comps_rec rem
|
||||||
| (Sig_class_type(id1, info1, _),
|
| (Sig_class_type(id1, info1, _),
|
||||||
Sig_class_type(_id2, info2, _), _pos) :: rem ->
|
Sig_class_type(_id2, info2, _), _pos) :: rem ->
|
||||||
|
|
Loading…
Reference in New Issue