浏览代码

make sure PHP output does not implement duplicate interfaces (fixed issue #761)

Simon Krajewski 13 年之前
父节点
当前提交
0fbf48ae81
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      genphp.ml

+ 2 - 1
genphp.ml

@@ -1948,7 +1948,8 @@ let generate_class ctx c =
 	| Some (csup,_) ->
 	| Some (csup,_) ->
 		requires_constructor := false;
 		requires_constructor := false;
 		print ctx "extends %s " (s_path ctx csup.cl_path csup.cl_extern c.cl_pos));
 		print ctx "extends %s " (s_path ctx csup.cl_path csup.cl_extern c.cl_pos));
-	(match c.cl_implements with
+	let implements = ExtList.List.unique ~cmp:(fun a b -> (fst a).cl_path = (fst b).cl_path) c.cl_implements in
+	(match implements with
 	| [] -> ()
 	| [] -> ()
 	| l ->
 	| l ->
 		spr ctx (if c.cl_interface then "extends " else "implements ");
 		spr ctx (if c.cl_interface then "extends " else "implements ");