Ver Fonte

several unit test fixes (as3 is broken... again)

Simon Krajewski há 13 anos atrás
pai
commit
8513842ba7
6 ficheiros alterados com 7 adições e 7 exclusões
  1. 1 1
      genas3.ml
  2. 1 1
      main.ml
  3. 1 1
      tests/unit/MyClass.hx
  4. 1 1
      tests/unit/MySubClass.hx
  5. 1 1
      tests/unit/Test.hx
  6. 2 2
      tests/unit/TestType.hx

+ 1 - 1
genas3.ml

@@ -109,7 +109,7 @@ let reserved =
 	(* we don't include get+set since they are not 'real' keywords, but they can't be used as method names *)
 	"function";"class";"var";"if";"else";"while";"do";"for";"break";"continue";"return";"extends";"implements";
 	"import";"switch";"case";"default";"static";"public";"private";"try";"catch";"new";"this";"throw";"interface";
-	"override";"package";"null";"true";"false"
+	"override";"package";"null";"true";"false";"void"
 	];
 	h
 

+ 1 - 1
main.ml

@@ -1027,7 +1027,7 @@ try
 		end;
 		let t = Common.timer "filters" in
 		let main, types, modules = Typer.generate tctx in
-		let types,modules = if Common.defined ctx.com "dce" then Dce.run tctx main types modules else types,modules in
+		let types,modules = if Common.defined ctx.com "dce" && not !interp then Dce.run tctx main types modules else types,modules in
 		com.main <- main;
 		com.types <- types;
 		com.modules <- modules;

+ 1 - 1
tests/unit/MyClass.hx

@@ -17,7 +17,7 @@ class MyClass {
 		return val;
 	}
 
-	public function set(v) {
+	@:keep public function set(v) {
 		val = v;
 	}
 

+ 1 - 1
tests/unit/MySubClass.hx

@@ -6,6 +6,6 @@ class MySubClass extends MyClass {
 		return val * 2;
 	}
 
-	#if as3 public #end static var XXX = 3;
+	@:keep #if as3 public #end static var XXX = 3;
 
 }

+ 1 - 1
tests/unit/Test.hx

@@ -206,7 +206,7 @@ package unit;
 			#if java
 			new TestJava(),
 			#end
-			#if dce
+			#if (dce && !interp)
 			new TestDCE(),
 			#end
 			//new TestUnspecified(),

+ 2 - 2
tests/unit/TestType.hx

@@ -470,8 +470,8 @@ class TestType extends Test {
 	
 	function testInline()
 	{
-		typedAs(inlineTest1([1]), Void);
-		typedAs(inlineTest2([1]), Void);
+		typedAs(inlineTest1([1]), var void:Void);
+		typedAs(inlineTest2([1]), var void:Void);
 	}
 	
 	inline function inlineTest1<T>(map:Array<T>) {