My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 72: array is empty after assigment
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Jan 2011


 
Reported by michaelbaczynski@gmail.com, Oct 15, 2010
compile source code below, using latest haXe+hxcpp from svn.

class Main 
{
	static var _app:Main;
	public static function main():Void
	{
		var a = new Array<Int>();
		
		assign(a, 1, 100);
		
		trace(a.length); //array is empty, but length should be 100
	}
	
	public static function assign<T>(a:Array<T>, val:T, k:Int):Void
	{
		for (i in 0...k) a[i] = val;
	}
}
Oct 15, 2010
#1 Andy.onthewings
This is a known target quirk: http://haxe.org/com/quirks
You can workaround it by making the method inline.
Jan 17, 2011
Project Member #2 gameh...@gmail.com
This particular problem has been fixed on SVN by making the assignment operator use the dynamic interface.
Status: Fixed

Powered by Google Project Hosting