Skip to content

Commit

Permalink
fix ClassCastException on Haxe 4.3 JVM target
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed May 7, 2023
1 parent 0b4861a commit 62f688d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/hx/concurrent/executor/Executor.hx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ abstract class Executor extends ServiceBase {
typedef Task<T> = Either2<Void->T, 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<T> extends Future<T> {

/**
Expand Down

0 comments on commit 62f688d

Please sign in to comment.