Browse Source

[tests] add test for hashlink 775 (#12178)

Yuxiao Mao 4 months ago
parent
commit
a236799997
1 changed files with 21 additions and 0 deletions
  1. 21 0
      tests/unit/src/unit/issues/Issue12178.hx

+ 21 - 0
tests/unit/src/unit/issues/Issue12178.hx

@@ -0,0 +1,21 @@
+package unit.issues;
+
+@:struct private class Point {
+	public var x : Int;
+	public function new( x : Int ) { this.x = x; }
+	public function toString() : String { return 'Point(x=$x)'; }
+}
+
+class Issue12178 extends Test {
+	var count : Int = 10;
+	#if hl
+	function test() {
+		var nativeArr = new hl.NativeArray<Point>(count);
+		for( i in 0...count ) {
+			nativeArr[i] = new Point(20+i);
+		}
+		Std.string(nativeArr);
+		noAssert();
+	}
+	#end
+}