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 27: Wrong function generation order on chained function call.
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Aug 2010


 
Reported by Andy.onthewings, Jun 13, 2010
Please refer to http://gist.github.com/436483

"Main.cpp" is compiled from "Main.hx".

The program should trace out "f1, f2". But it traces out "f2, f1".
"Main.cpp" is generated wrong.
Aug 4, 2010
Project Member #1 gameh...@gmail.com
Unfortunately, I can't think of how to fix this without making the generated code not look a complete mess, and possibly losing quite a bit of performance.
The problem is that c++ (unlike almost ever other language) does not define the order these operations should be done in, so it's up to the compiler.


http://haxe.org/com/quirks?lang=en
Status: WontFix
Aug 4, 2010
#2 Andy.onthewings
I've checked the following code will produce correct output, so isn't it can be fixed by letting the compiler generates code as if it is written that way?

http://gist.github.com/436483#gistcomment-6940
Aug 4, 2010
#3 heinz.ho...@googlemail.com
I don't think that the order is the problem, the anonymous functions are falsely referenced.

Have a look at this: https://gist.github.com/040e8ada9b5455d9a224

Aug 9, 2010
Project Member #4 gameh...@gmail.com
Yes - sorry, I see the problem - a genuine bug as you say.  I have fixed it be reordering a piece of code.  It looks better now - I just can't figure out why I did it the other way in the first place.
The reordering I originally thought it was is a separate problem, more for f(i++,i++) ordering.
Status: Fixed
Aug 9, 2010
#5 heinz.ho...@googlemail.com
I can confirm that it works now as expected, thx for your amazing effort!

Powered by Google Project Hosting