This works in --interp and -neko but failes on -hl. There's no problem if the promises have the same type parameters, or if they're typed as Futures even with different type parameters.
var a :Promise<Int> = Future.sync(2);
a.handle( ii -> trace('a ${ii.sure()}') );
var b :Promise<String> = Future.sync("two");
b.handle( ii -> trace('b ${ii.sure()}') ); // <-- line 10
the error is
TinkFuturePromise.hx:7: a 2
Uncaught exception: Can't cast String to i32
Called from tink.core._Promise.$Promise_Impl_.~ofFuture.0(tink/core/Outcome.hx:13)
Called from tink.core._Future.$Future_Impl_.~map.1(tink/core/Future.hx:97)
Called from tink.core._Lazy.LazyFunc.compute(tink/core/Lazy.hx:106)
Called from tink.core._Lazy.$Lazy_Impl_.get(tink/core/Lazy.hx:13)
Called from tink.core._Future.SyncFuture.handle(tink/core/Future.hx:432)
Called from $TinkFuturePromise.main(TinkFuturePromise.hx:10)
Called from .init(?:1)
This works in
--interp
and-neko
but failes on-hl
. There's no problem if the promises have the same type parameters, or if they're typed as Futures even with different type parameters.the error is