Просмотр исходного кода

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

Simon Krajewski 13 лет назад
Родитель
Сommit
0fbf48ae81
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      genphp.ml

+ 2 - 1
genphp.ml

@@ -1948,7 +1948,8 @@ let generate_class ctx c =
 	| Some (csup,_) ->
 		requires_constructor := false;
 		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 ->
 		spr ctx (if c.cl_interface then "extends " else "implements ");