diff --git a/tests/unit/src/unit/UnitBuilder.hx b/tests/unit/src/unit/UnitBuilder.hx index 43c6e396c75..8a7ac737819 100644 --- a/tests/unit/src/unit/UnitBuilder.hx +++ b/tests/unit/src/unit/UnitBuilder.hx @@ -174,7 +174,7 @@ class UnitBuilder { case EBinop(OpEq, e1, e2): mkEq(e1, e2, e.pos); case EBinop(OpNotEq, e1, e2): - macro t($e1 != $e2); + macro @:pos(e.pos) t($e1 != $e2); case EBinop(OpGt | OpGte | OpLt | OpLte, _, _): { expr: (macro t($e)).expr, diff --git a/tests/unit/src/unit/issues/Issue11734.hx b/tests/unit/src/unit/issues/Issue11734.hx index 467253c8a90..13911d07ad7 100644 --- a/tests/unit/src/unit/issues/Issue11734.hx +++ b/tests/unit/src/unit/issues/Issue11734.hx @@ -5,6 +5,22 @@ import unit.Test; import hl.NativeArray; #end +private class Group { + public var grid : haxe.ds.Vector>; + public function new(size:Int) { + grid = new haxe.ds.Vector(size); + for (i in 0...size) + grid[i] = []; + } +} + +private class Foo { + public var x : Int; + public function new(x:Int) { + this.x = x; + } +} + class Issue11734 extends Test { #if hl function test() { @@ -16,4 +32,18 @@ class Issue11734 extends Test { feq(1.0, a[0]); } #end + + function testArrayInVector() { + var g = new Group(5); + for (i in 0...5) + g.grid[i].push(new Foo(10+i)); + eq(10, g.grid[0][0].x); + eq(14, g.grid[4][0].x); + + var g = new Group(5); + for (i in 0...5) + g.grid[i].push(10.0+i); + feq(10.0, g.grid[0][0]); + feq(14.0, g.grid[4][0]); + } }