// Scala singletons have slightly different JI logic, so skip for now
if (method instanceof SingletonMethodInvoker) return null;
// the "apparent" type from the NativeCall, excluding receiver
MethodType apparentType = methodType(nativeCall.getNativeReturn(), nativeCall.getNativeSignature());
if (isStatic) {
nativeTarget = findStatic(nativeCall.getNativeTarget(), nativeCall.getNativeName(), apparentType);
} else {
nativeTarget = findVirtual(nativeCall.getNativeTarget(), nativeCall.getNativeName(), apparentType);
}
// the actual native type with receiver
MethodType nativeType = nativeTarget.type();
Class[] nativeParams = nativeType.parameterArray();
Class nativeReturn = nativeType.returnType();
// convert arguments
MethodHandle[] argConverters = new MethodHandle[nativeType.parameterCount()];
for (int i = 0; i < argConverters.length; i++) {
MethodHandle converter;
if (!isStatic && i == 0) {
// handle non-static receiver specially
converter = Binder