|
@@ -386,7 +386,7 @@ let rec check_interface ctx c p intf params =
|
|
let p = (match f2.cf_expr with None -> p | Some e -> e.epos) in
|
|
let p = (match f2.cf_expr with None -> p | Some e -> e.epos) in
|
|
if f.cf_public && not f2.cf_public then
|
|
if f.cf_public && not f2.cf_public then
|
|
display_error ctx ("Field " ^ i ^ " should be public as requested by " ^ s_type_path intf.cl_path) p
|
|
display_error ctx ("Field " ^ i ^ " should be public as requested by " ^ s_type_path intf.cl_path) p
|
|
- else if not (unify_kind f2.cf_kind f.cf_kind) then
|
|
|
|
|
|
+ else if not (unify_kind f2.cf_kind f.cf_kind) || not (match f.cf_kind, f2.cf_kind with Var _ , Var _ -> true | Method m1, Method m2 -> m1 = m2 | _ -> false) then
|
|
display_error ctx ("Field " ^ i ^ " has different property access than in " ^ s_type_path intf.cl_path ^ " (" ^ s_kind f2.cf_kind ^ " should be " ^ s_kind f.cf_kind ^ ")") p
|
|
display_error ctx ("Field " ^ i ^ " has different property access than in " ^ s_type_path intf.cl_path ^ " (" ^ s_kind f2.cf_kind ^ " should be " ^ s_kind f.cf_kind ^ ")") p
|
|
else try
|
|
else try
|
|
valid_redefinition ctx f2 t2 f (apply_params intf.cl_types params f.cf_type)
|
|
valid_redefinition ctx f2 t2 f (apply_params intf.cl_types params f.cf_type)
|