Add .reinterpret<T>() as a workaround for missing Objective-C casts

This commit is contained in:
Svyatoslav Scherbina
2017-10-03 12:10:40 +03:00
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>()