Why this piece of code has error in idea editor?

39 views
Skip to first unread message

Freewind

unread,
Jan 15, 2013, 9:32:14 AM1/15/13
to haxe...@googlegroups.com
Hi, all:

I copied a piece of haxe code from 杨博's thread about his continuation library into my idea editor:

import com.dongxiguo.continuation.Continuation;
class Sample {
    static var sleepOneSecond = callback(haxe.Timer.delay, _, 1000);

    public static function main() {
        Continuation.cpsFunction(function asyncTest():Void
        {
            trace("Start continuation.");
            for (i in 0...10)
            {
                async(sleepOneSecond);
                trace("Run sleepOneSecond " + i + " times.");
            }
            trace("Continuation is done.");
        });
        asyncTest(function()
        {
            trace("Handler without continuation.");
        });
    }
}

But the editor reports error on "function asyncTest()": 'function' unexpected.

I just checked the document of continuation project, it says it requires "haxe 2.10", and my haxe is "2.10". 

I'm using intellij-idea with haxe plugin 0.5.6(latest). Doesn't it support haxe 2.10 or do I miss something?

 

Chris D

unread,
Jan 16, 2013, 3:02:28 AM1/16/13
to haxe...@googlegroups.com
Hello Freewind, Idea's haxe plugin is still in development and it doesn't look like it supports a function name in a parameter like you have with asyncTest. 

Please make noise there about haxe specific issues on their youtrack and vote for others its how they organise their work. Last year they fixed a bunch of critical issues but there is still heaps todo.

They have marked a lot of other issues as "In progress" recently in the public issue tracker, with each release it gets better.
Reply all
Reply to author
Forward
0 new messages