Kite Config Native Opt Ins Extension
Kotlin/Native opt-in markers, inside kiteConfig { optIns { ... } }.
kiteConfig {
optIns {
add("kotlin.experimental.ExperimentalObjCRefinement")
}
}Content copied to clipboard
Obj-C and cinterop calls each want an @OptIn(...) above them. This block sets the markers once at the compiler level, and only on Native compilations, where those markers actually resolve. The annotations leave your call sites and your shared code is never edited.
An empty optIns { } already does useful work. Opening the block turns the feature on, and the built-in set covers the usual interop cases.
What ends up on the compiler command line
| You write | Markers applied |
|---|---|
| no block at all | none, the feature is off |
optIns { } | the built-in interop set |
optIns { add("x") } | the built-in set plus x |
optIns { builtIns = false; add("x") } | only x |
Markers reach Kotlin/Native compilations only, in the shared project or in whatever projects names. They are never written into your source.
See also
for the project used when projects is empty.