浏览代码

only test Null<T> to T inline unwrapping on static platform (see #3585)

Dan Korostelev 10 年之前
父节点
当前提交
ccf479c382
共有 1 个文件被更改,包括 7 次插入5 次删除
  1. 7 5
      tests/unit/src/unit/issues/Issue3585.hx

+ 7 - 5
tests/unit/src/unit/issues/Issue3585.hx

@@ -2,18 +2,20 @@ package unit.issues;
 import unit.Test;
 
 class Issue3585 extends Test {
+    #if (flash || java || cs || cpp) // this is only relevant on static platforms
     function test() {
         var v = inlineUnwrap();
         eq(getType(v), "Int");
     }
 
-    static macro function getType(v:haxe.macro.Expr) {
-        var t = haxe.macro.Context.typeof(v);
-        return macro $v{haxe.macro.TypeTools.toString(t)};
-    }
-
     inline function inlineUnwrap():Int {
         var tmp:Null<Int> = 1;
         return tmp;
     }
+    #end
+
+    static macro function getType(v:haxe.macro.Expr) {
+        var t = haxe.macro.Context.typeof(v);
+        return macro $v{haxe.macro.TypeTools.toString(t)};
+    }
 }