Unsupported recursive type when importing hx.concurrent.executor.Executor
When building a haxe project that include the concurrent library against the HashLink target, I get the following error:
/haxe/lib/haxe-concurrent/5,1,3/src/hx/concurrent/Future.hx:13: characters 1-64 : Unsupported recursive type
Steps to reproduce:
Haxe-concurrent 5.1.3 Haxe 4.3.4 OS: Macosx Monterey 12.7.3
program "Main.hx"
package;
import hx.concurrent.executor.Executor;
class Main {
public static function main() {
var executor = Executor.create(3);
executor.submit(()->{trace("hello.");});
}
}
build .hxml:
-cp src
-lib haxe-concurrent
-main Main
--hl bin/main.hl
My expectation is that this is a bug with Haxe itself, however I am not familiar enough with either the library or the HashLink target to know for sure.
That is some kind of bug in the HashLink target and you would need to open a ticket at https://github.com/HaxeFoundation/hashlink/issues
Another project also had an issue with the same compiler error: https://github.com/HaxeFlixel/flixel/issues/3149
I played around with it a bit, if I add a line like var unused:hx.concurrent.Future.FutureCompletionListener<Void> = null; to your example, it compiles.
package;
import hx.concurrent.executor.Executor;
class Main {
public static function main() {
var unused:hx.concurrent.Future.FutureCompletionListener<Void> = null;
var executor = Executor.create(3);
executor.submit(()->{trace("hello.");});
}
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If the issue is still valid, please add a respective comment to prevent this issue from being closed automatically. Thank you for your contributions.