Browse Source

remove empty @:autoBuild interfaces before generation (fixed issue #761)

Simon Krajewski 13 years ago
parent
commit
970f21a31c
1 changed files with 2 additions and 0 deletions
  1. 2 0
      codegen.ml

+ 2 - 0
codegen.ml

@@ -575,6 +575,8 @@ let on_generate ctx t =
 			f.cf_expr <- Some e;
 			f.cf_expr <- Some e;
 			c.cl_ordered_statics <- f :: c.cl_ordered_statics;
 			c.cl_ordered_statics <- f :: c.cl_ordered_statics;
 			c.cl_statics <- PMap.add f.cf_name f c.cl_statics);
 			c.cl_statics <- PMap.add f.cf_name f c.cl_statics);
+		(* remove empty @:autoBuild interfaces to avoid duplicate interface problems *)
+		c.cl_implements <- List.filter (fun (c,_) -> not (has_meta ":autoBuild" c.cl_meta) || not (PMap.is_empty c.cl_fields)) c.cl_implements;
 	| TEnumDecl e ->
 	| TEnumDecl e ->
 		List.iter (fun m ->
 		List.iter (fun m ->
 			match m with
 			match m with