瀏覽代碼

[tests] add tests for #10274

Rudy Ges 2 年之前
父節點
當前提交
e3ea6071f5

+ 11 - 0
tests/misc/php/projects/Issue10274/Test.hx

@@ -0,0 +1,11 @@
+@:nullSafety
+class Test {
+	public static function toArray<T>(item:Null<T>, times:Int):Array<Null<T>> {
+		final arr:Array<Null<T>> = [];
+		for (i in 0...times)
+			arr.push(item);
+		return arr;
+	}
+
+	static function main() {}
+}

+ 3 - 0
tests/misc/php/projects/Issue10274/compile.hxml

@@ -0,0 +1,3 @@
+-php bin/main.php
+--no-output
+--main Test

+ 11 - 0
tests/misc/python/projects/Issue10274/Test.hx

@@ -0,0 +1,11 @@
+@:nullSafety
+class Test {
+	public static function toArray<T>(item:Null<T>, times:Int):Array<Null<T>> {
+		final arr:Array<Null<T>> = [];
+		for (i in 0...times)
+			arr.push(item);
+		return arr;
+	}
+
+	static function main() {}
+}

+ 3 - 0
tests/misc/python/projects/Issue10274/compile.hxml

@@ -0,0 +1,3 @@
+-python bin/main.py
+--no-output
+--main Test