Browse Source

remove unnecessary `promote_abstract_parameters` function

Simon Krajewski 11 years ago
parent
commit
eda55fae6a
3 changed files with 1 additions and 17 deletions
  1. 0 15
      codegen.ml
  2. 1 1
      filters.ml
  3. 0 1
      main.ml

+ 0 - 15
codegen.ml

@@ -629,21 +629,6 @@ let on_inherit ctx c p h =
 	| _ ->
 	| _ ->
 		true
 		true
 
 
-(* Promotes type parameters of abstracts to their implementation fields *)
-let promote_abstract_parameters ctx t = match t with
-	| TClassDecl ({cl_kind = KAbstractImpl a} as c) when a.a_params <> [] ->
-		List.iter (fun f ->
-			List.iter (fun (n,t) -> match t with
-				| TInst({cl_kind = KTypeParameter _; cl_path=p,n} as cp,[]) when not (List.mem_assoc n f.cf_params) ->
-					let path = List.rev ((snd c.cl_path) :: List.rev (fst c.cl_path)),n in
-					f.cf_params <- (n,TInst({cp with cl_path = path},[])) :: f.cf_params
-				| _ ->
-					()
-			) a.a_params;
-		) c.cl_ordered_statics;
-	| _ ->
-		()
-
 (* -------------------------------------------------------------------------- *)
 (* -------------------------------------------------------------------------- *)
 (* ABSTRACT CASTS *)
 (* ABSTRACT CASTS *)
 
 

+ 1 - 1
filters.ml

@@ -1179,7 +1179,7 @@ let run com tctx main =
 	let filters = [
 	let filters = [
 		promote_complex_rhs com;
 		promote_complex_rhs com;
 		if com.config.pf_add_final_return then add_final_return else (fun e -> e);
 		if com.config.pf_add_final_return then add_final_return else (fun e -> e);
-		rename_local_vars com; (* TODO: it shouldn't be necessary to have this here if promote_complex_rhs can generate proper variable names *)
+		rename_local_vars com;
 	] in
 	] in
 	List.iter (fun t ->
 	List.iter (fun t ->
 		remove_generic_base tctx t;
 		remove_generic_base tctx t;

+ 0 - 1
main.ml

@@ -1467,7 +1467,6 @@ try
 		| Some file ->
 		| Some file ->
 			Common.log com ("Generating xml : " ^ file);
 			Common.log com ("Generating xml : " ^ file);
 			Genxml.generate com file);
 			Genxml.generate com file);
-		if com.platform = Java then List.iter (Codegen.promote_abstract_parameters com) com.types;
 		if com.platform = Flash || com.platform = Cpp then List.iter (Codegen.fix_overrides com) com.types;
 		if com.platform = Flash || com.platform = Cpp then List.iter (Codegen.fix_overrides com) com.types;
 		if Common.defined com Define.Dump then Codegen.dump_types com;
 		if Common.defined com Define.Dump then Codegen.dump_types com;
 		if Common.defined com Define.DumpDependencies then Codegen.dump_dependencies com;
 		if Common.defined com Define.DumpDependencies then Codegen.dump_dependencies com;