Issue 241: inline issue
Status:  WontFix
Owner: ----
Closed:  May 2013
Reported by thomas.p...@gmail.com, May 17, 2013
What steps will reproduce the problem?
function prependMatrix(base:Matrix, prep:Matrix):Matrix
{
	setTo(	base, 
			base.a * prep.a + base.c * prep.b,
			base.b * prep.a + base.d * prep.b,
			base.a * prep.c + base.c * prep.d,
			base.b * prep.c + base.d * prep.d,
			base.tx + base.a * prep.tx + base.c * prep.ty,
			base.ty + base.b * prep.tx + base.d * prep.ty);
	return base;
}

inline function setTo(m:Matrix, a:Float, b:Float, c:Float, d:Float, tx:Float, ty:Float )
{
	m.a = a;
	m.b = b;
	m.c = c;
	m.d = d;
	m.tx = tx;
	m.ty = ty;
}

What is the expected output? What do you see instead?
inside prependMatrix, the all to setTo should inline variables (setTo parameters) like this :
{ 
    var setTo_a:Float = base.a * prep.a + base.c * prep.b;
    ...
    ....
    base.a = setTo_a;
}

Current version is a bit brutal copy/paste behaviour.

What version of the product are you using? On what operating system?

HXCPP 3.0

Please provide any additional information below.

Main.hx
2.9 KB   View   Download
May 17, 2013
#1 thomas.p...@gmail.com
Sorry, that was with :  hxcpp  2.10.3 version
I upgraded to 3.0.1 and the output is different, but still not what I expected.

So the bug I encounter remains.


For information, on haxe flash target, the code is working as expected with inlining.
May 18, 2013
Project Member #2 gameh...@gmail.com
I am getting identical problems in flash with inlining.  Here is a simplified version, depending whether 'set' is inlined:

class Test
{
   var a:Int;
   var b:Int;

   function new() { a=1; b=2; }

   inline function set(inA:Int, inB:Int)
   {
      a = inA;
      b = inB;
   }

   public static function main()
   {
      var t = new Test();
      t.set(t.b,t.a);
      trace(t.a +"," +t.b);
   }

}

I am moving this to the haxe compiler issues.
Status: WontFix