| Issue 241: | inline issue | |
| 1 person starred this issue and may be notified of changes. | Back to list |
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.
May 17, 2013
#1
thomas.p...@gmail.com
May 18, 2013
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
May 18, 2013
Move to https://code.google.com/p/haxe/issues/detail?id=1827 |