Skip to content
This repository was archived by the owner on Nov 14, 2025. It is now read-only.

Commit dbd85d7

Browse files
authored
Update example
I thought coroutines returned functions for some reason when I made this.
1 parent 791d4db commit dbd85d7

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Example.hx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import sf.library.Coroutine;
22
import sf.library.Builtins.Angle;
33
import sf.type.Angle;
4+
import sf.type.Coroutine;
45

56
class Main {
67
static function main(){
7-
var co: (Int)->Int = Coroutine.create((a:Int) -> {
8+
var co: Coroutine = Coroutine.create((a:Int) -> {
89
trace('Thanks for the number, $a');
910
Coroutine.yield(420);
1011
var ang: Angle = Angle(1, 2, 3); // Haxe is smart enough to distinguish whether to use 'Angle' the function, or 'Angle' the type.
@@ -16,4 +17,4 @@ class Main {
1617
var first_num = Coroutine.resume(co, 58);
1718
trace(first_num); // Should print 420
1819
}
19-
}
20+
}

0 commit comments

Comments
 (0)