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 257: Parameters evaluation order
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


 
Reported by thomas.p...@gmail.com, Oct 2, 2013
There is a major issue with evaluation order of parameters in hxcpp.

I'm providing complete example to reproduce and illustrate the issue hopefully.



package ;
import flash.geom.Rectangle;
class Main extends flash.display.Sprite
{
    public static function main()
    {
        inline function inlineDebug(a:Int, b:Int, c:Int, d:Int) {
            trace(""+a+"."+b+"."+c+"."+d);
        }

        function localDebug(a:Int, b:Int, c:Int, d:Int) {
            trace(""+a+"."+b+"."+c+"."+d);
        }
        var coord : Array<Int> = [1, 2, 3, 4, 5, 6, 7, 8];

        var ptr: Int = 0;
        localDebug (coord[ptr++], coord[ptr++], coord[ptr++], coord[ptr++]);            // out 4 3 2 1

        var ptr: Int = 0;
        inlineDebug (coord[ptr++],coord[ptr++],coord[ptr++],coord[ptr++]);  // out 1 2 3 4

        var ptr: Int = 0;
        staticDebug (coord[ptr++],coord[ptr++],coord[ptr++],coord[ptr++]);  // out 1 1 1 1

        var ptr: Int = 0;
        trace( new Rectangle(coord[ptr++], coord[ptr++], coord[ptr++], coord[ptr++]) );    // out 4 3 2 1

        var ptr: Int = 0;
        trace( new Rectangle(coord[ptr++], coord[ptr++], coord[ptr++], coord[ptr]) );    // out 3 2 1 1
    }

    //same thing with instance method
    static function staticDebug(a:Int, b:Int, c:Int, d:Int) {
        trace(""+a+"."+b+"."+c+"."+d);
    }
} 


Oct 2, 2013
#1 thomas.p...@gmail.com
After a discussion with Nicolas Cannasse, and it seems to be more an Haxe related issue than HXCPP one.
So I move that feedback for haxe github.

Powered by Google Project Hosting