Open lenguyenthanh opened 9 months ago
This issue was picked for the Scala Issue Spree of tomorrow, April 9th. @hamzaremmal, @Sporarum, @jan-pieter will be working on it. If you have any insight into the issue or guidance on how to fix it, please leave it here.
It looks very similar to #20114
java.lang.BootstrapMethodError: bootstrap method initialization exception at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:188) at
Seems like the compiler insert a Nothing type, because Nothing is a sub type of Future, the listener needs a ? extends Future<?> as input, so scala compiler inser a Nothing?
For the lambda we need insert a Future<?> instead.
I still remember when using scala 2.12.x with completionStage, I have to use stage.[Unit]handle(...) for the compiler to work properly.
Compiler version
3.3.1
Minimized code
Full context here in
lila-ws
repository: https://github.com/lichess-org/lila-ws/pull/525/commits/7f47bc39a8b36a0f076b24dd75da17150502040eThis code below crash the runtime:
The fix is annotating the lambda with type:
Stacktrace:
Expectation
Either compile error or We shouldn't need to annotate the type.