Native: improve message when Obj-C block can't be converted to Any
This commit is contained in:
committed by
Space
parent
baa287d6ee
commit
925e7801aa
@@ -494,14 +494,14 @@ static OBJ_GETTER(blockToKotlinImp, id block, SEL cmd) {
|
|||||||
const char* argEncoding = [signature getArgumentTypeAtIndex:i];
|
const char* argEncoding = [signature getArgumentTypeAtIndex:i];
|
||||||
if (argEncoding[0] != '@') {
|
if (argEncoding[0] != '@') {
|
||||||
[NSException raise:NSGenericException
|
[NSException raise:NSGenericException
|
||||||
format:@"Blocks with non-reference-typed arguments aren't supported (%s)", argEncoding];
|
format:@"Converting Obj-C blocks with non-reference-typed arguments to kotlin.Any is not supported (%s)", argEncoding];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* returnTypeEncoding = signature.methodReturnType;
|
const char* returnTypeEncoding = signature.methodReturnType;
|
||||||
if (returnTypeEncoding[0] != '@') {
|
if (returnTypeEncoding[0] != '@') {
|
||||||
[NSException raise:NSGenericException
|
[NSException raise:NSGenericException
|
||||||
format:@"Blocks with non-reference-typed return value aren't supported (%s)", returnTypeEncoding];
|
format:@"Converting Obj-C blocks with non-reference-typed return value to kotlin.Any is not supported (%s)", returnTypeEncoding];
|
||||||
}
|
}
|
||||||
|
|
||||||
auto converter = parameterCount < Kotlin_ObjCExport_blockToFunctionConverters_size
|
auto converter = parameterCount < Kotlin_ObjCExport_blockToFunctionConverters_size
|
||||||
|
|||||||
Reference in New Issue
Block a user