[K/N] Make cast to objc forward declaration unchecked
Before this commit it caused compiler crash. Unchecked cast warning to be done later. ^KT-59645
This commit is contained in:
committed by
Space Team
parent
1fdda8962d
commit
396cfb3956
@@ -0,0 +1,18 @@
|
||||
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
|
||||
import cnames.structs.ForwardDeclaredStruct
|
||||
import objcnames.classes.ForwardDeclaredClass
|
||||
import objcnames.protocols.ForwardDeclaredProtocolProtocol
|
||||
import a.*
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
fun testStruct(s: Any?) = consumeStruct(s as CPointer<ForwardDeclaredStruct>)
|
||||
fun testClass(s: Any?) = consumeClass(s as ForwardDeclaredClass)
|
||||
fun testProtocol(s: Any?) = consumeProtocol(s as ForwardDeclaredProtocolProtocol)
|
||||
|
||||
|
||||
fun <T : ForwardDeclaredClass> testClass2Impl(s: Any?) = consumeClass(s as T)
|
||||
fun <T : ForwardDeclaredProtocolProtocol> testProtocol2Impl(s: Any?) = consumeProtocol(s as T)
|
||||
|
||||
fun testClass2(s: Any?) = testClass2Impl<ForwardDeclaredClass>(s)
|
||||
fun testProtocol2(s: Any?) = testProtocol2Impl<ForwardDeclaredProtocolProtocol>(s)
|
||||
Reference in New Issue
Block a user