浏览代码

fixed implements + inline

Nicolas Cannasse 14 年之前
父节点
当前提交
35bd35c2f7
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      typeload.ml

+ 6 - 1
typeload.ml

@@ -384,9 +384,14 @@ let rec check_interface ctx c p intf params =
 			let t2, f2 = class_field_no_interf c i in
 			ignore(follow f2.cf_type); (* force evaluation *)
 			let p = (match f2.cf_expr with None -> p | Some e -> e.epos) in
+			let mkind = function
+				| MethNormal | MethInline -> 0
+				| MethDynamic -> 1
+				| MethMacro -> 2
+			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 (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
+			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 -> mkind m1 = mkind 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
 			else try
 				valid_redefinition ctx f2 t2 f (apply_params intf.cl_types params f.cf_type)