2
0
Simon Krajewski 5 сар өмнө
parent
commit
9537ebd2cd

+ 3 - 2
std/haxe/Unit.hx

@@ -25,5 +25,6 @@ package haxe;
 /**
 	A unit type which can only be `null` at run-time.
 **/
-@:nullable
-enum Unit {}
+enum Unit {
+	Unit;
+}

+ 5 - 5
tests/unit/src/unitstd/haxe/Unit.unit.hx

@@ -1,9 +1,9 @@
-var u:haxe.Unit = null;
+var u:haxe.Unit = Unit;
 Reflect.isObject(u) == false;
-Reflect.isEnumValue(u) == false;
+Reflect.isEnumValue(u) == true;
 Reflect.isFunction(u) == false;
-Reflect.compare(u, null) == 0;
-Reflect.compare(null, u) == 0;
+Reflect.compare(u, haxe.Unit.Unit.Unit) == 0;
+Reflect.compare(haxe.Unit.Unit.Unit, u) == 0;
 Reflect.compare(u, u) == 0;
 Type.getClass(u) == null;
-Type.getEnum(u) == null;
+Type.getEnum(u) == haxe.Unit;