Native: correct ObjCExport test for forward declarations

The test relies on the fact that any name can be imported from a "magic"
package like `objcnames.classes`.
This was the case for K1, but likely won't be for K2: the compiler
should allow importing only those names that are actually
forward-declared in a cinterop library.

This commit changes the test that way. In particular, moves it to a
different task that has a cinterop dependency.
This commit is contained in:
Svyatoslav Scherbina
2023-01-24 09:08:13 +01:00
committed by Space Team
parent 445d44b79a
commit 86a29a7b07
8 changed files with 62 additions and 9 deletions
@@ -0,0 +1,9 @@
import clib.*
import cnames.structs.ForwardDeclaredStruct
import objcnames.classes.ForwardDeclaredClass
import objcnames.protocols.ForwardDeclaredProtocolProtocol
import kotlinx.cinterop.CPointer
fun sameForwardDeclaredStruct(ptr: CPointer<ForwardDeclaredStruct>?): CPointer<ForwardDeclaredStruct>? = sameStruct(ptr)
fun sameForwardDeclaredClass(obj: ForwardDeclaredClass?): ForwardDeclaredClass? = sameClass(obj)
fun sameForwardDeclaredProtocol(obj: ForwardDeclaredProtocolProtocol?): ForwardDeclaredProtocolProtocol? = sameProtocol(obj)