소스 검색

allow to enhance access wrt interface declaration

Nicolas Cannasse 16 년 전
부모
커밋
3046daae46
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      typeload.ml

+ 2 - 2
typeload.ml

@@ -338,9 +338,9 @@ let rec check_interface ctx c p intf params =
 			let p = (match f2.cf_expr with None -> p | Some e -> e.epos) in
 			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
-			else if not (match f2.cf_get, f.cf_get with InlineAccess, NormalAccess -> true | a,b -> a = b) then
+			else if not (unify_access f2.cf_get f.cf_get) then
 				display_error ctx ("Field " ^ i ^ " has different property access than in " ^ s_type_path intf.cl_path ^ " (" ^ s_access f2.cf_get ^ " should be " ^ s_access f.cf_get ^ ")") p
-			else if not (match f2.cf_set, f.cf_set with NeverAccess, NoAccess -> true | NeverAccess, MethodAccess false -> f2.cf_get = InlineAccess | a,b -> a = b) then
+			else if not (unify_access f2.cf_set f.cf_set) then
 				display_error ctx ("Field " ^ i ^ " has different property access than in " ^ s_type_path intf.cl_path ^ " (" ^ s_access f2.cf_set ^ " should be " ^ s_access f.cf_set ^ ")") p			
 			else try
 				valid_redefinition ctx f2 t2 f (apply_params intf.cl_types params f.cf_type)