default:
throw runtime.newTypeError("invalid callback parameter type " + type);
}
} else if (type instanceof CallbackInfo) {
final CallbackInfo cbInfo = (CallbackInfo) type;
final long address = buffer.getAddress(index);
return address != 0
? new Function(runtime, cbInfo.getMetaClass(),
new CodeMemoryIO(runtime, address),
cbInfo.getReturnType(), cbInfo.getParameterTypes(),
cbInfo.isStdcall() ? CallingConvention.STDCALL : CallingConvention.DEFAULT, runtime.getNil())
: runtime.getNil();
} else if (type instanceof StructByValue) {
StructByValue sbv = (StructByValue) type;