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 124: inlined empty functions
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Jul 2011


 
Reported by michaelbaczynski@gmail.com, Jun 22, 2011
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;
    }
}
Main.hx
224 bytes   View   Download
Foo.hx
472 bytes   View   Download
Main1.cpp
2.4 KB   View   Download
Main2.cpp
2.7 KB   View   Download
Jul 28, 2011
Project Member #1 gameh...@gmail.com
Should be fixed on SVN now.
Status: Fixed
Jul 29, 2011
#2 michaelbaczynski@gmail.com
still does not work for me - maybe you forgot to commit to svn?
thanks,michael
Jul 29, 2011
Project Member #3 gameh...@gmail.com
Haxe svn, that is.
I will check again though.
Jul 29, 2011
#4 michaelbaczynski@gmail.com
sorry - my fault! I haven't updated haxe, just hxcpp.

Powered by Google Project Hosting