|
|
@@ -1862,12 +1862,19 @@ let rec type_eq param a b =
|
|
|
List.iter2 (type_eq param) tl1 tl2
|
|
|
| TAnon a1, TAnon a2 ->
|
|
|
(try
|
|
|
+ (match !(a2.a_status) with
|
|
|
+ | Statics c -> (match !(a1.a_status) with Statics c2 when c == c2 -> () | _ -> error [])
|
|
|
+ | EnumStatics e -> (match !(a1.a_status) with EnumStatics e2 when e == e2 -> () | _ -> error [])
|
|
|
+ | AbstractStatics a -> (match !(a1.a_status) with AbstractStatics a2 when a == a2 -> () | _ -> error [])
|
|
|
+ | _ -> ()
|
|
|
+ );
|
|
|
PMap.iter (fun n f1 ->
|
|
|
try
|
|
|
let f2 = PMap.find n a2.a_fields in
|
|
|
if f1.cf_kind <> f2.cf_kind && (param = EqStrict || param = EqCoreType || not (unify_kind f1.cf_kind f2.cf_kind)) then error [invalid_kind n f1.cf_kind f2.cf_kind];
|
|
|
let a = f1.cf_type and b = f2.cf_type in
|
|
|
- (try type_eq param a b with Unify_error l -> error (invalid_field n :: l))
|
|
|
+ (try type_eq param a b with Unify_error l -> error (invalid_field n :: l));
|
|
|
+ if f1.cf_public != f2.cf_public then error [invalid_visibility n];
|
|
|
with
|
|
|
Not_found ->
|
|
|
if is_closed a2 then error [has_no_field b n];
|