2
0
Yuxiao Mao 1 жил өмнө
parent
commit
78a7cedc52

+ 1 - 1
std/haxe/coro/Coroutine.hx

@@ -16,7 +16,7 @@ abstract Coroutine<T:haxe.Constraints.Function> {
 	#end
 	public static extern function suspend<T>(f:(cont:Continuation<T, Null<Dynamic>>)->Void):T;
 
-	#if (jvm || eval)
+	#if (jvm || eval || hl)
 	@:native("suspend")
 	@:keep
 	static function nativeSuspend<T>(f, cont:Continuation<T, Null<Dynamic>>) {

+ 9 - 0
tests/misc/coroutines/src/TestGenerator.hx

@@ -38,8 +38,17 @@ class TestGenerator extends utest.Test {
 	}
 }
 
+#if hl
+// hl has some problem when dealing with recursive anon, use a class to bypass
+@:structInit class Tree<T> {
+	public var leaf:T;
+	@:optional public var left:Tree<T>;
+	@:optional public var right:Tree<T>;
+}
+#else
 private typedef Tree<T> = {
 	var leaf:T;
 	var ?left:Tree<T>;
 	var ?right:Tree<T>;
 }
+#end