Closed plokhotnyuk closed 3 years ago
I tried looking at the caller: https://github.com/scala/scala/blob/2.13.x/src/library/scala/runtime/Statics.java
And the target: https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/invoke/MethodHandle.html#invoke(java.lang.Object...)
The caller is doing:
VM.RELEASE_FENCE.invoke();
which should be compiled to the vararg method.
Running javap on the Statics class gives:
public static void releaseFence() throws java.lang.Throwable;
Code:
0: getstatic #25 // Field scala/runtime/Statics$VM.RELEASE_FENCE:Ljava/lang/invoke/MethodHandle;
3: invokevirtual #26 // Method java/lang/invoke/MethodHandle.invoke:()V
6: return
So yes, this seems like a bug. I think the correct fix is that vararg methods should match calls that look like either:
java.lang.invoke.MethodHandle.invoke(Object[] args)
java.lang.invoke.MethodHandle.invoke()
Got the following error when checking using the sbt-missinglink plugin: