diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f066f23..fa3cdff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v4 - uses: krdlab/setup-haxe@v2 with: - haxe-version: "2025-09-17_kt_coro_803640c" + haxe-version: "2025-10-21_kt_coro_9281286" - uses: cedx/setup-hashlink@v6 if: matrix.target == 'hl' && matrix.os == 'windows-latest' diff --git a/src/hxcoro/Coro.hx b/src/hxcoro/Coro.hx index 10b4181..b3df7b6 100644 --- a/src/hxcoro/Coro.hx +++ b/src/hxcoro/Coro.hx @@ -5,7 +5,6 @@ import haxe.coro.IContinuation; import haxe.coro.ICancellableContinuation; import haxe.coro.schedulers.Scheduler; import haxe.coro.cancellation.CancellationToken; -import haxe.exceptions.CancellationException; import haxe.exceptions.ArgumentException; import hxcoro.task.NodeLambda; import hxcoro.task.CoroTask; @@ -14,7 +13,7 @@ import hxcoro.continuations.TimeoutContinuation; class Coro { @:coroutine @:coroutine.transformed - public static function suspend(func:IContinuation->Void, completion:IContinuation):T { + public static function suspend(completion:IContinuation, func:IContinuation->Void):T { var safe = new hxcoro.continuations.RacingContinuation(completion); func(safe); safe.resolve(); @@ -26,7 +25,7 @@ class Coro { * The `ICancellableContinuation` passed to the function allows registering a callback which is invoked on cancellation * allowing the easy cleanup of resources. */ - @:coroutine @:coroutine.transformed public static function suspendCancellable(func:ICancellableContinuation->Void, completion:IContinuation):T { + @:coroutine @:coroutine.transformed public static function suspendCancellable(completion:IContinuation, func:ICancellableContinuation->Void):T { var safe = new CancellingContinuation(completion); func(safe); return cast safe; diff --git a/tests/src/TestGenerator.hx b/tests/src/TestGenerator.hx index b7c1ef1..1e0bdb8 100644 --- a/tests/src/TestGenerator.hx +++ b/tests/src/TestGenerator.hx @@ -30,7 +30,7 @@ private function sequence(f:Coroutine->Void>):Iterator { } nextStep = () -> { - f(yield, scope); + f(scope, yield); scope.start(); }