浏览代码

[java/cs] Enable -dce no testing

Cauê Waneck 10 年之前
父节点
当前提交
c01c3dc9ab
共有 3 个文件被更改,包括 14 次插入6 次删除
  1. 5 3
      gencommon.ml
  2. 6 0
      tests/RunCi.hx
  3. 3 3
      tests/unit/src/unit/issues/Issue3388.hx

+ 5 - 3
gencommon.ml

@@ -10979,9 +10979,11 @@ struct
 			match md with
 				| TClassDecl ({ cl_kind = KAbstractImpl a } as c) ->
 						List.iter (function
-							| cf when Meta.has Meta.Impl cf.cf_meta ->
-									(* add type parameters to all implementation functions *)
-									cf.cf_params <- cf.cf_params @ a.a_params
+							| ({ cf_type = TFun( ("this",_,_) :: _, _ ) } as cf) when Meta.has Meta.Impl cf.cf_meta ->
+								(* add type parameters to all implementation functions *)
+								cf.cf_params <- cf.cf_params @ a.a_params
+							| ({ cf_name = "_new" } as cf) ->
+								cf.cf_params <- cf.cf_params @ a.a_params
 							| _ -> ()
 						) c.cl_ordered_statics;
 						Some md

+ 6 - 0
tests/RunCi.hx

@@ -683,6 +683,9 @@ class RunCi {
 					runCommand("haxe", ["compile-java.hxml"]);
 					runCommand("java", ["-jar", "bin/java/Test-Debug.jar"]);
 
+					runCommand("haxe", ["compile-java.hxml","-dce","no"]);
+					runCommand("java", ["-jar", "bin/java/Test-Debug.jar"]);
+
 					changeDirectory(sysDir);
 					runCommand("haxe", ["compile-java.hxml"]);
 					runCommand("java", ["-jar", "bin/java/Main-Debug.jar"]);
@@ -715,6 +718,9 @@ class RunCi {
 					runCommand("haxe", ['compile-cs$compl.hxml']);
 					runCs("bin/cs/bin/Test-Debug.exe");
 
+					runCommand("haxe", ['compile-cs$compl.hxml','-dce','no']);
+					runCs("bin/cs/bin/Test-Debug.exe");
+
 					runCommand("haxe", ['compile-cs-unsafe$compl.hxml']);
 					runCs("bin/cs_unsafe/bin/Test-Debug.exe");
 

+ 3 - 3
tests/unit/src/unit/issues/Issue3388.hx

@@ -7,12 +7,12 @@ private abstract A<T>(Array<T>) {
 
 	#if java
 	@:impl
-    @:overload
+    @:overload @:extern
 	static inline public function sum(a:Array<Int>) {
         return "sum of ints";
     }
 
-    @:overload
+    @:overload @:extern
 	@:impl
 	static inline public function sum(a:Array<String>) {
         return "sum of strings";
@@ -27,4 +27,4 @@ class Issue3388 extends Test {
 		eq("sum of strings", new A(["1"]).sum());
 		#end
 	}
-}
+}