From 62f688db2c34bb6ca9ea535fe4eb15984aba67fc Mon Sep 17 00:00:00 2001 From: sebthom Date: Sun, 7 May 2023 16:56:59 +0200 Subject: [PATCH] fix ClassCastException on Haxe 4.3 JVM target --- src/hx/concurrent/executor/Executor.hx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hx/concurrent/executor/Executor.hx b/src/hx/concurrent/executor/Executor.hx index 6365ed7..fabd540 100644 --- a/src/hx/concurrent/executor/Executor.hx +++ b/src/hx/concurrent/executor/Executor.hx @@ -90,6 +90,12 @@ abstract class Executor extends ServiceBase { typedef Task = Either2T, Void->Void>; +/* TODO For some reason adding @:keep here prevents the following exception on JVM target with full DCE enabled: + * Exception in thread "main" java.lang.ClassCastException: + * class hx.concurrent.thread.ThreadPool$Closure_onStart_0 cannot be cast to class java.lang.Runnable + * (hx.concurrent.thread.ThreadPool$Closure_onStart_0 is in unnamed module of loader 'app'; java.lang.Runnable is in module java.base of loader 'bootstrap') + */ +#if (haxe_ver >= 4.3 && jvm) @:keep #end interface TaskFuture extends Future { /**