| Issue 117: | inline array/object reference is wrong | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Tested with haxe r3801, hxcpp r319, on Mac 10.6.7. The last trace of the below program is wrong. The bug disappear if removeItems is not inline. using Lambda; class Test { inline public static function removeItems<T>(tarArray:Array<T>, items:Array<T>):Bool { var removed:Bool = false; var l:Int = tarArray.length; while (l-- > 0) { if (items.indexOf(tarArray[l]) > -1) { tarArray.splice(l, 1); removed = true; } } return true; } static function main():Void { var array = [1,2,3,4,5,5,7,5,9,0,11,12,13]; removeItems(array, [1,11]); trace(array.length); //11 is correct var ta = [{name: "Aaron", sex: "Male", hair: "Brown"}, {name: "Linda", sex: "Female", hair: "Blonde"}, {name: "Katie", sex: "Female", hair: "Brown"}, {name: "Nikki", sex: "Female", hair: "Blonde"}]; trace({sex: "Female"}); //wrong: { hair => Blonde, name => Nikki, sex => Female } } }
May 12, 2011
#1
Andy.onthewings
Aug 10, 2011
This may be fixed by another change I've made - please check.
Status:
Fixed
Aug 10, 2011
Yes, it is fixed now. Thanks! |