Native: add KotlinThrowable.asError() to the generated Obj-C framework
This method can be useful when overriding a throwing Kotlin method in Swift or Obj-C. In this case, a user can call asError to wrap Kotlin exception to (NS)Error and then throw it to Kotlin, which will unwrap it back. ^KT-45127 Fixed
This commit is contained in:
committed by
Space
parent
c988ecf59b
commit
d531df1643
@@ -961,6 +961,10 @@ public abstract class KotlinBuiltIns {
|
||||
return isConstructedFromGivenClass(type, FqNames.throwable);
|
||||
}
|
||||
|
||||
public static boolean isThrowable(@NotNull ClassDescriptor descriptor) {
|
||||
return classFqNameEquals(descriptor, FqNames.throwable.toUnsafe());
|
||||
}
|
||||
|
||||
public static boolean isKClass(@NotNull ClassDescriptor descriptor) {
|
||||
return classFqNameEquals(descriptor, FqNames.kClass);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user