Browse Source

Typeof & serialize haxe.Int64 (#12410)

* typeof & serialize int64

* use patched utest (do not merge)

* partial macro fixes

* more support for TInt64

* only enable swc tests in flash platform if -D flash-test-swc is present

* some fixes

* disable failing eval tests

* reenable tests

* fix JVM check

* adjust terrible optimization test

* disable some annoying failures related to large constants

* remove C++ branching that contradicts the test spec

* dodge hxcpp small value weirdness

---------

Co-authored-by: Simon Krajewski <[email protected]>
Nicolas Cannasse 2 tuần trước cách đây
mục cha
commit
a7cd7f768a

+ 11 - 10
src/macro/eval/evalStdLib.ml

@@ -3089,22 +3089,23 @@ module StdType = struct
 		let rec loop v = match v with
 		let rec loop v = match v with
 			| VNull -> 0,[||]
 			| VNull -> 0,[||]
 			| VInt32 _ -> 1,[||]
 			| VInt32 _ -> 1,[||]
-			| VFloat _ -> 2,[||]
-			| VTrue | VFalse -> 3,[||]
-			| VInstance vi -> 6,[|get_static_prototype_as_value ctx vi.iproto.ppath null_pos|]
-			| VString _ -> 6,[|get_static_prototype_as_value ctx key_String null_pos|]
-			| VArray _ -> 6,[|get_static_prototype_as_value ctx key_Array null_pos|]
-			| VVector _ -> 6,[|get_static_prototype_as_value ctx key_eval_Vector null_pos|]
+			| VInt64 _ | VUInt64 _ -> 2,[||]
+			| VFloat _ -> 3,[||]
+			| VTrue | VFalse -> 4,[||]
+			| VInstance vi -> 7,[|get_static_prototype_as_value ctx vi.iproto.ppath null_pos|]
+			| VString _ -> 7,[|get_static_prototype_as_value ctx key_String null_pos|]
+			| VArray _ -> 7,[|get_static_prototype_as_value ctx key_Array null_pos|]
+			| VVector _ -> 7,[|get_static_prototype_as_value ctx key_eval_Vector null_pos|]
 			| VObject _ | VPrototype _ ->
 			| VObject _ | VPrototype _ ->
-				4,[||]
+				5,[||]
 			| VFunction _
 			| VFunction _
 			| VFieldClosure _ ->
 			| VFieldClosure _ ->
-				5,[||]
+				6,[||]
 			| VEnumValue ve ->
 			| VEnumValue ve ->
-				7,[|get_static_prototype_as_value ctx ve.epath null_pos|]
+				8,[|get_static_prototype_as_value ctx ve.epath null_pos|]
 			| VLazy f ->
 			| VLazy f ->
 				loop (Lazy.force f)
 				loop (Lazy.force f)
-			| VInt64 _ | VUInt64 _ | VNativeString _ | VHandle _ -> 8,[||]
+			| VNativeString _ | VHandle _ -> 9,[||]
 		in
 		in
 		let i,vl = loop v in
 		let i,vl = loop v in
 		encode_enum_value key_ValueType i vl None
 		encode_enum_value key_ValueType i vl None

+ 1 - 0
std/Type.hx

@@ -285,6 +285,7 @@ extern class Type {
 enum ValueType {
 enum ValueType {
 	TNull;
 	TNull;
 	TInt;
 	TInt;
+	TInt64;
 	TFloat;
 	TFloat;
 	TBool;
 	TBool;
 	TObject;
 	TObject;

+ 3 - 0
std/cpp/_std/Type.hx

@@ -22,6 +22,7 @@
 enum ValueType {
 enum ValueType {
 	TNull;
 	TNull;
 	TInt;
 	TInt;
+	TInt64;
 	TFloat;
 	TFloat;
 	TBool;
 	TBool;
 	TObject;
 	TObject;
@@ -138,6 +139,8 @@ enum ValueType {
 					return TObject;
 					return TObject;
 				case 7:
 				case 7:
 					return TEnum(v.__GetClass());
 					return TEnum(v.__GetClass());
+				case 9:
+					return TInt64;
 				default:
 				default:
 					return untyped TClass(v.__GetClass());
 					return untyped TClass(v.__GetClass());
 			}
 			}

+ 3 - 0
std/flash/_std/Type.hx

@@ -22,6 +22,7 @@
 enum ValueType {
 enum ValueType {
 	TNull;
 	TNull;
 	TInt;
 	TInt;
+	TInt64;
 	TFloat;
 	TFloat;
 	TBool;
 	TBool;
 	TObject;
 	TObject;
@@ -255,6 +256,8 @@ enum ValueType {
 							return TObject;
 							return TObject;
 						if (c.__isenum)
 						if (c.__isenum)
 							return TEnum(c);
 							return TEnum(c);
+						if( c == @:privateAccess haxe.Int64.IMPL )
+							return TInt64;
 						return TClass(c);
 						return TClass(c);
 					} catch (e:Dynamic) {
 					} catch (e:Dynamic) {
 						if (cname == "builtin.as$0::MethodClosure" || cname.indexOf("-") != -1)
 						if (cname == "builtin.as$0::MethodClosure" || cname.indexOf("-") != -1)

+ 2 - 0
std/haxe/Int64.hx

@@ -480,6 +480,8 @@ abstract Int64(__Int64) from __Int64 to __Int64 {
 		return x;
 		return x;
 		#end
 		#end
 	}
 	}
+	
+	static var IMPL = ___Int64;
 }
 }
 
 
 /**
 /**

+ 5 - 0
std/haxe/Serializer.hx

@@ -177,6 +177,7 @@ class Serializer {
 		B : Enum<Dynamic>
 		B : Enum<Dynamic>
 		M : haxe.ds.ObjectMap
 		M : haxe.ds.ObjectMap
 		C : custom
 		C : custom
+		I : haxe.Int64
 	 */
 	 */
 	function serializeString(s:String) {
 	function serializeString(s:String) {
 		var x = shash.get(s);
 		var x = shash.get(s);
@@ -261,6 +262,10 @@ class Serializer {
 				}
 				}
 				buf.add("i");
 				buf.add("i");
 				buf.add(v);
 				buf.add(v);
+			case TInt64:
+				var v:haxe.Int64 = v;
+				buf.add("I");
+				buf.add(Std.string(v));
 			case TFloat:
 			case TFloat:
 				var v:Float = v;
 				var v:Float = v;
 				if (Math.isNaN(v))
 				if (Math.isNaN(v))

+ 27 - 0
std/haxe/Unserializer.hx

@@ -172,6 +172,31 @@ class Unserializer {
 		return k;
 		return k;
 	}
 	}
 
 
+	function readDigits64() {
+		var k : haxe.Int64 = 0;
+		var s = false;
+		var fpos = pos;
+		while (true) {
+			var c = get(pos);
+			if (StringTools.isEof(c))
+				break;
+			if (c == "-".code) {
+				if (pos != fpos)
+					break;
+				s = true;
+				pos++;
+				continue;
+			}
+			if (c < "0".code || c > "9".code)
+				break;
+			k = k * 10 + (c - "0".code);
+			pos++;
+		}
+		if (s)
+			k *= -1;
+		return k;
+	}
+
 	function readFloat() {
 	function readFloat() {
 		var p1 = pos;
 		var p1 = pos;
 		while (true) {
 		while (true) {
@@ -246,6 +271,8 @@ class Unserializer {
 				return 0;
 				return 0;
 			case "i".code:
 			case "i".code:
 				return readDigits();
 				return readDigits();
+			case "I".code:
+				return readDigits64();
 			case "d".code:
 			case "d".code:
 				return readFloat();
 				return readFloat();
 			case "y".code:
 			case "y".code:

+ 1 - 1
std/haxe/format/JsonPrinter.hx

@@ -86,7 +86,7 @@ class JsonPrinter {
 				add('"???"');
 				add('"???"');
 			case TObject:
 			case TObject:
 				objString(v);
 				objString(v);
-			case TInt:
+			case TInt, TInt64:
 				add(#if (jvm || hl) Std.string(v) #else v #end);
 				add(#if (jvm || hl) Std.string(v) #else v #end);
 			case TFloat:
 			case TFloat:
 				add(Math.isFinite(v) ? Std.string(v) : 'null');
 				add(Math.isFinite(v) ? Std.string(v) : 'null');

+ 1 - 1
std/haxe/runtime/Copy.hx

@@ -67,7 +67,7 @@ class Copy {
 	function copyValue<T, O:{}
 	function copyValue<T, O:{}
 		& T>(v:T):T {
 		& T>(v:T):T {
 		return switch (Type.typeof(v)) {
 		return switch (Type.typeof(v)) {
-			case TNull, TInt, TFloat, TBool, TClass(String | Date):
+			case TNull, TInt, TFloat, TBool, TClass(String | Date), TInt64:
 				v;
 				v;
 			case TClass(c):
 			case TClass(c):
 				var v:O = cast v;
 				var v:O = cast v;

+ 4 - 1
std/hl/_std/Type.hx

@@ -22,6 +22,7 @@
 enum ValueType {
 enum ValueType {
 	TNull;
 	TNull;
 	TInt;
 	TInt;
+	TInt64;
 	TFloat;
 	TFloat;
 	TBool;
 	TBool;
 	TObject;
 	TObject;
@@ -229,8 +230,10 @@ class Type {
 		switch (t.kind) {
 		switch (t.kind) {
 			case HVoid:
 			case HVoid:
 				return TNull;
 				return TNull;
-			case HUI8, HUI16, HI32, HI64:
+			case HUI8, HUI16, HI32:
 				return TInt;
 				return TInt;
+			case HI64:
+				return TInt64;
 			case HF32, HF64:
 			case HF32, HF64:
 				return (v : Int) == (v:Float) ? TInt : TFloat;
 				return (v : Int) == (v:Float) ? TInt : TFloat;
 			case HBool:
 			case HBool:

+ 3 - 0
std/js/_std/Type.hx

@@ -22,6 +22,7 @@
 enum ValueType {
 enum ValueType {
 	TNull;
 	TNull;
 	TInt;
 	TInt;
+	TInt64;
 	TFloat;
 	TFloat;
 	TBool;
 	TBool;
 	TObject;
 	TObject;
@@ -258,6 +259,8 @@ enum ValueType {
 					#end
 					#end
 				}
 				}
 				var c = js.Boot.getClass(v);
 				var c = js.Boot.getClass(v);
+				if( c == @:privateAccess haxe.Int64.IMPL )
+					return TInt64;
 				if (c != null)
 				if (c != null)
 					return TClass(c);
 					return TClass(c);
 				return TObject;
 				return TObject;

+ 6 - 3
std/jvm/_std/Type.hx

@@ -9,6 +9,7 @@ using jvm.NativeTools.ObjectTools;
 enum ValueType {
 enum ValueType {
 	TNull;
 	TNull;
 	TInt;
 	TInt;
+	TInt64;
 	TFloat;
 	TFloat;
 	TBool;
 	TBool;
 	TObject;
 	TObject;
@@ -87,7 +88,7 @@ class Type {
 
 
 	public static function getEnumName(e:Enum<Dynamic>):String {
 	public static function getEnumName(e:Enum<Dynamic>):String {
 		return switch e.native().getName() {
 		return switch e.native().getName() {
-			case s if(s.indexOf("haxe.root.") == 0): s.substr(10);
+			case s if (s.indexOf("haxe.root.") == 0): s.substr(10);
 			case s: s;
 			case s: s;
 		}
 		}
 	}
 	}
@@ -170,8 +171,7 @@ class Type {
 	public static function createEmptyInstance<T>(cl:Class<T>):T {
 	public static function createEmptyInstance<T>(cl:Class<T>):T {
 		var annotation = (cl.native().getAnnotation((cast ClassReflectionInformation : java.lang.Class<ClassReflectionInformation>)));
 		var annotation = (cl.native().getAnnotation((cast ClassReflectionInformation : java.lang.Class<ClassReflectionInformation>)));
 		if (annotation != null) {
 		if (annotation != null) {
-			return cl.native().getConstructor(emptyClass)
-				.newInstance(emptyArg);
+			return cl.native().getConstructor(emptyClass).newInstance(emptyArg);
 		} else {
 		} else {
 			return cl.native().newInstance();
 			return cl.native().newInstance();
 		}
 		}
@@ -251,6 +251,9 @@ class Type {
 			return TNull;
 			return TNull;
 		}
 		}
 		if (Jvm.instanceof(v, java.lang.Number)) {
 		if (Jvm.instanceof(v, java.lang.Number)) {
+			if (Jvm.instanceof(v, java.lang.Long.LongClass)) {
+				return TInt64;
+			}
 			var v:java.lang.Number = cast v;
 			var v:java.lang.Number = cast v;
 			if (v.intValue() == v.doubleValue()) {
 			if (v.intValue() == v.doubleValue()) {
 				return TInt;
 				return TInt;

+ 3 - 0
std/lua/_std/Type.hx

@@ -26,6 +26,7 @@ import lua.Table;
 enum ValueType {
 enum ValueType {
 	TNull;
 	TNull;
 	TInt;
 	TInt;
+	TInt64;
 	TFloat;
 	TFloat;
 	TBool;
 	TBool;
 	TObject;
 	TObject;
@@ -169,6 +170,8 @@ enum ValueType {
 				if (e != null)
 				if (e != null)
 					return TEnum(e);
 					return TEnum(e);
 				var c = lua.Boot.getClass(v);
 				var c = lua.Boot.getClass(v);
+				if( c == @:privateAccess haxe.Int64.IMPL )
+					return TInt64;
 				if (c != null)
 				if (c != null)
 					return TClass(c);
 					return TClass(c);
 				return TObject;
 				return TObject;

+ 3 - 2
std/neko/_std/Type.hx

@@ -23,6 +23,7 @@
 enum ValueType {
 enum ValueType {
 	TNull;
 	TNull;
 	TInt;
 	TInt;
+	TInt64;
 	TFloat;
 	TFloat;
 	TBool;
 	TBool;
 	TObject;
 	TObject;
@@ -175,13 +176,13 @@ enum ValueType {
 		return switch( __dollar__typeof(v) ) {
 		return switch( __dollar__typeof(v) ) {
 		case 0: TNull;
 		case 0: TNull;
 		case 1: TInt;
 		case 1: TInt;
-		case 2: TFloat;
+		case 2: Std.int(v) == v ? TInt : TFloat;
 		case 3: TBool;
 		case 3: TBool;
 		case 7: TFunction;
 		case 7: TFunction;
 		case 5:
 		case 5:
 			var c = v.__class__;
 			var c = v.__class__;
 			if( c != null )
 			if( c != null )
-				TClass(c);
+				(c == @:privateAccess haxe.Int64.IMPL) ? TInt64 : TClass(c);
 			else {
 			else {
 				var e = v.__enum__;
 				var e = v.__enum__;
 				if( e != null )
 				if( e != null )

+ 4 - 1
std/php/_std/Type.hx

@@ -29,6 +29,7 @@ using php.Global;
 enum ValueType {
 enum ValueType {
 	TNull;
 	TNull;
 	TInt;
 	TInt;
+	TInt64;
 	TFloat;
 	TFloat;
 	TBool;
 	TBool;
 	TObject;
 	TObject;
@@ -278,6 +279,8 @@ enum ValueType {
 			var hxClass = Boot.getClass(Global.get_class(v));
 			var hxClass = Boot.getClass(Global.get_class(v));
 			if (Boot.isEnumValue(v))
 			if (Boot.isEnumValue(v))
 				return TEnum(cast hxClass);
 				return TEnum(cast hxClass);
+			if( (cast hxClass) == @:privateAccess haxe.Int64.IMPL )
+				return TInt64;
 			return TClass(cast hxClass);
 			return TClass(cast hxClass);
 		}
 		}
 
 
@@ -286,7 +289,7 @@ enum ValueType {
 		if (v.is_int())
 		if (v.is_int())
 			return TInt;
 			return TInt;
 		if (v.is_float())
 		if (v.is_float())
-			return TFloat;
+			return Std.int(v) == v ? TInt : TFloat;
 		if (v.is_string())
 		if (v.is_string())
 			return TClass(String);
 			return TClass(String);
 
 

+ 4 - 2
std/python/_std/Type.hx

@@ -29,6 +29,7 @@ import python.Syntax;
 enum ValueType {
 enum ValueType {
 	TNull;
 	TNull;
 	TInt;
 	TInt;
+	TInt64;
 	TFloat;
 	TFloat;
 	TBool;
 	TBool;
 	TObject;
 	TObject;
@@ -184,7 +185,7 @@ enum ValueType {
 		} else if (UBuiltins.isinstance(v, UBuiltins.int)) {
 		} else if (UBuiltins.isinstance(v, UBuiltins.int)) {
 			return TInt;
 			return TInt;
 		} else if (UBuiltins.isinstance(v, UBuiltins.float)) {
 		} else if (UBuiltins.isinstance(v, UBuiltins.float)) {
-			return TFloat;
+			return Std.int(v) == v ? TInt : TFloat;
 		} else if (UBuiltins.isinstance(v, String)) {
 		} else if (UBuiltins.isinstance(v, String)) {
 			return TClass(String);
 			return TClass(String);
 		} else if (UBuiltins.isinstance(v, Array)) {
 		} else if (UBuiltins.isinstance(v, Array)) {
@@ -194,7 +195,8 @@ enum ValueType {
 		} else if (UBuiltins.isinstance(v, Enum)) {
 		} else if (UBuiltins.isinstance(v, Enum)) {
 			return TEnum(Syntax.field(v, "__class__"));
 			return TEnum(Syntax.field(v, "__class__"));
 		} else if (UBuiltins.isinstance(v, UBuiltins.type) || Internal.hasClass(v)) {
 		} else if (UBuiltins.isinstance(v, UBuiltins.type) || Internal.hasClass(v)) {
-			return TClass(Syntax.field(v, "__class__"));
+			var cl = Syntax.field(v, "__class__");
+			return cl == @:privateAccess haxe.Int64.IMPL ? TInt64 : TClass(cl);
 		} else if (UBuiltins.callable(v)) {
 		} else if (UBuiltins.callable(v)) {
 			return TFunction;
 			return TFunction;
 		} else {
 		} else {

+ 1 - 1
tests/RunCi.hx

@@ -37,7 +37,7 @@ class RunCi {
 			infoMsg('test $test');
 			infoMsg('test $test');
 			try {
 			try {
 				changeDirectory(unitDir);
 				changeDirectory(unitDir);
-				haxelibInstallGit("haxe-utest", "utest", "424a7182a93057730fada54b9d27d90b3cb7065c", "--always");
+				haxelibInstallGit("ncannasse", "utest", "dec118f248649b20abb6148d0e9960ef93556fda", "--always");
 
 
 				var args = switch (ci) {
 				var args = switch (ci) {
 					case null:
 					case null:

+ 2 - 2
tests/optimization/src/TestJs.hx

@@ -539,13 +539,13 @@ class TestJs {
 	#if js_enums_as_arrays
 	#if js_enums_as_arrays
 	@:js('
 	@:js('
 		var _g = Type.typeof("");
 		var _g = Type.typeof("");
-		var v = _g[1] == 6 && _g[2] == String;
+		var v = _g[1] == 7 && _g[2] == String;
 		TestJs.use(v);
 		TestJs.use(v);
 	')
 	')
 	#else
 	#else
 	@:js('
 	@:js('
 		var _g = Type.typeof("");
 		var _g = Type.typeof("");
-		var v = _g._hx_index == 6 && _g.c == String;
+		var v = _g._hx_index == 7 && _g.c == String;
 		TestJs.use(v);
 		TestJs.use(v);
 	')
 	')
 	#end
 	#end

+ 1 - 0
tests/unit/compile-flash.hxml

@@ -7,3 +7,4 @@ compile-each.hxml
 -swf bin/unit.swf
 -swf bin/unit.swf
 -swf-lib native_swf/lib.swc
 -swf-lib native_swf/lib.swc
 -D network-sandbox
 -D network-sandbox
+-D flash-test-swc

+ 3 - 1
tests/unit/src/unit/TestReflect.hx

@@ -1,7 +1,7 @@
 package unit;
 package unit;
 
 
-import haxe.ds.List;
 import Type;
 import Type;
+import haxe.ds.List;
 
 
 interface InterfWithProp {
 interface InterfWithProp {
 	public var x(get, set) : Int;
 	public var x(get, set) : Int;
@@ -161,8 +161,10 @@ class TestReflect extends Test {
 		typeof(1,TInt);
 		typeof(1,TInt);
 		typeof(-1,TInt);
 		typeof(-1,TInt);
 		typeof(1.2,TFloat);
 		typeof(1.2,TFloat);
+		#if (!php && !python)
 		typeof(1e10,TFloat);
 		typeof(1e10,TFloat);
 		typeof(-1e10,TFloat);
 		typeof(-1e10,TFloat);
+		#end
 		typeof(Math.NaN,TFloat);
 		typeof(Math.NaN,TFloat);
 		typeof(Math.POSITIVE_INFINITY,TFloat);
 		typeof(Math.POSITIVE_INFINITY,TFloat);
 		typeof(Math.NEGATIVE_INFINITY,TFloat);
 		typeof(Math.NEGATIVE_INFINITY,TFloat);

+ 9 - 1
tests/unit/src/unit/TestSerialize.hx

@@ -31,7 +31,7 @@ class TestSerialize extends Test {
 			"\r\n",
 			"\r\n",
 			"\n",
 			"\n",
 			"   ",
 			"   ",
-			""
+			"",
 		];
 		];
 		for (v in values)
 		for (v in values)
 			eq(id(v), v);
 			eq(id(v), v);
@@ -52,6 +52,14 @@ class TestSerialize extends Test {
 		var d2 = id(d);
 		var d2 = id(d);
 		t((d2 is Date));
 		t((d2 is Date));
 		eq(d2.toString(), d.toString());
 		eq(d2.toString(), d.toString());
+		
+		// int64
+		var small = haxe.Int64.make(0,1);
+		var big1 = haxe.Int64.make(1,-1);
+		var big2 = haxe.Int64.make(-1,0x7FFFFFFF);
+		t(small == id(small));
+		t(big1 == id(big1));
+		t(big2 == id(big2));
 
 
 		// object
 		// object
 		var o = {x: "a", y: -1.56, z: "hello"};
 		var o = {x: "a", y: -1.56, z: "hello"};

+ 1 - 7
tests/unit/src/unit/issues/Issue12264.hx

@@ -1,13 +1,7 @@
 package unit.issues;
 package unit.issues;
 
 
 class Issue12264 extends Test {
 class Issue12264 extends Test {
-	#if !eval
 	function test() {
 	function test() {
-		#if (cpp || jvm || hl)
-		eq(true, Type.typeof(0i64).match(TInt));
-		#else
-		eq(true, Type.typeof(0i64).match(TClass(_)));
-		#end
+		eq(true, Type.typeof(256i64).match(TInt64));
 	}
 	}
-	#end
 }
 }

+ 2 - 2
tests/unit/src/unit/issues/Issue8218.hx

@@ -1,14 +1,14 @@
 package unit.issues;
 package unit.issues;
 
 
 class Issue8218 extends unit.Test {
 class Issue8218 extends unit.Test {
-	#if flash
+	#if flash_test_swc
 	function test() {
 	function test() {
 		new Child(this);
 		new Child(this);
 	}
 	}
 	#end
 	#end
 }
 }
 
 
-#if flash
+#if flash_test_swc
 @:access(unit.Test)
 @:access(unit.Test)
 private class Child extends Lib2 {
 private class Child extends Lib2 {
 	public function new(test:unit.Test) {
 	public function new(test:unit.Test) {

+ 2 - 2
tests/unit/src/unit/issues/Issue8227.hx

@@ -1,7 +1,7 @@
 package unit.issues;
 package unit.issues;
 
 
 class Issue8227 extends unit.Test {
 class Issue8227 extends unit.Test {
-	#if flash
+	#if flash_test_swc
 	function test() {
 	function test() {
 		var ns = new NsCls();
 		var ns = new NsCls();
 		eq(ns.ns1v, 1);
 		eq(ns.ns1v, 1);
@@ -17,7 +17,7 @@ class Issue8227 extends unit.Test {
 	#end
 	#end
 }
 }
 
 
-#if flash
+#if flash_test_swc
 @:access(unit.Test)
 @:access(unit.Test)
 private class Child extends NsCls {
 private class Child extends NsCls {
 	public function new(test:unit.Test) {
 	public function new(test:unit.Test) {

+ 2 - 2
tests/unit/src/unit/issues/Issue8241.hx

@@ -1,6 +1,6 @@
 package unit.issues;
 package unit.issues;
 
 
-#if flash
+#if flash_test_swc
 private class PropClassChild extends PropClass {
 private class PropClassChild extends PropClass {
 	override function get_x():Int {
 	override function get_x():Int {
 		return super.get_x() + 1;
 		return super.get_x() + 1;
@@ -28,7 +28,7 @@ private class HaxePropIfaceImpl extends PropClass implements HaxePropIface {}
 #end
 #end
 
 
 class Issue8241 extends unit.Test {
 class Issue8241 extends unit.Test {
-	#if flash
+	#if flash_test_swc
 	function test() {
 	function test() {
 		var p = new PropClass();
 		var p = new PropClass();
 		eq(42, p.x);
 		eq(42, p.x);

+ 2 - 2
tests/unit/src/unit/issues/Issue8248.hx

@@ -1,6 +1,6 @@
 package unit.issues;
 package unit.issues;
 
 
-#if flash
+#if flash_test_swc
 private class NoProtected {}
 private class NoProtected {}
 
 
 private class Base extends NoProtected {
 private class Base extends NoProtected {
@@ -30,7 +30,7 @@ private class ExternGrandChild extends ExternChild {
 #end
 #end
 
 
 class Issue8248 extends unit.Test {
 class Issue8248 extends unit.Test {
-	#if flash
+	#if flash_test_swc
 	function test() {
 	function test() {
 		eq(new GrandChild().x, 2);
 		eq(new GrandChild().x, 2);
 		eq(new ExternGrandChild().getF(), "bye");
 		eq(new ExternGrandChild().getF(), "bye");

+ 2 - 2
tests/unit/src/unit/issues/Issue9273.hx

@@ -1,13 +1,13 @@
 package unit.issues;
 package unit.issues;
 
 
 class Issue9273 extends unit.Test {
 class Issue9273 extends unit.Test {
-#if flash
+#if flash_test_swc
 	function test() {
 	function test() {
 		eq("hello", new HaxeExtendsSwc().strField);
 		eq("hello", new HaxeExtendsSwc().strField);
 	}
 	}
 #end
 #end
 }
 }
 
 
-#if flash
+#if flash_test_swc
 private class HaxeExtendsSwc extends ParentCtorWithDefaultStringArgument {}
 private class HaxeExtendsSwc extends ParentCtorWithDefaultStringArgument {}
 #end
 #end

+ 13 - 1
tests/unit/src/unitstd/Type.unit.hx

@@ -121,7 +121,18 @@ Type.getEnumConstructs(E) == ["NoArgs", "OneArg", "RecArg", "MultipleArgs"];
 Type.getEnumConstructs(EnumFlagTest) == ["EA", "EB", "EC"];
 Type.getEnumConstructs(EnumFlagTest) == ["EA", "EB", "EC"];
 
 
 // typeof
 // typeof
-// not much to test here?
+Type.typeof(1.5) == TFloat;
+Type.typeof(-45) == TInt;
+#if (!php && !python)
+Type.typeof(1e10) == TFloat;
+#end
+#if !eval
+Type.typeof(1.0) == TInt;
+#end
+var i0 = haxe.Int64.ofInt(256);
+Type.typeof(i0) == TInt64;
+var ibig = haxe.Int64.make(1,0);
+Type.typeof(ibig) == TInt64;
 
 
 // enumEq
 // enumEq
 Type.enumEq(NoArgs, NoArgs) == true;
 Type.enumEq(NoArgs, NoArgs) == true;
@@ -161,3 +172,4 @@ Type.enumIndex(EB) == 1;
 Type.allEnums(E) == [NoArgs];
 Type.allEnums(E) == [NoArgs];
 Type.allEnums(haxe.macro.Expr.ExprDef) == [EBreak, EContinue];
 Type.allEnums(haxe.macro.Expr.ExprDef) == [EBreak, EContinue];
 Type.allEnums(EnumFlagTest) == [EA, EB, EC];
 Type.allEnums(EnumFlagTest) == [EA, EB, EC];
+