@@ -179,7 +179,7 @@ abstract Vector<T>(VectorData<T>) {
/**
Creates a new Array, copy the content from the Vector to it, and returns it.
**/
- public #if (flash || cpp || js) inline #end function toArray():Array<T> {
+ public #if (flash || cpp || js || java) inline #end function toArray():Array<T> {
#if cpp
return this.copy();
#elseif python
@@ -0,0 +1,13 @@
+package unit.issues;
+
+class Issue4979 extends Test {
+ function test() {
+ var vec = new haxe.ds.Vector<Int>(10);
+ var arr = run(vec.toArray());
+ eq(arr.length, 10);
+ }
+ static public function run(items:Array<Int>) {
+ return items;
+}