[K/N] Add ObjCName annotation (#4815)

This commit is contained in:
Rick Clephas
2022-07-23 18:58:06 +02:00
committed by GitHub
parent edf9e05b13
commit 5a5e6ad8cd
22 changed files with 1372 additions and 78 deletions
@@ -5,6 +5,7 @@
package kotlin.native
import kotlin.experimental.ExperimentalObjCName
import kotlin.reflect.KClass
/**
@@ -83,3 +84,19 @@ public annotation class EagerInitialization
@Target(AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.BINARY)
public actual annotation class CName(actual val externName: String = "", actual val shortName: String = "")
/**
* Instructs the Kotlin compiler to use a custom Objective-C and/or Swift name for this class, property, parameter or function.
* @param exact specifies if the name of a class should be interpreted as the exact name.
* E.g. the compiler won't add a top level prefix or the outer class names to exact names.
*/
@Target(
AnnotationTarget.CLASS,
AnnotationTarget.PROPERTY,
AnnotationTarget.VALUE_PARAMETER,
AnnotationTarget.FUNCTION
)
@Retention(AnnotationRetention.BINARY)
@MustBeDocumented
@ExperimentalObjCName
public actual annotation class ObjCName(actual val name: String = "", actual val swiftName: String = "", actual val exact: Boolean = false)