Add .reinterpret<T>() as a workaround for missing Objective-C casts
This commit is contained in:
committed by
SvyatoslavScherbina
parent
c6ee45a1d2
commit
06e561af34
@@ -25,6 +25,9 @@ inline fun <R> autoreleasepool(block: () -> R): R {
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: implement a checked cast instead.
|
||||
fun <T : ObjCObject> ObjCObject.reinterpret() = this.uncheckedCast<T>()
|
||||
|
||||
// TODO: null checks
|
||||
var <T : ObjCObject?> ObjCObjectVar<T>.value: T
|
||||
get() = interpretObjCPointerOrNull<T>(nativeMemUtils.getNativePtr(this)).uncheckedCast<T>()
|
||||
|
||||
Reference in New Issue
Block a user