Nicolas Cannasse 13 年 前
コミット
2793ea06cd
1 ファイル変更17 行追加2 行削除
  1. 17 2
      type.ml

+ 17 - 2
type.ml

@@ -820,9 +820,24 @@ let rec raw_class_field build_type c i =
 					| _ ->
 						loop ctl
 			in
-			loop tl
+			loop tl		
 		| _ ->
-			raise Not_found
+			if not c.cl_interface then raise Not_found;
+			(* 
+				an interface can implements other interfaces without
+				having to redeclare its fields
+			*)
+			let rec loop = function
+				| [] ->
+					raise Not_found
+				| (c,tl) :: l ->
+					try
+						let t , f = raw_class_field build_type c i in
+						apply_params c.cl_types tl t, f
+					with
+						Not_found -> loop l
+			in
+			loop c.cl_implements
 
 let class_field = raw_class_field field_type