|
@@ -1454,7 +1454,7 @@ let check_overloading c p () =
|
|
try
|
|
try
|
|
let f2 = PMap.find f.cf_name c.cl_fields in
|
|
let f2 = PMap.find f.cf_name c.cl_fields in
|
|
if not (type_eq false (field_type f) (field_type f2)) then error ("Field " ^ f.cf_name ^ " overload parent class with different or incomplete type") p;
|
|
if not (type_eq false (field_type f) (field_type f2)) then error ("Field " ^ f.cf_name ^ " overload parent class with different or incomplete type") p;
|
|
- if f.cf_public <> f2.cf_public then error ("Field " ^ f.cf_name ^ " has different access right than previous one") p;
|
|
|
|
|
|
+ if f.cf_public <> f2.cf_public then error ("Field " ^ f.cf_name ^ " has different visibility (public/private) than previous one") p;
|
|
with
|
|
with
|
|
Not_found -> loop c.cl_super f
|
|
Not_found -> loop c.cl_super f
|
|
in
|
|
in
|
|
@@ -1465,7 +1465,8 @@ let check_interfaces c p () =
|
|
PMap.iter (fun i f ->
|
|
PMap.iter (fun i f ->
|
|
try
|
|
try
|
|
let t , f2 = class_field c i in
|
|
let t , f2 = class_field c i in
|
|
- if f2.cf_public <> f.cf_public || f2.cf_get <> f.cf_get || f2.cf_set <> f.cf_set then error ("Field " ^ i ^ " has different access than in " ^ s_type_path intf.cl_path) p;
|
|
|
|
|
|
+ if f2.cf_public <> f.cf_public then error ("Field " ^ i ^ " has different visibility (public/private) than in " ^ s_type_path intf.cl_path) p;
|
|
|
|
+ if f2.cf_get <> f.cf_get || f2.cf_set <> f.cf_set then error ("Field " ^ i ^ " has different property access than in " ^ s_type_path intf.cl_path) p;
|
|
if not (type_eq false (field_type f2) (apply_params intf.cl_types params (field_type f))) then error ("Field " ^ i ^ " has different type than in " ^ s_type_path intf.cl_path) p;
|
|
if not (type_eq false (field_type f2) (apply_params intf.cl_types params (field_type f))) then error ("Field " ^ i ^ " has different type than in " ^ s_type_path intf.cl_path) p;
|
|
with
|
|
with
|
|
Not_found ->
|
|
Not_found ->
|