Explorar o código

Just check for compile, do not actually run the code

hughsando %!s(int64=8) %!d(string=hai) anos
pai
achega
3934ffa88c
Modificáronse 1 ficheiros con 11 adicións e 6 borrados
  1. 11 6
      tests/unit/src/unit/issues/Issue4988.hx

+ 11 - 6
tests/unit/src/unit/issues/Issue4988.hx

@@ -2,14 +2,19 @@ package unit.issues;
 
 class Issue4988 extends Test {
 	static var value:Dynamic;
+	static var actuallyRunCode = false;
 
 	function test() {
-		try {
-			var d:{i:Null<Int>} = null;
-			value = (d.i > 0);
-			t(false);
-		} catch(e:Dynamic) {
+		if (actuallyRunCode) {
+			try {
+				var d:{i:Null<Int>} = null;
+				value = (d.i > 0);
+				t(false);
+			} catch(e:Dynamic) {
+				t(true);
+			}
+		} else {
 			t(true);
 		}
 	}
-}
+}