Browse Source

allow overrides in core_api

Nicolas Cannasse 13 years ago
parent
commit
ba5161c3e0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      typeload.ml

+ 1 - 1
typeload.ml

@@ -662,7 +662,7 @@ let init_core_api ctx c =
 			) fcore;
 			) fcore;
 			PMap.iter (fun i f ->
 			PMap.iter (fun i f ->
 				let p = (match f.cf_expr with None -> c.cl_pos | Some e -> e.epos) in
 				let p = (match f.cf_expr with None -> c.cl_pos | Some e -> e.epos) in
-				if f.cf_public && not (PMap.mem f.cf_name fcore) then error ("Public field " ^ i ^ " is not part of core type") p;
+				if f.cf_public && not (PMap.mem f.cf_name fcore) && not (List.mem f.cf_name c.cl_overrides) then error ("Public field " ^ i ^ " is not part of core type") p;
 			) fl;
 			) fl;
 		in
 		in
 		check_fields ccore.cl_fields c.cl_fields;
 		check_fields ccore.cl_fields c.cl_fields;