Explorar el Código

check for Null<UInt> null check and toString()

ncannasse hace 7 años
padre
commit
8673e69a65
Se han modificado 1 ficheros con 17 adiciones y 0 borrados
  1. 17 0
      tests/unit/src/unit/issues/Issue6760.hx

+ 17 - 0
tests/unit/src/unit/issues/Issue6760.hx

@@ -0,0 +1,17 @@
+package unit.issues;
+
+class Issue6760 extends Test {
+
+	function foo( x : UInt, ?opt : UInt ) : UInt {
+		return opt == null ? x : opt;
+	}
+
+	function toString( ?v : UInt ) {
+		return ""+v;
+	}
+
+	function test() {
+		eq(foo(10), 10);
+		eq(toString(), "null");
+	}
+}