Explorar o código

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

ncannasse %!s(int64=7) %!d(string=hai) anos
pai
achega
8673e69a65
Modificáronse 1 ficheiros con 17 adicións e 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");
+	}
+}