| Issue 124: | inlined empty functions | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Compile the Main class using latest haxe.exe (r3826) and hxcpp from svn. Foo::get is never called, as shown in the trace output. This example works when using haxe 2.07. I've also attached the output generated with haxe 2.07 (Main1.cpp) and the output from haxe nightly (Main2.cpp). //file Main.hx class Main { static function main() { var foo = new Foo(); foo.set(1, 1); var val = foo.get(1); trace(val); //trace output: //Foo.hx:15: set() //Foo.hx:15: set() //Main.hx:9: 0 } } //file Foo.hx class Foo { var _a:Array<Int>; public function new() { _a = new Array(); } inline public function get(i:Int):Int { trace("get()"); emptyFunc(); return _get(i); } inline public function set(i:Int, val:Int):Void { trace("set()"); emptyFunc(); _set(i, val); } inline function emptyFunc():Void { } inline function _get(i:Int):Int { return _a[i]; } inline function _set(i:Int, x:Int):Void { _a[i] = x; } }
Jul 28, 2011
Project Member
#1
gameh...@gmail.com
Status:
Fixed
Jul 29, 2011
still does not work for me - maybe you forgot to commit to svn? thanks,michael
Jul 29, 2011
Haxe svn, that is. I will check again though.
Jul 29, 2011
sorry - my fault! I haven't updated haxe, just hxcpp. |