From bd614aba0bdabd7a70071622aad45f313213bd57 Mon Sep 17 00:00:00 2001 From: Florian Kistner Date: Wed, 3 Mar 2021 20:38:57 +0100 Subject: [PATCH] Retain typed generics in ObjC export stubs (#4727) * Add ObjC export test with disabled generics * Retain typed generics in ObjC export stubs * Introduce ObjC variance enum to decouple stubs from Kotlin variance (cherry picked from commit 4d7c78b952a467ca3318c8c49d36b768fdc1ef9c) --- .../objcexport/ObjCExportHeaderGenerator.kt | 118 +- .../konan/objcexport/ObjCExportLazy.kt | 15 +- .../konan/objcexport/ObjCExportedStubs.kt | 2 +- .../backend/konan/objcexport/StubRenderer.kt | 4 +- .../backend/konan/objcexport/objcTypes.kt | 68 +- .../kotlin/backend/konan/objcexport/stubs.kt | 9 +- .../backend.native/tests/build.gradle | 53 + .../tests/objcexport/coroutines.swift | 16 +- .../tests/objcexport/deallocRetain.swift | 6 +- .../tests/objcexport/enumValues.swift | 20 +- .../tests/objcexport/expectedLazy.h | 39 + .../tests/objcexport/expectedLazyNoGenerics.h | 2268 +++++++++++++++++ .../tests/objcexport/headerWarnings.swift | 4 + .../tests/objcexport/values.swift | 24 + .../tests/objcexport/variance.kt | 15 + .../tests/objcexport/variance.swift | 31 + .../org/jetbrains/kotlin/FrameworkTest.kt | 5 +- 17 files changed, 2604 insertions(+), 93 deletions(-) create mode 100644 kotlin-native/backend.native/tests/objcexport/expectedLazyNoGenerics.h create mode 100644 kotlin-native/backend.native/tests/objcexport/variance.kt create mode 100644 kotlin-native/backend.native/tests/objcexport/variance.swift diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportHeaderGenerator.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportHeaderGenerator.kt index 0a6d3cd354f..e5a1625aba0 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportHeaderGenerator.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportHeaderGenerator.kt @@ -21,7 +21,6 @@ import org.jetbrains.kotlin.resolve.scopes.MemberScope import org.jetbrains.kotlin.types.ErrorUtils import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.TypeUtils -import org.jetbrains.kotlin.types.Variance import org.jetbrains.kotlin.types.typeUtil.builtIns import org.jetbrains.kotlin.types.typeUtil.isInterface import org.jetbrains.kotlin.types.typeUtil.isTypeParameter @@ -79,19 +78,23 @@ internal class ObjCExportTranslatorImpl( // TODO: only if appears add { + val generics = listOf("ObjectType") objCInterface( namer.mutableSetName, - generics = listOf("ObjectType"), - superClass = "NSMutableSet" + generics = generics, + superClass = "NSMutableSet", + superClassGenerics = generics ) } // TODO: only if appears add { + val generics = listOf("KeyType", "ObjectType") objCInterface( namer.mutableMapName, - generics = listOf("KeyType", "ObjectType"), - superClass = "NSMutableDictionary" + generics = generics, + superClass = "NSMutableDictionary", + superClassGenerics = generics ) } @@ -192,23 +195,14 @@ internal class ObjCExportTranslatorImpl( } private fun referenceClass(descriptor: ClassDescriptor): ObjCExportNamer.ClassOrProtocolName { - fun forwardDeclarationObjcClassName(objcGenerics: Boolean, descriptor: ClassDescriptor, namer:ObjCExportNamer): String { - val className = translateClassOrInterfaceName(descriptor) - val builder = StringBuilder(className.objCName) - if (objcGenerics) - formatGenerics(builder, descriptor.typeConstructor.parameters.map { typeParameterDescriptor -> - "${typeParameterDescriptor.variance.objcDeclaration()}${namer.getTypeParameterName(typeParameterDescriptor)}" - }) - return builder.toString() - } - assert(mapper.shouldBeExposed(descriptor)) { "Shouldn't be exposed: $descriptor" } assert(!descriptor.isInterface) generator?.requireClassOrInterface(descriptor) - return translateClassOrInterfaceName(descriptor).also { - val objcName = forwardDeclarationObjcClassName(objcGenerics, descriptor, namer) - generator?.referenceClass(objcName) + return translateClassOrInterfaceName(descriptor).also { className -> + val generics = mapTypeConstructorParameters(descriptor) + val forwardDeclaration = ObjCClassForwardDeclaration(className.objCName, generics) + generator?.referenceClass(forwardDeclaration) } } @@ -296,14 +290,14 @@ internal class ObjCExportTranslatorImpl( } fun superClassGenerics(genericExportScope: ObjCExportScope): List { - val parentType = computeSuperClassType(descriptor) - return if(parentType != null) { - parentType.arguments.map { typeProjection -> - mapReferenceTypeIgnoringNullability(typeProjection.type, genericExportScope) + if (objcGenerics) { + computeSuperClassType(descriptor)?.let { parentType -> + return parentType.arguments.map { typeProjection -> + mapReferenceTypeIgnoringNullability(typeProjection.type, genericExportScope) + } } - } else { - emptyList() } + return emptyList() } val superClass = descriptor.getSuperClassNotAny() @@ -397,20 +391,8 @@ internal class ObjCExportTranslatorImpl( val attributes = if (descriptor.isFinalOrEnum) listOf(OBJC_SUBCLASSING_RESTRICTED) else emptyList() val name = translateClassOrInterfaceName(descriptor) - - val generics = if (objcGenerics) { - descriptor.typeConstructor.parameters.map { - "${it.variance.objcDeclaration()}${namer.getTypeParameterName(it)}" - } - } else { - emptyList() - } - - val superClassGenerics = if (objcGenerics) { - superClassGenerics(genericExportScope) - } else { - emptyList() - } + val generics = mapTypeConstructorParameters(descriptor) + val superClassGenerics = superClassGenerics(genericExportScope) return objCInterface( name, @@ -424,6 +406,15 @@ internal class ObjCExportTranslatorImpl( ) } + private fun mapTypeConstructorParameters(descriptor: ClassDescriptor): List { + if (objcGenerics) { + return descriptor.typeConstructor.parameters.map { + ObjCGenericTypeParameterDeclaration(it, namer) + } + } + return emptyList() + } + private fun buildEnumValuesMethod( enumValues: SimpleFunctionDescriptor, genericExportScope: ObjCExportScope @@ -822,9 +813,9 @@ internal class ObjCExportTranslatorImpl( } if(objcGenerics && kotlinType.isTypeParameter()){ - val genericTypeDeclaration = objCExportScope.getGenericDeclaration(TypeUtils.getTypeParameterDescriptorOrNull(kotlinType)) - if(genericTypeDeclaration != null) - return genericTypeDeclaration + val genericTypeUsage = objCExportScope.getGenericTypeUsage(TypeUtils.getTypeParameterDescriptorOrNull(kotlinType)) + if(genericTypeUsage != null) + return genericTypeUsage } val classDescriptor = kotlinType.getErasedTypeClass() @@ -892,7 +883,7 @@ internal class ObjCExportTranslatorImpl( } private fun foreignClassType(name: String): ObjCClassType { - generator?.referenceClass(name) + generator?.referenceClass(ObjCClassForwardDeclaration(name)) return ObjCClassType(name) } @@ -971,7 +962,7 @@ abstract class ObjCExportHeaderGenerator internal constructor( ) { private val stubs = mutableListOf>() - private val classForwardDeclarations = linkedSetOf() + private val classForwardDeclarations = linkedSetOf() private val protocolForwardDeclarations = linkedSetOf() private val extraClassesToTranslate = mutableSetOf() @@ -989,7 +980,14 @@ abstract class ObjCExportHeaderGenerator internal constructor( add("") if (classForwardDeclarations.isNotEmpty()) { - add("@class ${classForwardDeclarations.joinToString()};") + add("@class ${ + classForwardDeclarations.joinToString { + buildString { + append(it.className) + formatGenerics(this, it.typeDeclarations) + } + } + };") add("") } @@ -1163,8 +1161,8 @@ abstract class ObjCExportHeaderGenerator internal constructor( } } - internal fun referenceClass(objCName: String) { - classForwardDeclarations += objCName + internal fun referenceClass(forwardDeclaration: ObjCClassForwardDeclaration) { + classForwardDeclarations += forwardDeclaration } internal fun referenceProtocol(objCName: String) { @@ -1192,7 +1190,19 @@ abstract class ObjCExportHeaderGenerator internal constructor( private fun objCInterface( name: ObjCExportNamer.ClassOrProtocolName, - generics: List = emptyList(), + generics: List, + superClass: String, + superClassGenerics: List +): ObjCInterface = objCInterface( + name, + generics = generics.map { ObjCGenericTypeRawDeclaration(it) }, + superClass = superClass, + superClassGenerics = superClassGenerics.map { ObjCGenericTypeRawUsage(it) } +) + +private fun objCInterface( + name: ObjCExportNamer.ClassOrProtocolName, + generics: List = emptyList(), descriptor: ClassDescriptor? = null, superClass: String? = null, superClassGenerics: List = emptyList(), @@ -1234,7 +1244,7 @@ private fun swiftNameAttribute(swiftName: String) = "swift_name(\"$swiftName\")" private fun objcRuntimeNameAttribute(name: String) = "objc_runtime_name(\"$name\")" interface ObjCExportScope{ - fun getGenericDeclaration(typeParameterDescriptor: TypeParameterDescriptor?): ObjCGenericTypeDeclaration? + fun getGenericTypeUsage(typeParameterDescriptor: TypeParameterDescriptor?): ObjCGenericTypeUsage? } internal class ObjCClassExportScope constructor(container:DeclarationDescriptor, val namer: ObjCExportNamer): ObjCExportScope { @@ -1244,7 +1254,7 @@ internal class ObjCClassExportScope constructor(container:DeclarationDescriptor, emptyList() } - override fun getGenericDeclaration(typeParameterDescriptor: TypeParameterDescriptor?): ObjCGenericTypeDeclaration? { + override fun getGenericTypeUsage(typeParameterDescriptor: TypeParameterDescriptor?): ObjCGenericTypeUsage? { val localTypeParam = typeNames.firstOrNull { typeParameterDescriptor != null && (it == typeParameterDescriptor || (it.isCapturedFromOuterDeclaration && it.original == typeParameterDescriptor)) @@ -1253,19 +1263,13 @@ internal class ObjCClassExportScope constructor(container:DeclarationDescriptor, return if(localTypeParam == null) { null } else { - ObjCGenericTypeDeclaration(localTypeParam, namer) + ObjCGenericTypeParameterUsage(localTypeParam, namer) } } } internal object ObjCNoneExportScope: ObjCExportScope{ - override fun getGenericDeclaration(typeParameterDescriptor: TypeParameterDescriptor?): ObjCGenericTypeDeclaration? = null -} - -internal fun Variance.objcDeclaration():String = when(this){ - Variance.OUT_VARIANCE -> "__covariant " - Variance.IN_VARIANCE -> "__contravariant " - else -> "" + override fun getGenericTypeUsage(typeParameterDescriptor: TypeParameterDescriptor?): ObjCGenericTypeUsage? = null } private fun computeSuperClassType(descriptor: ClassDescriptor): KotlinType? = descriptor.typeConstructor.supertypes.filter { !it.isInterface() }.firstOrNull() diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportLazy.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportLazy.kt index 68d88aca4d3..34aebf55895 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportLazy.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportLazy.kt @@ -150,9 +150,14 @@ internal class ObjCExportLazyImpl( } } - private fun translateGenerics(ktClassOrObject: KtClassOrObject): List = if (configuration.objcGenerics) { + private fun translateGenerics(ktClassOrObject: KtClassOrObject): List = if (configuration.objcGenerics) { ktClassOrObject.typeParametersWithOuter - .map { nameTranslator.getTypeParameterName(it) } + .map { + ObjCGenericTypeRawDeclaration( + nameTranslator.getTypeParameterName(it), + ObjCVariance.fromKotlinVariance(it.variance) + ) + } .toList() } else { emptyList() @@ -316,7 +321,7 @@ internal class ObjCExportLazyImpl( private class LazyObjCInterfaceImpl( name: ObjCExportNamer.ClassOrProtocolName, attributes: List, - generics: List, + generics: List, override val psi: KtClassOrObject, private val lazy: ObjCExportLazyImpl ) : LazyObjCInterface(name = name, generics = generics, categoryName = null, attributes = attributes) { @@ -382,14 +387,14 @@ private abstract class LazyObjCInterface : ObjCInterface { constructor( name: ObjCExportNamer.ClassOrProtocolName, - generics: List, + generics: List, categoryName: String?, attributes: List ) : super(name.objCName, generics, categoryName, attributes + name.toNameAttributes()) constructor( name: String, - generics: List, + generics: List, categoryName: String, attributes: List ) : super(name, generics, categoryName, attributes) diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportedStubs.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportedStubs.kt index fa9501b4ca2..38bdd428e40 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportedStubs.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportedStubs.kt @@ -6,7 +6,7 @@ package org.jetbrains.kotlin.backend.konan.objcexport data class ObjCExportedStubs( - val classForwardDeclarations: Set, + val classForwardDeclarations: Set, val protocolForwardDeclarations: Set, val stubs: List> ) \ No newline at end of file diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/StubRenderer.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/StubRenderer.kt index 447e4397a44..2638daa548a 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/StubRenderer.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/StubRenderer.kt @@ -159,7 +159,7 @@ object StubRenderer { private fun ObjCInterface.renderInterfaceHeader() = buildString { fun appendSuperClass() { if (superClass != null) append(" : $superClass") - formatGenerics(this, superClassGenerics.map { it.render() }) + formatGenerics(this, superClassGenerics) } fun appendGenerics() { @@ -210,7 +210,7 @@ object StubRenderer { } } -internal fun formatGenerics(buffer: Appendable, generics:List) { +fun formatGenerics(buffer: Appendable, generics: List) { if (generics.isNotEmpty()) { generics.joinTo(buffer, separator = ", ", prefix = "<", postfix = ">") } diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/objcTypes.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/objcTypes.kt index ef06ee6ecdc..65376d18a94 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/objcTypes.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/objcTypes.kt @@ -6,6 +6,7 @@ package org.jetbrains.kotlin.backend.konan.objcexport import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor +import org.jetbrains.kotlin.types.Variance sealed class ObjCType { final override fun toString(): String = this.render() @@ -18,7 +19,7 @@ sealed class ObjCType { if (attrsAndName.isEmpty()) this else "$this ${attrsAndName.trimStart()}" } -class ObjCRawType( +data class ObjCRawType( val rawText: String ) : ObjCType() { override fun render(attrsAndName: String): String = rawText.withAttrsAndName(attrsAndName) @@ -34,7 +35,7 @@ data class ObjCNullableReferenceType( override fun render(attrsAndName: String) = nonNullType.render(" _Nullable".withAttrsAndName(attrsAndName)) } -class ObjCClassType( +data class ObjCClassType( val className: String, val typeArguments: List = emptyList() ) : ObjCNonNullReferenceType() { @@ -51,16 +52,24 @@ class ObjCClassType( } } -class ObjCGenericTypeDeclaration( - val typeParameterDescriptor: TypeParameterDescriptor, - val namer: ObjCExportNamer -) : ObjCNonNullReferenceType() { - override fun render(attrsAndName: String): String { - return namer.getTypeParameterName(typeParameterDescriptor).withAttrsAndName(attrsAndName) +sealed class ObjCGenericTypeUsage: ObjCNonNullReferenceType() { + abstract val typeName: String + final override fun render(attrsAndName: String): String { + return typeName.withAttrsAndName(attrsAndName) } } -class ObjCProtocolType( +data class ObjCGenericTypeRawUsage(override val typeName: String) : ObjCGenericTypeUsage() + +data class ObjCGenericTypeParameterUsage( + val typeParameterDescriptor: TypeParameterDescriptor, + val namer: ObjCExportNamer +) : ObjCGenericTypeUsage() { + override val typeName: String + get() = namer.getTypeParameterName(typeParameterDescriptor) +} + +data class ObjCProtocolType( val protocolName: String ) : ObjCNonNullReferenceType() { override fun render(attrsAndName: String) = "id<$protocolName>".withAttrsAndName(attrsAndName) @@ -74,7 +83,7 @@ object ObjCInstanceType : ObjCNonNullReferenceType() { override fun render(attrsAndName: String): String = "instancetype".withAttrsAndName(attrsAndName) } -class ObjCBlockPointerType( +data class ObjCBlockPointerType( val returnType: ObjCType, val parameterTypes: List ) : ObjCNonNullReferenceType() { @@ -124,7 +133,7 @@ sealed class ObjCPrimitiveType( override fun render(attrsAndName: String) = cName.withAttrsAndName(attrsAndName) } -class ObjCPointerType( +data class ObjCPointerType( val pointee: ObjCType, val nullable: Boolean = false ) : ObjCType() { @@ -156,6 +165,41 @@ internal enum class ObjCValueType(val encoding: String) { POINTER("^v") } +enum class ObjCVariance(internal val declaration: String) { + INVARIANT(""), + COVARIANT("__covariant "), + CONTRAVARIANT("__contravariant "); + + companion object { + fun fromKotlinVariance(variance: Variance): ObjCVariance = when (variance) { + Variance.OUT_VARIANCE -> COVARIANT + Variance.IN_VARIANCE -> CONTRAVARIANT + else -> INVARIANT + } + } +} + +sealed class ObjCGenericTypeDeclaration { + abstract val typeName: String + abstract val variance: ObjCVariance + final override fun toString(): String = variance.declaration + typeName +} + +data class ObjCGenericTypeRawDeclaration( + override val typeName: String, + override val variance: ObjCVariance = ObjCVariance.INVARIANT +) : ObjCGenericTypeDeclaration() + +data class ObjCGenericTypeParameterDeclaration( + val typeParameterDescriptor: TypeParameterDescriptor, + val namer: ObjCExportNamer +) : ObjCGenericTypeDeclaration() { + override val typeName: String + get() = namer.getTypeParameterName(typeParameterDescriptor) + override val variance: ObjCVariance + get() = ObjCVariance.fromKotlinVariance(typeParameterDescriptor.variance) +} + internal fun ObjCType.makeNullableIfReferenceOrPointer(): ObjCType = when (this) { is ObjCPointerType -> ObjCPointerType(this.pointee, nullable = true) @@ -167,4 +211,4 @@ internal fun ObjCType.makeNullableIfReferenceOrPointer(): ObjCType = when (this) internal fun ObjCReferenceType.makeNullable(): ObjCNullableReferenceType = when (this) { is ObjCNonNullReferenceType -> ObjCNullableReferenceType(this) is ObjCNullableReferenceType -> this -} +} \ No newline at end of file diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/stubs.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/stubs.kt index bc5bf4a6bef..df336fb8b73 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/stubs.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/stubs.kt @@ -14,6 +14,11 @@ class ObjCComment(val contentLines: List) { constructor(vararg contentLines: String) : this(contentLines.toList()) } +data class ObjCClassForwardDeclaration( + val className: String, + val typeDeclarations: List = emptyList() +) + abstract class Stub(val name: String, val comment: ObjCComment? = null) { abstract val descriptor: D? open val psi: PsiElement? @@ -41,7 +46,7 @@ class ObjCProtocolImpl( attributes: List = emptyList()) : ObjCProtocol(name, attributes) abstract class ObjCInterface(name: String, - val generics: List, + val generics: List, val categoryName: String?, attributes: List) : ObjCClass(name, attributes) { abstract val superClass: String? @@ -50,7 +55,7 @@ abstract class ObjCInterface(name: String, class ObjCInterfaceImpl( name: String, - generics: List = emptyList(), + generics: List = emptyList(), override val descriptor: ClassDescriptor? = null, override val superClass: String? = null, override val superClassGenerics: List = emptyList(), diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index 1a81434b3a8..ad3cb6f0d5e 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -4730,6 +4730,59 @@ if (isAppleTarget(project)) { swiftSources = ['objcexport'] } + frameworkTest('testObjCExportNoGenerics') { + enabled = !isExperimentalMM // Experimental MM doesn't support ObjC blocks yet. + final String frameworkName = 'KtNoGenerics' + final String frameworkArtifactName = 'Kt' + final String dir = "$testOutputFramework/testObjCExportNoGenerics" + final File lazyHeader = file("$dir/$target-lazy.h") + + doLast { + final String expectedLazyHeaderName = "expectedLazyNoGenerics.h" + final String expectedLazyHeaderDir = file("objcexport/") + final File expectedLazyHeader = new File(expectedLazyHeaderDir, expectedLazyHeaderName) + + if (expectedLazyHeader.readLines() != lazyHeader.readLines()) { + exec { + commandLine 'diff', '-u', expectedLazyHeader, lazyHeader + ignoreExitValue = true + } + + copy { + from(lazyHeader) + into(expectedLazyHeaderDir) + rename { expectedLazyHeaderName } + } + + throw new Error("$expectedLazyHeader file patched;\nre-run the test and don't forget to commit the patch") + } + + } + + def libraryName = frameworkName + "Library" + konanArtifacts { + library(libraryName, targets: [target.name]) { + srcDir "objcexport/library" + artifactName "test-library" + + if (!useCustomDist) { + dependsOn ":${target.name}CrossDistRuntime", ':distCompiler' + } + + extraOpts "-Xshort-module-name=MyLibrary" + extraOpts "-module-name", "org.jetbrains.kotlin.native.test-library" + } + } + framework(frameworkName) { + sources = ['objcexport'] + artifact = frameworkArtifactName + library = libraryName + opts = ["-Xemit-lazy-objc-header=$lazyHeader", "-Xno-objc-generics"] + } + swiftSources = ['objcexport'] + swiftExtraOpts = [ '-D', 'NO_GENERICS' ] + } + frameworkTest('testObjCExportStatic') { enabled = !isExperimentalMM // Experimental MM doesn't support ObjC blocks yet. final String frameworkName = 'KtStatic' diff --git a/kotlin-native/backend.native/tests/objcexport/coroutines.swift b/kotlin-native/backend.native/tests/objcexport/coroutines.swift index a3e37913749..eab64e65d9a 100644 --- a/kotlin-native/backend.native/tests/objcexport/coroutines.swift +++ b/kotlin-native/backend.native/tests/objcexport/coroutines.swift @@ -51,7 +51,11 @@ private func testSuspendFuncAsync(doThrow: Bool) throws { var result: AnyObject? = nil var error: Error? = nil +#if NO_GENERICS + let continuationHolder = ContinuationHolder() +#else let continuationHolder = ContinuationHolder() +#endif CoroutinesKt.suspendFunAsync(result: nil, continuationHolder: continuationHolder) { _result, _error in completionCalled += 1 @@ -114,7 +118,11 @@ private class SuspendFunImpl : SuspendFun { } private func testSuspendFunImpl(doYield: Bool, doThrow: Bool) throws { +#if NO_GENERICS + let resultHolder = ResultHolder() +#else let resultHolder = ResultHolder() +#endif let impl = SuspendFunImpl() @@ -141,7 +149,7 @@ private func testSuspendFunImpl(doYield: Bool, doThrow: Bool) throws { try fail() } } else { - try assertEquals(actual: resultHolder.result, expected: 17) + try assertEquals(actual: resultHolder.result as! Int, expected: 17) try assertNil(resultHolder.exception) } } @@ -213,12 +221,16 @@ private class SwiftSuspendBridge : AbstractSuspendBridge { } private func testBridges() throws { +#if NO_GENERICS + let resultHolder = ResultHolder() +#else let resultHolder = ResultHolder() +#endif try CoroutinesKt.callSuspendBridge(bridge: SwiftSuspendBridge(), resultHolder: resultHolder) try assertEquals(actual: resultHolder.completed, expected: 1) try assertNil(resultHolder.exception) - try assertSame(actual: resultHolder.result, expected: KotlinUnit()) + try assertSame(actual: resultHolder.result as AnyObject, expected: KotlinUnit()) } private func testImplicitThrows1() throws { diff --git a/kotlin-native/backend.native/tests/objcexport/deallocRetain.swift b/kotlin-native/backend.native/tests/objcexport/deallocRetain.swift index 3677337b667..3c8758331a1 100644 --- a/kotlin-native/backend.native/tests/objcexport/deallocRetain.swift +++ b/kotlin-native/backend.native/tests/objcexport/deallocRetain.swift @@ -33,7 +33,11 @@ private class DeallocRetain : DeallocRetainBase { static var deallocated = false static var retainObject: DeallocRetain? = nil static weak var weakObject: DeallocRetain? = nil +#if NO_GENERICS + static var kotlinWeakRef: KotlinWeakReference? = nil +#else static var kotlinWeakRef: KotlinWeakReference? = nil +#endif override init() { super.init() @@ -43,7 +47,7 @@ private class DeallocRetain : DeallocRetainBase { func checkWeak() throws { try assertSame(actual: DeallocRetain.weakObject, expected: self) - try assertSame(actual: DeallocRetain.kotlinWeakRef!.value, expected: self) + try assertSame(actual: DeallocRetain.kotlinWeakRef!.value as AnyObject, expected: self) } deinit { diff --git a/kotlin-native/backend.native/tests/objcexport/enumValues.swift b/kotlin-native/backend.native/tests/objcexport/enumValues.swift index a19a3f87078..17b140702ea 100644 --- a/kotlin-native/backend.native/tests/objcexport/enumValues.swift +++ b/kotlin-native/backend.native/tests/objcexport/enumValues.swift @@ -5,10 +5,10 @@ private func testEnumValues() throws { try assertEquals(actual: values.size, expected: 4) - try assertSame(actual: values.get(index: 0), expected: EnumLeftRightUpDown.left) - try assertSame(actual: values.get(index: 1), expected: EnumLeftRightUpDown.right) - try assertSame(actual: values.get(index: 2), expected: EnumLeftRightUpDown.up) - try assertSame(actual: values.get(index: 3), expected: EnumLeftRightUpDown.down) + try assertSame(actual: values.get(index: 0) as AnyObject, expected: EnumLeftRightUpDown.left) + try assertSame(actual: values.get(index: 1) as AnyObject, expected: EnumLeftRightUpDown.right) + try assertSame(actual: values.get(index: 2) as AnyObject, expected: EnumLeftRightUpDown.up) + try assertSame(actual: values.get(index: 3) as AnyObject, expected: EnumLeftRightUpDown.down) } private func testEnumValuesMangled() throws { @@ -16,10 +16,10 @@ private func testEnumValuesMangled() throws { try assertEquals(actual: values.size, expected: 4) - try assertSame(actual: values.get(index: 0), expected: EnumOneTwoThreeValues.one) - try assertSame(actual: values.get(index: 1), expected: EnumOneTwoThreeValues.two) - try assertSame(actual: values.get(index: 2), expected: EnumOneTwoThreeValues.three) - try assertSame(actual: values.get(index: 3), expected: EnumOneTwoThreeValues.values) + try assertSame(actual: values.get(index: 0) as AnyObject, expected: EnumOneTwoThreeValues.one) + try assertSame(actual: values.get(index: 1) as AnyObject, expected: EnumOneTwoThreeValues.two) + try assertSame(actual: values.get(index: 2) as AnyObject, expected: EnumOneTwoThreeValues.three) + try assertSame(actual: values.get(index: 3) as AnyObject, expected: EnumOneTwoThreeValues.values) } private func testEnumValuesMangledTwice() throws { @@ -27,8 +27,8 @@ private func testEnumValuesMangledTwice() throws { try assertEquals(actual: values.size, expected: 2) - try assertSame(actual: values.get(index: 0), expected: EnumValuesValues_.values) - try assertSame(actual: values.get(index: 1), expected: EnumValuesValues_.values_) + try assertSame(actual: values.get(index: 0) as AnyObject, expected: EnumValuesValues_.values) + try assertSame(actual: values.get(index: 1) as AnyObject, expected: EnumValuesValues_.values_) } private func testEnumValuesEmpty() throws { diff --git a/kotlin-native/backend.native/tests/objcexport/expectedLazy.h b/kotlin-native/backend.native/tests/objcexport/expectedLazy.h index d01dc46ecb9..a42eb15882d 100644 --- a/kotlin-native/backend.native/tests/objcexport/expectedLazy.h +++ b/kotlin-native/backend.native/tests/objcexport/expectedLazy.h @@ -2227,3 +2227,42 @@ __attribute__((swift_name("ValuesKt"))) @property (class) int32_t gh3525InitCount __attribute__((swift_name("gh3525InitCount"))); @end; +__attribute__((swift_name("InvariantSuper"))) +@interface KtInvariantSuper : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Invariant"))) +@interface KtInvariant : KtInvariantSuper +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((swift_name("OutVariantSuper"))) +@interface KtOutVariantSuper<__covariant T> : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("OutVariant"))) +@interface KtOutVariant<__covariant T> : KtOutVariantSuper +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((swift_name("InVariantSuper"))) +@interface KtInVariantSuper<__contravariant T> : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("InVariant"))) +@interface KtInVariant<__contravariant T> : KtInVariantSuper +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + diff --git a/kotlin-native/backend.native/tests/objcexport/expectedLazyNoGenerics.h b/kotlin-native/backend.native/tests/objcexport/expectedLazyNoGenerics.h new file mode 100644 index 00000000000..c04e1404fb7 --- /dev/null +++ b/kotlin-native/backend.native/tests/objcexport/expectedLazyNoGenerics.h @@ -0,0 +1,2268 @@ +__attribute__((swift_name("KotlinBase"))) +@interface KtBase : NSObject +- (instancetype)init __attribute__((unavailable)); ++ (instancetype)new __attribute__((unavailable)); ++ (void)initialize __attribute__((objc_requires_super)); +@end; + +@interface KtBase (KtBaseCopying) +@end; + +__attribute__((swift_name("KotlinMutableSet"))) +@interface KtMutableSet : NSMutableSet +@end; + +__attribute__((swift_name("KotlinMutableDictionary"))) +@interface KtMutableDictionary : NSMutableDictionary +@end; + +@interface NSError (NSErrorKtKotlinException) +@property (readonly) id _Nullable kotlinException; +@end; + +__attribute__((swift_name("KotlinNumber"))) +@interface KtNumber : NSNumber +- (instancetype)initWithChar:(char)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedChar:(unsigned char)value __attribute__((unavailable)); +- (instancetype)initWithShort:(short)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedShort:(unsigned short)value __attribute__((unavailable)); +- (instancetype)initWithInt:(int)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedInt:(unsigned int)value __attribute__((unavailable)); +- (instancetype)initWithLong:(long)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedLong:(unsigned long)value __attribute__((unavailable)); +- (instancetype)initWithLongLong:(long long)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedLongLong:(unsigned long long)value __attribute__((unavailable)); +- (instancetype)initWithFloat:(float)value __attribute__((unavailable)); +- (instancetype)initWithDouble:(double)value __attribute__((unavailable)); +- (instancetype)initWithBool:(BOOL)value __attribute__((unavailable)); +- (instancetype)initWithInteger:(NSInteger)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedInteger:(NSUInteger)value __attribute__((unavailable)); ++ (instancetype)numberWithChar:(char)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedChar:(unsigned char)value __attribute__((unavailable)); ++ (instancetype)numberWithShort:(short)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedShort:(unsigned short)value __attribute__((unavailable)); ++ (instancetype)numberWithInt:(int)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedInt:(unsigned int)value __attribute__((unavailable)); ++ (instancetype)numberWithLong:(long)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedLong:(unsigned long)value __attribute__((unavailable)); ++ (instancetype)numberWithLongLong:(long long)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedLongLong:(unsigned long long)value __attribute__((unavailable)); ++ (instancetype)numberWithFloat:(float)value __attribute__((unavailable)); ++ (instancetype)numberWithDouble:(double)value __attribute__((unavailable)); ++ (instancetype)numberWithBool:(BOOL)value __attribute__((unavailable)); ++ (instancetype)numberWithInteger:(NSInteger)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedInteger:(NSUInteger)value __attribute__((unavailable)); +@end; + +__attribute__((swift_name("KotlinByte"))) +@interface KtByte : KtNumber +- (instancetype)initWithChar:(char)value; ++ (instancetype)numberWithChar:(char)value; +@end; + +__attribute__((swift_name("KotlinUByte"))) +@interface KtUByte : KtNumber +- (instancetype)initWithUnsignedChar:(unsigned char)value; ++ (instancetype)numberWithUnsignedChar:(unsigned char)value; +@end; + +__attribute__((swift_name("KotlinShort"))) +@interface KtShort : KtNumber +- (instancetype)initWithShort:(short)value; ++ (instancetype)numberWithShort:(short)value; +@end; + +__attribute__((swift_name("KotlinUShort"))) +@interface KtUShort : KtNumber +- (instancetype)initWithUnsignedShort:(unsigned short)value; ++ (instancetype)numberWithUnsignedShort:(unsigned short)value; +@end; + +__attribute__((swift_name("KotlinInt"))) +@interface KtInt : KtNumber +- (instancetype)initWithInt:(int)value; ++ (instancetype)numberWithInt:(int)value; +@end; + +__attribute__((swift_name("KotlinUInt"))) +@interface KtUInt : KtNumber +- (instancetype)initWithUnsignedInt:(unsigned int)value; ++ (instancetype)numberWithUnsignedInt:(unsigned int)value; +@end; + +__attribute__((swift_name("KotlinLong"))) +@interface KtLong : KtNumber +- (instancetype)initWithLongLong:(long long)value; ++ (instancetype)numberWithLongLong:(long long)value; +@end; + +__attribute__((swift_name("KotlinULong"))) +@interface KtULong : KtNumber +- (instancetype)initWithUnsignedLongLong:(unsigned long long)value; ++ (instancetype)numberWithUnsignedLongLong:(unsigned long long)value; +@end; + +__attribute__((swift_name("KotlinFloat"))) +@interface KtFloat : KtNumber +- (instancetype)initWithFloat:(float)value; ++ (instancetype)numberWithFloat:(float)value; +@end; + +__attribute__((swift_name("KotlinDouble"))) +@interface KtDouble : KtNumber +- (instancetype)initWithDouble:(double)value; ++ (instancetype)numberWithDouble:(double)value; +@end; + +__attribute__((swift_name("KotlinBoolean"))) +@interface KtBoolean : KtNumber +- (instancetype)initWithBool:(BOOL)value; ++ (instancetype)numberWithBool:(BOOL)value; +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("CoroutineException"))) +@interface KtCoroutineException : KtKotlinThrowable +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithCause:(KtKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(KtKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("ContinuationHolder"))) +@interface KtContinuationHolder : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (void)resumeValue:(id _Nullable)value __attribute__((swift_name("resume(value:)"))); +- (void)resumeWithExceptionException:(KtKotlinThrowable *)exception __attribute__((swift_name("resumeWithException(exception:)"))); +@end; + +__attribute__((swift_name("SuspendFun"))) +@protocol KtSuspendFun +@required + +/** + @note This method converts instances of CoroutineException, CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void)suspendFunDoYield:(BOOL)doYield doThrow:(BOOL)doThrow completionHandler:(void (^)(KtInt * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("suspendFun(doYield:doThrow:completionHandler:)"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("ResultHolder"))) +@interface KtResultHolder : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@property int32_t completed __attribute__((swift_name("completed"))); +@property id _Nullable result __attribute__((swift_name("result"))); +@property KtKotlinThrowable * _Nullable exception __attribute__((swift_name("exception"))); +@end; + +__attribute__((swift_name("SuspendBridge"))) +@protocol KtSuspendBridge +@required + +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void)intValue:(id _Nullable)value completionHandler:(void (^)(KtInt * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("int(value:completionHandler:)"))); + +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void)intAsAnyValue:(id _Nullable)value completionHandler:(void (^)(id _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("intAsAny(value:completionHandler:)"))); + +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void)unitValue:(id _Nullable)value completionHandler:(void (^)(KtKotlinUnit * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("unit(value:completionHandler:)"))); + +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void)unitAsAnyValue:(id _Nullable)value completionHandler:(void (^)(id _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("unitAsAny(value:completionHandler:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ +- (void)nothingValue:(id _Nullable)value completionHandler:(void (^)(KtKotlinNothing * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("nothing(value:completionHandler:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ +- (void)nothingAsIntValue:(id _Nullable)value completionHandler:(void (^)(KtInt * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("nothingAsInt(value:completionHandler:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ +- (void)nothingAsAnyValue:(id _Nullable)value completionHandler:(void (^)(id _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("nothingAsAny(value:completionHandler:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ +- (void)nothingAsUnitValue:(id _Nullable)value completionHandler:(void (^)(KtKotlinUnit * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("nothingAsUnit(value:completionHandler:)"))); +@end; + +__attribute__((swift_name("AbstractSuspendBridge"))) +@interface KtAbstractSuspendBridge : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); + +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void)intAsAnyValue:(KtInt *)value completionHandler:(void (^)(KtInt * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("intAsAny(value:completionHandler:)"))); + +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void)unitAsAnyValue:(KtInt *)value completionHandler:(void (^)(KtKotlinUnit * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("unitAsAny(value:completionHandler:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ +- (void)nothingAsIntValue:(KtInt *)value completionHandler:(void (^)(KtKotlinNothing * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("nothingAsInt(value:completionHandler:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ +- (void)nothingAsAnyValue:(KtInt *)value completionHandler:(void (^)(KtKotlinNothing * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("nothingAsAny(value:completionHandler:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ +- (void)nothingAsUnitValue:(KtInt *)value completionHandler:(void (^)(KtKotlinNothing * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("nothingAsUnit(value:completionHandler:)"))); +@end; + +__attribute__((swift_name("ThrowCancellationException"))) +@interface KtThrowCancellationException : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("ThrowCancellationExceptionImpl"))) +@interface KtThrowCancellationExceptionImpl : KtThrowCancellationException +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); + +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void)throwCancellationExceptionWithCompletionHandler:(void (^)(KtKotlinUnit * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("throwCancellationException(completionHandler:)"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("CoroutinesKt"))) +@interface KtCoroutinesKt : KtBase + +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ ++ (void)suspendFunWithCompletionHandler:(void (^)(KtInt * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("suspendFun(completionHandler:)"))); + +/** + @note This method converts instances of CoroutineException, CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ ++ (void)suspendFunResult:(id _Nullable)result doSuspend:(BOOL)doSuspend doThrow:(BOOL)doThrow completionHandler:(void (^)(id _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("suspendFun(result:doSuspend:doThrow:completionHandler:)"))); + +/** + @note This method converts instances of CoroutineException, CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ ++ (void)suspendFunAsyncResult:(id _Nullable)result continuationHolder:(KtContinuationHolder *)continuationHolder completionHandler:(void (^)(id _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("suspendFunAsync(result:continuationHolder:completionHandler:)"))); + +/** + @note This method converts instances of CoroutineException, CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ ++ (BOOL)throwExceptionException:(KtKotlinThrowable *)exception error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("throwException(exception:)"))); ++ (void)callSuspendFunSuspendFun:(id)suspendFun doYield:(BOOL)doYield doThrow:(BOOL)doThrow resultHolder:(KtResultHolder *)resultHolder __attribute__((swift_name("callSuspendFun(suspendFun:doYield:doThrow:resultHolder:)"))); + +/** + @note This method converts instances of CoroutineException, CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ ++ (void)callSuspendFun2SuspendFun:(id)suspendFun doYield:(BOOL)doYield doThrow:(BOOL)doThrow completionHandler:(void (^)(KtInt * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("callSuspendFun2(suspendFun:doYield:doThrow:completionHandler:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ ++ (BOOL)callSuspendBridgeBridge:(KtAbstractSuspendBridge *)bridge resultHolder:(KtResultHolder *)resultHolder error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("callSuspendBridge(bridge:resultHolder:)"))); + +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ ++ (void)throwCancellationExceptionWithCompletionHandler:(void (^)(KtKotlinUnit * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("throwCancellationException(completionHandler:)"))); ++ (id)getSuspendLambda0 __attribute__((swift_name("getSuspendLambda0()"))); ++ (id)getSuspendCallableReference0 __attribute__((swift_name("getSuspendCallableReference0()"))); ++ (id)getSuspendLambda1 __attribute__((swift_name("getSuspendLambda1()"))); ++ (id)getSuspendCallableReference1 __attribute__((swift_name("getSuspendCallableReference1()"))); + +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ ++ (void)invoke1Block:(id)block argument:(id _Nullable)argument completionHandler:(void (^)(id _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("invoke1(block:argument:completionHandler:)"))); +@end; + +__attribute__((swift_name("DeallocRetainBase"))) +@interface KtDeallocRetainBase : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("DeallocRetainKt"))) +@interface KtDeallocRetainKt : KtBase ++ (void)garbageCollect __attribute__((swift_name("garbageCollect()"))); ++ (KtKotlinWeakReference *)createWeakReferenceValue:(id)value __attribute__((swift_name("createWeakReference(value:)"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("EnumLeftRightUpDown"))) +@interface KtEnumLeftRightUpDown : KtKotlinEnum ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); +- (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal __attribute__((swift_name("init(name:ordinal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +@property (class, readonly) KtEnumLeftRightUpDown *left __attribute__((swift_name("left"))); +@property (class, readonly) KtEnumLeftRightUpDown *right __attribute__((swift_name("right"))); +@property (class, readonly) KtEnumLeftRightUpDown *up __attribute__((swift_name("up"))); +@property (class, readonly) KtEnumLeftRightUpDown *down __attribute__((swift_name("down"))); ++ (KtKotlinArray *)values __attribute__((swift_name("values()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("EnumOneTwoThreeValues"))) +@interface KtEnumOneTwoThreeValues : KtKotlinEnum ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); +- (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal __attribute__((swift_name("init(name:ordinal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +@property (class, readonly) KtEnumOneTwoThreeValues *one __attribute__((swift_name("one"))); +@property (class, readonly) KtEnumOneTwoThreeValues *two __attribute__((swift_name("two"))); +@property (class, readonly) KtEnumOneTwoThreeValues *three __attribute__((swift_name("three"))); +@property (class, readonly) KtEnumOneTwoThreeValues *values __attribute__((swift_name("values"))); ++ (KtKotlinArray *)values __attribute__((swift_name("values()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("EnumValuesValues_"))) +@interface KtEnumValuesValues_ : KtKotlinEnum ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); +- (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal __attribute__((swift_name("init(name:ordinal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +@property (class, readonly) KtEnumValuesValues_ *values __attribute__((swift_name("values"))); +@property (class, readonly) KtEnumValuesValues_ *values __attribute__((swift_name("values"))); ++ (KtKotlinArray *)values __attribute__((swift_name("values()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("EmptyEnum"))) +@interface KtEmptyEnum : KtKotlinEnum ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); +- (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal __attribute__((swift_name("init(name:ordinal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); ++ (KtKotlinArray *)values __attribute__((swift_name("values()"))); +@end; + +__attribute__((swift_name("FunInterface"))) +@protocol KtFunInterface +@required +- (int32_t)run __attribute__((swift_name("run()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("FunInterfacesKt"))) +@interface KtFunInterfacesKt : KtBase ++ (id)getObject __attribute__((swift_name("getObject()"))); ++ (id)getLambda __attribute__((swift_name("getLambda()"))); +@end; + +__attribute__((swift_name("FHolder"))) +@interface KtFHolder : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@property (readonly) id _Nullable value __attribute__((swift_name("value"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("F2Holder"))) +@interface KtF2Holder : KtFHolder +- (instancetype)initWithValue:(id _Nullable (^)(id _Nullable, id _Nullable))value __attribute__((swift_name("init(value:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); ++ (instancetype)new __attribute__((unavailable)); +@property (readonly) id _Nullable (^value)(id _Nullable, id _Nullable) __attribute__((swift_name("value"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("F32Holder"))) +@interface KtF32Holder : KtFHolder +- (instancetype)initWithValue:(id _Nullable (^)(id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable))value __attribute__((swift_name("init(value:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); ++ (instancetype)new __attribute__((unavailable)); +@property (readonly) id _Nullable (^value)(id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable) __attribute__((swift_name("value"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("F33Holder"))) +@interface KtF33Holder : KtFHolder +- (instancetype)initWithValue:(id _Nullable (^)(id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable))value __attribute__((swift_name("init(value:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); ++ (instancetype)new __attribute__((unavailable)); +@property (readonly) id value __attribute__((swift_name("value"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("FunctionalTypesKt"))) +@interface KtFunctionalTypesKt : KtBase ++ (void)callDynType2List:(NSArray *)list param:(id _Nullable)param __attribute__((swift_name("callDynType2(list:param:)"))); ++ (void)callStaticType2Fct:(id _Nullable (^)(id _Nullable, id _Nullable))fct param:(id _Nullable)param __attribute__((swift_name("callStaticType2(fct:param:)"))); ++ (void)callDynType32List:(NSArray *)list param:(id _Nullable)param __attribute__((swift_name("callDynType32(list:param:)"))); ++ (void)callStaticType32Fct:(id _Nullable (^)(id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable))fct param:(id _Nullable)param __attribute__((swift_name("callStaticType32(fct:param:)"))); ++ (void)callDynType33List:(NSArray> *)list param:(id _Nullable)param __attribute__((swift_name("callDynType33(list:param:)"))); ++ (void)callStaticType33Fct:(id _Nullable (^)(id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable))fct param:(id _Nullable)param __attribute__((swift_name("callStaticType33(fct:param:)"))); ++ (KtF2Holder *)getDynTypeLambda2 __attribute__((swift_name("getDynTypeLambda2()"))); ++ (id _Nullable (^)(id _Nullable, id _Nullable))getStaticLambda2 __attribute__((swift_name("getStaticLambda2()"))); ++ (KtF2Holder *)getDynTypeRef2 __attribute__((swift_name("getDynTypeRef2()"))); ++ (id _Nullable (^)(id _Nullable, id _Nullable))getStaticRef2 __attribute__((swift_name("getStaticRef2()"))); ++ (KtF32Holder *)getDynType32 __attribute__((swift_name("getDynType32()"))); ++ (id _Nullable (^)(id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable))getStaticType32 __attribute__((swift_name("getStaticType32()"))); ++ (KtF33Holder *)getDynTypeRef33 __attribute__((swift_name("getDynTypeRef33()"))); ++ (id _Nullable (^)(id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable))getStaticTypeRef33 __attribute__((swift_name("getStaticTypeRef33()"))); ++ (KtF33Holder *)getDynTypeLambda33 __attribute__((swift_name("getDynTypeLambda33()"))); ++ (id _Nullable (^)(id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable, id _Nullable))getStaticTypeLambda33 __attribute__((swift_name("getStaticTypeLambda33()"))); +@end; + +__attribute__((swift_name("GH4002ArgumentBase"))) +@interface KtGH4002ArgumentBase : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("GH4002Argument"))) +@interface KtGH4002Argument : KtGH4002ArgumentBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestIncompatiblePropertyTypeWarning"))) +@interface KtTestIncompatiblePropertyTypeWarning : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestIncompatiblePropertyTypeWarning.Generic"))) +@interface KtTestIncompatiblePropertyTypeWarningGeneric : KtBase +- (instancetype)initWithValue:(id _Nullable)value __attribute__((swift_name("init(value:)"))) __attribute__((objc_designated_initializer)); +@property (readonly) id _Nullable value __attribute__((swift_name("value"))); +@end; + +__attribute__((swift_name("TestIncompatiblePropertyTypeWarningInterfaceWithGenericProperty"))) +@protocol KtTestIncompatiblePropertyTypeWarningInterfaceWithGenericProperty +@required +@property (readonly) KtTestIncompatiblePropertyTypeWarningGeneric *p __attribute__((swift_name("p"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestIncompatiblePropertyTypeWarning.ClassOverridingInterfaceWithGenericProperty"))) +@interface KtTestIncompatiblePropertyTypeWarningClassOverridingInterfaceWithGenericProperty : KtBase +- (instancetype)initWithP:(KtTestIncompatiblePropertyTypeWarningGeneric *)p __attribute__((swift_name("init(p:)"))) __attribute__((objc_designated_initializer)); +@property (readonly) KtTestIncompatiblePropertyTypeWarningGeneric *p __attribute__((swift_name("p"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestGH3992"))) +@interface KtTestGH3992 : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((swift_name("TestGH3992.C"))) +@interface KtTestGH3992C : KtBase +- (instancetype)initWithA:(KtTestGH3992A *)a __attribute__((swift_name("init(a:)"))) __attribute__((objc_designated_initializer)); +@property (readonly) KtTestGH3992A *a __attribute__((swift_name("a"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestGH3992.D"))) +@interface KtTestGH3992D : KtTestGH3992C +- (instancetype)initWithA:(KtTestGH3992B *)a __attribute__((swift_name("init(a:)"))) __attribute__((objc_designated_initializer)); +@property (readonly) KtTestGH3992B *a __attribute__((swift_name("a"))); +@end; + +__attribute__((swift_name("TestGH3992.A"))) +@interface KtTestGH3992A : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestGH3992.B"))) +@interface KtTestGH3992B : KtTestGH3992A +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Kt35940Kt"))) +@interface KtKt35940Kt : KtBase ++ (NSString *)testKt35940 __attribute__((swift_name("testKt35940()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("KT38641"))) +@interface KtKT38641 : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("KT38641.IntType"))) +@interface KtKT38641IntType : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@property (getter=description, setter=setDescription:) int32_t description_ __attribute__((swift_name("description_"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("KT38641.Val"))) +@interface KtKT38641Val : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@property (readonly, getter=description) NSString *description_ __attribute__((swift_name("description_"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("KT38641.Var"))) +@interface KtKT38641Var : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@property (getter=description, setter=setDescription:) NSString *description_ __attribute__((swift_name("description_"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("KT38641.TwoProperties"))) +@interface KtKT38641TwoProperties : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@property (readonly, getter=description) NSString *description_ __attribute__((swift_name("description_"))); +@property (readonly) NSString *description_ __attribute__((swift_name("description_"))); +@end; + +__attribute__((swift_name("KT38641.OverrideVal"))) +@interface KtKT38641OverrideVal : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@property (readonly, getter=description) NSString *description_ __attribute__((swift_name("description_"))); +@end; + +__attribute__((swift_name("KT38641OverrideVar"))) +@protocol KtKT38641OverrideVar +@required +@property (getter=description, setter=setDescription:) NSString *description_ __attribute__((swift_name("description_"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Kt38641Kt"))) +@interface KtKt38641Kt : KtBase ++ (NSString *)getOverrideValDescriptionImpl:(KtKT38641OverrideVal *)impl __attribute__((swift_name("getOverrideValDescription(impl:)"))); ++ (NSString *)getOverrideVarDescriptionImpl:(id)impl __attribute__((swift_name("getOverrideVarDescription(impl:)"))); ++ (void)setOverrideVarDescriptionImpl:(id)impl newValue:(NSString *)newValue __attribute__((swift_name("setOverrideVarDescription(impl:newValue:)"))); +@end; + +__attribute__((swift_name("JsonConfiguration"))) +@interface KtJsonConfiguration : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable("This class is deprecated for removal during serialization 1.0 API stabilization.\nFor configuring Json instances, the corresponding builder function can be used instead, e.g. instead of'Json(JsonConfiguration.Stable.copy(isLenient = true))' 'Json { isLenient = true }' should be used.\nInstead of storing JsonConfiguration instances of the code, Json instances can be used directly:'Json(MyJsonConfiguration.copy(prettyPrint = true))' can be replaced with 'Json(from = MyApplicationJson) { prettyPrint = true }'"))); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("MoreTrickyChars"))) +@interface KtMoreTrickyChars : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((deprecated("'\"\\@$(){}\r\n"))); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Kt39206Kt"))) +@interface KtKt39206Kt : KtBase ++ (int32_t)myFunc __attribute__((swift_name("myFunc()"))) __attribute__((deprecated("Don't call this\nPlease"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Ckt41907"))) +@interface KtCkt41907 : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((swift_name("Ikt41907"))) +@protocol KtIkt41907 +@required +- (void)fooC:(KtCkt41907 *)c __attribute__((swift_name("foo(c:)"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Kt41907Kt"))) +@interface KtKt41907Kt : KtBase ++ (void)escapeCC:(KtCkt41907 *)c __attribute__((swift_name("escapeC(c:)"))); ++ (void)testKt41907O:(id)o __attribute__((swift_name("testKt41907(o:)"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("KT43599"))) +@interface KtKT43599 : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@property (readonly) NSString *memberProperty __attribute__((swift_name("memberProperty"))); +@end; + +@interface KtKT43599 (Kt43599Kt) +@property (readonly) NSString *extensionProperty __attribute__((swift_name("extensionProperty"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Kt43599Kt"))) +@interface KtKt43599Kt : KtBase ++ (void)setTopLevelLateinitPropertyValue:(NSString *)value __attribute__((swift_name("setTopLevelLateinitProperty(value:)"))); +@property (class, readonly) NSString *topLevelProperty __attribute__((swift_name("topLevelProperty"))); +@property (class, readonly) NSString *topLevelLateinitProperty __attribute__((swift_name("topLevelLateinitProperty"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("LibraryKt"))) +@interface KtLibraryKt : KtBase ++ (NSString *)readDataFromLibraryClassInput:(KtA *)input __attribute__((swift_name("readDataFromLibraryClass(input:)"))); ++ (NSString *)readDataFromLibraryInterfaceInput:(id)input __attribute__((swift_name("readDataFromLibraryInterface(input:)"))); ++ (NSString *)readDataFromLibraryEnumInput:(KtE *)input __attribute__((swift_name("readDataFromLibraryEnum(input:)"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("ArraysConstructor"))) +@interface KtArraysConstructor : KtBase +- (instancetype)initWithInt1:(int32_t)int1 int2:(int32_t)int2 __attribute__((swift_name("init(int1:int2:)"))) __attribute__((objc_designated_initializer)); +- (void)setInt1:(int32_t)int1 int2:(int32_t)int2 __attribute__((swift_name("set(int1:int2:)"))); +- (NSString *)log __attribute__((swift_name("log()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("ArraysDefault"))) +@interface KtArraysDefault : KtBase +- (instancetype)initWithInt1:(int32_t)int1 int2:(int32_t)int2 __attribute__((swift_name("init(int1:int2:)"))) __attribute__((objc_designated_initializer)); +- (void)setInt1:(int32_t)int1 int2:(int32_t)int2 __attribute__((swift_name("set(int1:int2:)"))); +- (NSString *)log __attribute__((swift_name("log()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("ArraysInitBlock"))) +@interface KtArraysInitBlock : KtBase +- (instancetype)initWithInt1:(int32_t)int1 int2:(int32_t)int2 __attribute__((swift_name("init(int1:int2:)"))) __attribute__((objc_designated_initializer)); +- (void)setInt1:(int32_t)int1 int2:(int32_t)int2 __attribute__((swift_name("set(int1:int2:)"))); +- (NSString *)log __attribute__((swift_name("log()"))); +@end; + +__attribute__((swift_name("OverrideKotlinMethods2"))) +@protocol KtOverrideKotlinMethods2 +@required +- (int32_t)one __attribute__((swift_name("one()"))); +@end; + +__attribute__((swift_name("OverrideKotlinMethods3"))) +@interface KtOverrideKotlinMethods3 : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((swift_name("OverrideKotlinMethods4"))) +@interface KtOverrideKotlinMethods4 : KtOverrideKotlinMethods3 +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (int32_t)one __attribute__((swift_name("one()"))); +@end; + +__attribute__((swift_name("OverrideKotlinMethods5"))) +@protocol KtOverrideKotlinMethods5 +@required +- (int32_t)one __attribute__((swift_name("one()"))); +@end; + +__attribute__((swift_name("OverrideKotlinMethods6"))) +@protocol KtOverrideKotlinMethods6 +@required +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("OverrideKotlinMethodsKt"))) +@interface KtOverrideKotlinMethodsKt : KtBase + +/** + @note This method converts all Kotlin exceptions to errors. +*/ ++ (BOOL)test0Obj:(id)obj error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("test0(obj:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ ++ (BOOL)test1Obj:(id)obj error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("test1(obj:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ ++ (BOOL)test2Obj:(id)obj error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("test2(obj:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ ++ (BOOL)test3Obj:(KtOverrideKotlinMethods3 *)obj error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("test3(obj:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ ++ (BOOL)test4Obj:(KtOverrideKotlinMethods4 *)obj error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("test4(obj:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ ++ (BOOL)test5Obj:(id)obj error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("test5(obj:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ ++ (BOOL)test6Obj:(id)obj error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("test6(obj:)"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("OverrideMethodsOfAnyKt"))) +@interface KtOverrideMethodsOfAnyKt : KtBase + +/** + @note This method converts all Kotlin exceptions to errors. +*/ ++ (BOOL)testObj:(id)obj other:(id)other swift:(BOOL)swift error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("test(obj:other:swift:)"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("ThrowsEmptyKt"))) +@interface KtThrowsEmptyKt : KtBase + +/** + @warning All uncaught Kotlin exceptions are fatal. +*/ ++ (BOOL)throwsEmptyAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("throwsEmpty()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TopLevelManglingAKt"))) +@interface KtTopLevelManglingAKt : KtBase ++ (NSString *)foo __attribute__((swift_name("foo()"))); ++ (int32_t)sameNumberValue:(int32_t)value __attribute__((swift_name("sameNumber(value:)"))); ++ (int64_t)sameNumberValue:(int64_t)value __attribute__((swift_name("sameNumber(value:)"))); +@property (class, readonly) NSString *bar __attribute__((swift_name("bar"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TopLevelManglingBKt"))) +@interface KtTopLevelManglingBKt : KtBase ++ (NSString *)foo __attribute__((swift_name("foo()"))); +@property (class, readonly) NSString *bar __attribute__((swift_name("bar"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("DelegateClass"))) +@interface KtDelegateClass : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (KtKotlinArray *)getValueThisRef:(KtKotlinNothing * _Nullable)thisRef property:(id)property __attribute__((swift_name("getValue(thisRef:property:)"))); +- (void)setValueThisRef:(KtKotlinNothing * _Nullable)thisRef property:(id)property value:(KtKotlinArray *)value __attribute__((swift_name("setValue(thisRef:property:value:)"))); +@end; + +__attribute__((swift_name("I"))) +@protocol KtI +@required +- (NSString *)iFun __attribute__((swift_name("iFun()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("DefaultInterfaceExt"))) +@interface KtDefaultInterfaceExt : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((swift_name("OpenClassI"))) +@interface KtOpenClassI : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (NSString *)iFun __attribute__((swift_name("iFun()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("FinalClassExtOpen"))) +@interface KtFinalClassExtOpen : KtOpenClassI +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (NSString *)iFun __attribute__((swift_name("iFun()"))); +@end; + +__attribute__((swift_name("MultiExtClass"))) +@interface KtMultiExtClass : KtOpenClassI +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (id)piFun __attribute__((swift_name("piFun()"))); +- (NSString *)iFun __attribute__((swift_name("iFun()"))); +@end; + +__attribute__((swift_name("ConstrClass"))) +@interface KtConstrClass : KtOpenClassI +- (instancetype)initWithI:(int32_t)i s:(NSString *)s a:(id)a __attribute__((swift_name("init(i:s:a:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); ++ (instancetype)new __attribute__((unavailable)); +@property (readonly) int32_t i __attribute__((swift_name("i"))); +@property (readonly) NSString *s __attribute__((swift_name("s"))); +@property (readonly) id a __attribute__((swift_name("a"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("ExtConstrClass"))) +@interface KtExtConstrClass : KtConstrClass +- (instancetype)initWithI:(int32_t)i __attribute__((swift_name("init(i:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithI:(int32_t)i s:(NSString *)s a:(id)a __attribute__((swift_name("init(i:s:a:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (NSString *)iFun __attribute__((swift_name("iFun()"))); +@property (readonly) int32_t i __attribute__((swift_name("i"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Enumeration"))) +@interface KtEnumeration : KtKotlinEnum ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); +- (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal __attribute__((swift_name("init(name:ordinal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +@property (class, readonly) KtEnumeration *answer __attribute__((swift_name("answer"))); +@property (class, readonly) KtEnumeration *year __attribute__((swift_name("year"))); +@property (class, readonly) KtEnumeration *temperature __attribute__((swift_name("temperature"))); ++ (KtKotlinArray *)values __attribute__((swift_name("values()"))); +@property (readonly) int32_t enumValue __attribute__((swift_name("enumValue"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TripleVals"))) +@interface KtTripleVals : KtBase +- (instancetype)initWithFirst:(id _Nullable)first second:(id _Nullable)second third:(id _Nullable)third __attribute__((swift_name("init(first:second:third:)"))) __attribute__((objc_designated_initializer)); +- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)"))); +- (NSUInteger)hash __attribute__((swift_name("hash()"))); +- (NSString *)description __attribute__((swift_name("description()"))); +- (id _Nullable)component1 __attribute__((swift_name("component1()"))); +- (id _Nullable)component2 __attribute__((swift_name("component2()"))); +- (id _Nullable)component3 __attribute__((swift_name("component3()"))); +- (KtTripleVals *)doCopyFirst:(id _Nullable)first second:(id _Nullable)second third:(id _Nullable)third __attribute__((swift_name("doCopy(first:second:third:)"))); +@property (readonly) id _Nullable first __attribute__((swift_name("first"))); +@property (readonly) id _Nullable second __attribute__((swift_name("second"))); +@property (readonly) id _Nullable third __attribute__((swift_name("third"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TripleVars"))) +@interface KtTripleVars : KtBase +- (instancetype)initWithFirst:(id _Nullable)first second:(id _Nullable)second third:(id _Nullable)third __attribute__((swift_name("init(first:second:third:)"))) __attribute__((objc_designated_initializer)); +- (NSString *)description __attribute__((swift_name("description()"))); +- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)"))); +- (NSUInteger)hash __attribute__((swift_name("hash()"))); +- (id _Nullable)component1 __attribute__((swift_name("component1()"))); +- (id _Nullable)component2 __attribute__((swift_name("component2()"))); +- (id _Nullable)component3 __attribute__((swift_name("component3()"))); +- (KtTripleVars *)doCopyFirst:(id _Nullable)first second:(id _Nullable)second third:(id _Nullable)third __attribute__((swift_name("doCopy(first:second:third:)"))); +@property id _Nullable first __attribute__((swift_name("first"))); +@property id _Nullable second __attribute__((swift_name("second"))); +@property id _Nullable third __attribute__((swift_name("third"))); +@end; + +__attribute__((swift_name("WithCompanionAndObject"))) +@interface KtWithCompanionAndObject : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("WithCompanionAndObject.Companion"))) +@interface KtWithCompanionAndObjectCompanion : KtBase ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); ++ (instancetype)companion __attribute__((swift_name("init()"))); +@property (readonly) NSString *str __attribute__((swift_name("str"))); +@property id _Nullable named __attribute__((swift_name("named"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("WithCompanionAndObject.Named"))) +@interface KtWithCompanionAndObjectNamed : KtOpenClassI ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); ++ (instancetype)new __attribute__((unavailable)); ++ (instancetype)named __attribute__((swift_name("init()"))); +- (NSString *)iFun __attribute__((swift_name("iFun()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("MyException"))) +@interface KtMyException : KtKotlinException +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(KtKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithCause:(KtKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("MyError"))) +@interface KtMyError : KtKotlinError +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(KtKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithCause:(KtKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +@end; + +__attribute__((swift_name("SwiftOverridableMethodsWithThrows"))) +@protocol KtSwiftOverridableMethodsWithThrows +@required + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (BOOL)unitAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("unit()"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (BOOL)nothingAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("nothing()"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (id _Nullable)anyAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("any()"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (KtInt *(^ _Nullable)(void))blockAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("block()"))); +@end; + +__attribute__((swift_name("MethodsWithThrows"))) +@protocol KtMethodsWithThrows +@required + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (KtKotlinNothing * _Nullable)nothingNAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("nothingN()"))) __attribute__((swift_error(nonnull_error))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (id _Nullable)anyNAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("anyN()"))) __attribute__((swift_error(nonnull_error))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (KtInt *(^ _Nullable)(void))blockNAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("blockN()"))) __attribute__((swift_error(nonnull_error))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void * _Nullable)pointerAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("pointer()"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void * _Nullable)pointerNAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("pointerN()"))) __attribute__((swift_error(nonnull_error))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (int32_t)intAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("int()"))) __attribute__((swift_error(nonnull_error))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (KtLong * _Nullable)longNAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("longN()"))) __attribute__((swift_error(nonnull_error))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (double)doubleAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("double()"))) __attribute__((swift_error(nonnull_error))); +@end; + +__attribute__((swift_name("MethodsWithThrowsUnitCaller"))) +@protocol KtMethodsWithThrowsUnitCaller +@required + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (BOOL)callMethods:(id)methods error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("call(methods:)"))); +@end; + +__attribute__((swift_name("Throwing"))) +@interface KtThrowing : KtBase + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (instancetype _Nullable)initWithDoThrow:(BOOL)doThrow error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("init(doThrow:)"))) __attribute__((objc_designated_initializer)); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (BOOL)unitAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("unit()"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (BOOL)nothingAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("nothing()"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (KtKotlinNothing * _Nullable)nothingNAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("nothingN()"))) __attribute__((swift_error(nonnull_error))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (id _Nullable)anyAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("any()"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (id _Nullable)anyNAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("anyN()"))) __attribute__((swift_error(nonnull_error))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (KtInt *(^ _Nullable)(void))blockAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("block()"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (KtInt *(^ _Nullable)(void))blockNAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("blockN()"))) __attribute__((swift_error(nonnull_error))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void * _Nullable)pointerAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("pointer()"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void * _Nullable)pointerNAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("pointerN()"))) __attribute__((swift_error(nonnull_error))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (int32_t)intAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("int()"))) __attribute__((swift_error(nonnull_error))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (KtLong * _Nullable)longNAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("longN()"))) __attribute__((swift_error(nonnull_error))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (double)doubleAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("double()"))) __attribute__((swift_error(nonnull_error))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("NotThrowing"))) +@interface KtNotThrowing : KtBase + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (instancetype _Nullable)initAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (BOOL)unitAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("unit()"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (BOOL)nothingAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("nothing()"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (KtKotlinNothing * _Nullable)nothingNAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("nothingN()"))) __attribute__((swift_error(nonnull_error))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (id _Nullable)anyAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("any()"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (id _Nullable)anyNAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("anyN()"))) __attribute__((swift_error(nonnull_error))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (KtInt *(^ _Nullable)(void))blockAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("block()"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (KtInt *(^ _Nullable)(void))blockNAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("blockN()"))) __attribute__((swift_error(nonnull_error))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void * _Nullable)pointerAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("pointer()"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void * _Nullable)pointerNAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("pointerN()"))) __attribute__((swift_error(nonnull_error))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (int32_t)intAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("int()"))) __attribute__((swift_error(nonnull_error))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (KtLong * _Nullable)longNAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("longN()"))) __attribute__((swift_error(nonnull_error))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (double)doubleAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("double()"))) __attribute__((swift_error(nonnull_error))); +@end; + +__attribute__((swift_name("ThrowsWithBridgeBase"))) +@protocol KtThrowsWithBridgeBase +@required + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (id _Nullable)plusOneX:(int32_t)x error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("plusOne(x:)"))); +@end; + +__attribute__((swift_name("ThrowsWithBridge"))) +@interface KtThrowsWithBridge : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (KtInt * _Nullable)plusOneX:(int32_t)x error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("plusOne(x:)"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Deeply"))) +@interface KtDeeply : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Deeply.Nested"))) +@interface KtDeeplyNested : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Deeply.NestedType"))) +@interface KtDeeplyNestedType : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@property (readonly) int32_t thirtyTwo __attribute__((swift_name("thirtyTwo"))); +@end; + +__attribute__((swift_name("DeeplyNestedIType"))) +@protocol KtDeeplyNestedIType +@required +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("WithGenericDeeply"))) +@interface KtWithGenericDeeply : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("WithGenericDeeply.Nested"))) +@interface KtWithGenericDeeplyNested : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("WithGenericDeeply.NestedType"))) +@interface KtWithGenericDeeplyNestedType : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@property (readonly) int32_t thirtyThree __attribute__((swift_name("thirtyThree"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TypeOuter"))) +@interface KtTypeOuter : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TypeOuter.Type_"))) +@interface KtTypeOuterType_ : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@property (readonly) int32_t thirtyFour __attribute__((swift_name("thirtyFour"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("CKeywords"))) +@interface KtCKeywords : KtBase +- (instancetype)initWithFloat:(float)float_ enum:(int32_t)enum_ goto:(BOOL)goto_ __attribute__((swift_name("init(float:enum:goto:)"))) __attribute__((objc_designated_initializer)); +- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)"))); +- (NSUInteger)hash __attribute__((swift_name("hash()"))); +- (NSString *)description __attribute__((swift_name("description()"))); +- (float)component1 __attribute__((swift_name("component1()"))); +- (int32_t)component2 __attribute__((swift_name("component2()"))); +- (BOOL)component3 __attribute__((swift_name("component3()"))); +- (KtCKeywords *)doCopyFloat:(float)float_ enum:(int32_t)enum_ goto:(BOOL)goto_ __attribute__((swift_name("doCopy(float:enum:goto:)"))); +@property (readonly, getter=float) float float_ __attribute__((swift_name("float_"))); +@property (readonly, getter=enum) int32_t enum_ __attribute__((swift_name("enum_"))); +@property (getter=goto, setter=setGoto:) BOOL goto_ __attribute__((swift_name("goto_"))); +@end; + +__attribute__((swift_name("Base1"))) +@protocol KtBase1 +@required +- (KtInt * _Nullable)sameValue:(KtInt * _Nullable)value __attribute__((swift_name("same(value:)"))); +@end; + +__attribute__((swift_name("ExtendedBase1"))) +@protocol KtExtendedBase1 +@required +@end; + +__attribute__((swift_name("Base2"))) +@protocol KtBase2 +@required +- (KtInt * _Nullable)sameValue:(KtInt * _Nullable)value __attribute__((swift_name("same(value:)"))); +@end; + +__attribute__((swift_name("Base23"))) +@interface KtBase23 : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (KtInt *)sameValue:(KtInt * _Nullable)value __attribute__((swift_name("same(value:)"))); +@end; + +__attribute__((swift_name("Transform"))) +@protocol KtTransform +@required +- (id _Nullable)mapValue:(id _Nullable)value __attribute__((swift_name("map(value:)"))); +@end; + +__attribute__((swift_name("TransformWithDefault"))) +@protocol KtTransformWithDefault +@required +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TransformInheritingDefault"))) +@interface KtTransformInheritingDefault : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((swift_name("TransformIntString"))) +@protocol KtTransformIntString +@required +- (NSString *)mapIntValue:(int32_t)intValue __attribute__((swift_name("map(intValue:)"))); +@end; + +__attribute__((swift_name("TransformIntToString"))) +@interface KtTransformIntToString : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (NSString *)mapValue:(KtInt *)intValue __attribute__((swift_name("map(value:)"))); +- (NSString *)mapIntValue:(int32_t)intValue __attribute__((swift_name("map(intValue:)"))); +@end; + +__attribute__((swift_name("TransformIntToDecimalString"))) +@interface KtTransformIntToDecimalString : KtTransformIntToString +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (NSString *)mapValue:(KtInt *)intValue __attribute__((swift_name("map(value:)"))); +- (NSString *)mapIntValue:(int32_t)intValue __attribute__((swift_name("map(intValue:)"))); +@end; + +__attribute__((swift_name("TransformIntToLong"))) +@interface KtTransformIntToLong : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (KtLong *)mapValue:(KtInt *)value __attribute__((swift_name("map(value:)"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("GH2931"))) +@interface KtGH2931 : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("GH2931.Data"))) +@interface KtGH2931Data : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("GH2931.Holder"))) +@interface KtGH2931Holder : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@property (readonly) KtGH2931Data *data __attribute__((swift_name("data"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("GH2945"))) +@interface KtGH2945 : KtBase +- (instancetype)initWithErrno:(int32_t)errno __attribute__((swift_name("init(errno:)"))) __attribute__((objc_designated_initializer)); +- (int32_t)testErrnoInSelectorP:(int32_t)p errno:(int32_t)errno __attribute__((swift_name("testErrnoInSelector(p:errno:)"))); +@property int32_t errno __attribute__((swift_name("errno"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("GH2830"))) +@interface KtGH2830 : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (id)getI __attribute__((swift_name("getI()"))); +@end; + +__attribute__((swift_name("GH2830I"))) +@protocol KtGH2830I +@required +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("GH2959"))) +@interface KtGH2959 : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (NSArray> *)getIId:(int32_t)id __attribute__((swift_name("getI(id:)"))); +@end; + +__attribute__((swift_name("GH2959I"))) +@protocol KtGH2959I +@required +@property (readonly) int32_t id __attribute__((swift_name("id"))); +@end; + +__attribute__((swift_name("IntBlocks"))) +@protocol KtIntBlocks +@required +- (id _Nullable)getPlusOneBlock __attribute__((swift_name("getPlusOneBlock()"))); +- (int32_t)callBlockArgument:(int32_t)argument block:(id _Nullable)block __attribute__((swift_name("callBlock(argument:block:)"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("IntBlocksImpl"))) +@interface KtIntBlocksImpl : KtBase ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); ++ (instancetype)intBlocksImpl __attribute__((swift_name("init()"))); +- (KtInt *(^)(KtInt *))getPlusOneBlock __attribute__((swift_name("getPlusOneBlock()"))); +- (int32_t)callBlockArgument:(int32_t)argument block:(KtInt *(^)(KtInt *))block __attribute__((swift_name("callBlock(argument:block:)"))); +@end; + +__attribute__((swift_name("UnitBlockCoercion"))) +@protocol KtUnitBlockCoercion +@required +- (id)coerceBlock:(void (^)(void))block __attribute__((swift_name("coerce(block:)"))); +- (void (^)(void))uncoerceBlock:(id)block __attribute__((swift_name("uncoerce(block:)"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("UnitBlockCoercionImpl"))) +@interface KtUnitBlockCoercionImpl : KtBase ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); ++ (instancetype)unitBlockCoercionImpl __attribute__((swift_name("init()"))); +- (KtKotlinUnit *(^)(void))coerceBlock:(void (^)(void))block __attribute__((swift_name("coerce(block:)"))); +- (void (^)(void))uncoerceBlock:(KtKotlinUnit *(^)(void))block __attribute__((swift_name("uncoerce(block:)"))); +@end; + +__attribute__((swift_name("MyAbstractList"))) +@interface KtMyAbstractList : NSObject +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestKClass"))) +@interface KtTestKClass : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (id _Nullable)getKotlinClassClazz:(Class)clazz __attribute__((swift_name("getKotlinClass(clazz:)"))); +- (id _Nullable)getKotlinClassProtocol:(Protocol *)protocol __attribute__((swift_name("getKotlinClass(protocol:)"))); +- (BOOL)isTestKClassKClass:(id)kClass __attribute__((swift_name("isTestKClass(kClass:)"))); +- (BOOL)isIKClass:(id)kClass __attribute__((swift_name("isI(kClass:)"))); +@end; + +__attribute__((swift_name("TestKClassI"))) +@protocol KtTestKClassI +@required +@end; + +__attribute__((swift_name("ForwardI2"))) +@protocol KtForwardI2 +@required +@end; + +__attribute__((swift_name("ForwardI1"))) +@protocol KtForwardI1 +@required +- (id)getForwardI2 __attribute__((swift_name("getForwardI2()"))); +@end; + +__attribute__((swift_name("ForwardC2"))) +@interface KtForwardC2 : KtForwardC1 +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((swift_name("ForwardC1"))) +@interface KtForwardC1 : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (KtForwardC2 *)getForwardC2 __attribute__((swift_name("getForwardC2()"))); +@end; + +__attribute__((swift_name("TestSR10177Workaround"))) +@protocol KtTestSR10177Workaround +@required +@end; + +__attribute__((swift_name("TestClashes1"))) +@protocol KtTestClashes1 +@required +@property (readonly) int32_t clashingProperty __attribute__((swift_name("clashingProperty"))); +@end; + +__attribute__((swift_name("TestClashes2"))) +@protocol KtTestClashes2 +@required +@property (readonly) id clashingProperty __attribute__((swift_name("clashingProperty"))); +@property (readonly) id clashingProperty_ __attribute__((swift_name("clashingProperty_"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestClashesImpl"))) +@interface KtTestClashesImpl : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@property (readonly) int32_t clashingProperty __attribute__((swift_name("clashingProperty"))); +@property (readonly) KtInt *clashingProperty_ __attribute__((swift_name("clashingProperty_"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestInvalidIdentifiers"))) +@interface KtTestInvalidIdentifiers : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (int32_t)a_d_d_1:(int32_t)_1 _2:(int32_t)_2 _3:(int32_t)_3 __attribute__((swift_name("a_d_d(_1:_2:_3:)"))); +@property NSString *_status __attribute__((swift_name("_status"))); +@property (readonly) unichar __ __attribute__((swift_name("__"))); +@property (readonly) unichar __ __attribute__((swift_name("__"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestInvalidIdentifiers._Foo"))) +@interface KtTestInvalidIdentifiers_Foo : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestInvalidIdentifiers.Bar_"))) +@interface KtTestInvalidIdentifiersBar_ : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestInvalidIdentifiers.E"))) +@interface KtTestInvalidIdentifiersE : KtKotlinEnum ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); +- (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal __attribute__((swift_name("init(name:ordinal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +@property (class, readonly) KtTestInvalidIdentifiersE *_4_ __attribute__((swift_name("_4_"))); +@property (class, readonly) KtTestInvalidIdentifiersE *_5_ __attribute__((swift_name("_5_"))); +@property (class, readonly) KtTestInvalidIdentifiersE *__ __attribute__((swift_name("__"))); +@property (class, readonly) KtTestInvalidIdentifiersE *__ __attribute__((swift_name("__"))); ++ (KtKotlinArray *)values __attribute__((swift_name("values()"))); +@property (readonly) int32_t value __attribute__((swift_name("value"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestInvalidIdentifiers.Companion_"))) +@interface KtTestInvalidIdentifiersCompanion_ : KtBase ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); ++ (instancetype)companion_ __attribute__((swift_name("init()"))); +@property (readonly) int32_t _42 __attribute__((swift_name("_42"))); +@end; + +__attribute__((swift_name("TestDeprecation"))) +@interface KtTestDeprecation : KtBase +- (instancetype)initWithError:(int16_t)error __attribute__((swift_name("init(error:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable("error"))); +- (instancetype)initWithWarning:(int32_t)warning __attribute__((swift_name("init(warning:)"))) __attribute__((objc_designated_initializer)) __attribute__((deprecated("warning"))); +- (instancetype)initWithNormal:(int64_t)normal __attribute__((swift_name("init(normal:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (int32_t)callEffectivelyHiddenObj:(id)obj __attribute__((swift_name("callEffectivelyHidden(obj:)"))); +- (id)getHidden __attribute__((swift_name("getHidden()"))); +- (KtTestDeprecationError *)getError __attribute__((swift_name("getError()"))); +- (void)error __attribute__((swift_name("error()"))) __attribute__((unavailable("error"))); +- (void)openError __attribute__((swift_name("openError()"))) __attribute__((unavailable("error"))); +- (KtTestDeprecationWarning *)getWarning __attribute__((swift_name("getWarning()"))); +- (void)warning __attribute__((swift_name("warning()"))) __attribute__((deprecated("warning"))); +- (void)openWarning __attribute__((swift_name("openWarning()"))) __attribute__((deprecated("warning"))); +- (void)normal __attribute__((swift_name("normal()"))); +- (int32_t)openNormal __attribute__((swift_name("openNormal()"))); +- (void)testHiddenNested:(id)hiddenNested __attribute__((swift_name("test(hiddenNested:)"))); +- (void)testHiddenNestedNested:(id)hiddenNestedNested __attribute__((swift_name("test(hiddenNestedNested:)"))); +- (void)testHiddenNestedInner:(id)hiddenNestedInner __attribute__((swift_name("test(hiddenNestedInner:)"))); +- (void)testHiddenInner:(id)hiddenInner __attribute__((swift_name("test(hiddenInner:)"))); +- (void)testHiddenInnerInner:(id)hiddenInnerInner __attribute__((swift_name("test(hiddenInnerInner:)"))); +- (void)testTopLevelHidden:(id)topLevelHidden __attribute__((swift_name("test(topLevelHidden:)"))); +- (void)testTopLevelHiddenNested:(id)topLevelHiddenNested __attribute__((swift_name("test(topLevelHiddenNested:)"))); +- (void)testTopLevelHiddenNestedNested:(id)topLevelHiddenNestedNested __attribute__((swift_name("test(topLevelHiddenNestedNested:)"))); +- (void)testTopLevelHiddenNestedInner:(id)topLevelHiddenNestedInner __attribute__((swift_name("test(topLevelHiddenNestedInner:)"))); +- (void)testTopLevelHiddenInner:(id)topLevelHiddenInner __attribute__((swift_name("test(topLevelHiddenInner:)"))); +- (void)testTopLevelHiddenInnerInner:(id)topLevelHiddenInnerInner __attribute__((swift_name("test(topLevelHiddenInnerInner:)"))); +- (void)testExtendingHiddenNested:(id)extendingHiddenNested __attribute__((swift_name("test(extendingHiddenNested:)"))); +- (void)testExtendingNestedInHidden:(id)extendingNestedInHidden __attribute__((swift_name("test(extendingNestedInHidden:)"))); +@property (readonly) id _Nullable errorVal __attribute__((swift_name("errorVal"))) __attribute__((unavailable("error"))); +@property id _Nullable errorVar __attribute__((swift_name("errorVar"))) __attribute__((unavailable("error"))); +@property (readonly) id _Nullable openErrorVal __attribute__((swift_name("openErrorVal"))) __attribute__((unavailable("error"))); +@property id _Nullable openErrorVar __attribute__((swift_name("openErrorVar"))) __attribute__((unavailable("error"))); +@property (readonly) id _Nullable warningVal __attribute__((swift_name("warningVal"))) __attribute__((deprecated("warning"))); +@property id _Nullable warningVar __attribute__((swift_name("warningVar"))) __attribute__((deprecated("warning"))); +@property (readonly) id _Nullable openWarningVal __attribute__((swift_name("openWarningVal"))) __attribute__((deprecated("warning"))); +@property id _Nullable openWarningVar __attribute__((swift_name("openWarningVar"))) __attribute__((deprecated("warning"))); +@property (readonly) id _Nullable normalVal __attribute__((swift_name("normalVal"))); +@property id _Nullable normalVar __attribute__((swift_name("normalVar"))); +@property (readonly) id _Nullable openNormalVal __attribute__((swift_name("openNormalVal"))); +@property id _Nullable openNormalVar __attribute__((swift_name("openNormalVar"))); +@end; + +__attribute__((swift_name("TestDeprecation.OpenHidden"))) +@interface KtTestDeprecationOpenHidden : NSObject +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestDeprecation.ExtendingHidden"))) +@interface KtTestDeprecationExtendingHidden : NSObject +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestDeprecation.ExtendingHiddenNested"))) +@interface KtTestDeprecationExtendingHiddenNested : NSObject +@end; + +__attribute__((swift_name("TestDeprecationHiddenInterface"))) +@protocol KtTestDeprecationHiddenInterface +@required +@end; + +__attribute__((swift_name("TestDeprecation.ImplementingHidden"))) +@interface KtTestDeprecationImplementingHidden : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (int32_t)effectivelyHidden __attribute__((swift_name("effectivelyHidden()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestDeprecation.Hidden"))) +@interface KtTestDeprecationHidden : NSObject +@end; + +__attribute__((swift_name("TestDeprecation.HiddenNested"))) +@interface KtTestDeprecationHiddenNested : NSObject +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestDeprecation.HiddenNestedNested"))) +@interface KtTestDeprecationHiddenNestedNested : NSObject +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestDeprecation.HiddenNestedInner"))) +@interface KtTestDeprecationHiddenNestedInner : NSObject +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestDeprecation.HiddenInner"))) +@interface KtTestDeprecationHiddenInner : NSObject +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestDeprecation.HiddenInnerInner"))) +@interface KtTestDeprecationHiddenInnerInner : NSObject +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestDeprecation.ExtendingNestedInHidden"))) +@interface KtTestDeprecationExtendingNestedInHidden : NSObject +@end; + +__attribute__((swift_name("TestDeprecation.OpenError"))) +@interface KtTestDeprecationOpenError : KtTestDeprecation +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable("error"))); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithError:(int16_t)error __attribute__((swift_name("init(error:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithWarning:(int32_t)warning __attribute__((swift_name("init(warning:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithNormal:(int64_t)normal __attribute__((swift_name("init(normal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestDeprecation.ExtendingError"))) +@interface KtTestDeprecationExtendingError : KtTestDeprecationOpenError +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((swift_name("TestDeprecationErrorInterface"))) +@protocol KtTestDeprecationErrorInterface +@required +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestDeprecation.ImplementingError"))) +@interface KtTestDeprecationImplementingError : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestDeprecation.Error"))) +@interface KtTestDeprecationError : KtTestDeprecation +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable("error"))); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithError:(int16_t)error __attribute__((swift_name("init(error:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithWarning:(int32_t)warning __attribute__((swift_name("init(warning:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithNormal:(int64_t)normal __attribute__((swift_name("init(normal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +@end; + +__attribute__((swift_name("TestDeprecation.OpenWarning"))) +@interface KtTestDeprecationOpenWarning : KtTestDeprecation +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((deprecated("warning"))); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithError:(int16_t)error __attribute__((swift_name("init(error:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithWarning:(int32_t)warning __attribute__((swift_name("init(warning:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithNormal:(int64_t)normal __attribute__((swift_name("init(normal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestDeprecation.ExtendingWarning"))) +@interface KtTestDeprecationExtendingWarning : KtTestDeprecationOpenWarning +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((swift_name("TestDeprecationWarningInterface"))) +@protocol KtTestDeprecationWarningInterface +@required +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestDeprecation.ImplementingWarning"))) +@interface KtTestDeprecationImplementingWarning : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestDeprecation.Warning"))) +@interface KtTestDeprecationWarning : KtTestDeprecation +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((deprecated("warning"))); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithError:(int16_t)error __attribute__((swift_name("init(error:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithWarning:(int32_t)warning __attribute__((swift_name("init(warning:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithNormal:(int64_t)normal __attribute__((swift_name("init(normal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestDeprecation.HiddenOverride"))) +@interface KtTestDeprecationHiddenOverride : KtTestDeprecation +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithError:(int16_t)error __attribute__((swift_name("init(error:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithWarning:(int32_t)warning __attribute__((swift_name("init(warning:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithNormal:(int64_t)normal __attribute__((swift_name("init(normal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (void)openError __attribute__((swift_name("openError()"))) __attribute__((unavailable("hidden"))); +- (void)openWarning __attribute__((swift_name("openWarning()"))) __attribute__((unavailable("hidden"))); +- (int32_t)openNormal __attribute__((swift_name("openNormal()"))) __attribute__((unavailable("hidden"))); +@property (readonly) id _Nullable openErrorVal __attribute__((swift_name("openErrorVal"))) __attribute__((unavailable("hidden"))); +@property id _Nullable openErrorVar __attribute__((swift_name("openErrorVar"))) __attribute__((unavailable("hidden"))); +@property (readonly) id _Nullable openWarningVal __attribute__((swift_name("openWarningVal"))) __attribute__((unavailable("hidden"))); +@property id _Nullable openWarningVar __attribute__((swift_name("openWarningVar"))) __attribute__((unavailable("hidden"))); +@property (readonly) id _Nullable openNormalVal __attribute__((swift_name("openNormalVal"))) __attribute__((unavailable("hidden"))); +@property id _Nullable openNormalVar __attribute__((swift_name("openNormalVar"))) __attribute__((unavailable("hidden"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestDeprecation.ErrorOverride"))) +@interface KtTestDeprecationErrorOverride : KtTestDeprecation +- (instancetype)initWithHidden:(int8_t)hidden __attribute__((swift_name("init(hidden:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable("error"))); +- (instancetype)initWithError:(int16_t)error __attribute__((swift_name("init(error:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable("error"))); +- (instancetype)initWithWarning:(int32_t)warning __attribute__((swift_name("init(warning:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable("error"))); +- (instancetype)initWithNormal:(int64_t)normal __attribute__((swift_name("init(normal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable("error"))); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (void)openHidden __attribute__((swift_name("openHidden()"))) __attribute__((unavailable("error"))); +- (void)openError __attribute__((swift_name("openError()"))) __attribute__((unavailable("error"))); +- (void)openWarning __attribute__((swift_name("openWarning()"))) __attribute__((unavailable("error"))); +- (int32_t)openNormal __attribute__((swift_name("openNormal()"))) __attribute__((unavailable("error"))); +@property (readonly) id _Nullable openHiddenVal __attribute__((swift_name("openHiddenVal"))) __attribute__((unavailable("error"))); +@property id _Nullable openHiddenVar __attribute__((swift_name("openHiddenVar"))) __attribute__((unavailable("error"))); +@property (readonly) id _Nullable openErrorVal __attribute__((swift_name("openErrorVal"))) __attribute__((unavailable("error"))); +@property id _Nullable openErrorVar __attribute__((swift_name("openErrorVar"))) __attribute__((unavailable("error"))); +@property (readonly) id _Nullable openWarningVal __attribute__((swift_name("openWarningVal"))) __attribute__((unavailable("error"))); +@property id _Nullable openWarningVar __attribute__((swift_name("openWarningVar"))) __attribute__((unavailable("error"))); +@property (readonly) id _Nullable openNormalVal __attribute__((swift_name("openNormalVal"))) __attribute__((unavailable("error"))); +@property id _Nullable openNormalVar __attribute__((swift_name("openNormalVar"))) __attribute__((unavailable("error"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestDeprecation.WarningOverride"))) +@interface KtTestDeprecationWarningOverride : KtTestDeprecation +- (instancetype)initWithHidden:(int8_t)hidden __attribute__((swift_name("init(hidden:)"))) __attribute__((objc_designated_initializer)) __attribute__((deprecated("warning"))); +- (instancetype)initWithError:(int16_t)error __attribute__((swift_name("init(error:)"))) __attribute__((objc_designated_initializer)) __attribute__((deprecated("warning"))); +- (instancetype)initWithWarning:(int32_t)warning __attribute__((swift_name("init(warning:)"))) __attribute__((objc_designated_initializer)) __attribute__((deprecated("warning"))); +- (instancetype)initWithNormal:(int64_t)normal __attribute__((swift_name("init(normal:)"))) __attribute__((objc_designated_initializer)) __attribute__((deprecated("warning"))); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (void)openHidden __attribute__((swift_name("openHidden()"))) __attribute__((deprecated("warning"))); +- (void)openError __attribute__((swift_name("openError()"))) __attribute__((deprecated("warning"))); +- (void)openWarning __attribute__((swift_name("openWarning()"))) __attribute__((deprecated("warning"))); +- (int32_t)openNormal __attribute__((swift_name("openNormal()"))) __attribute__((deprecated("warning"))); +@property (readonly) id _Nullable openHiddenVal __attribute__((swift_name("openHiddenVal"))) __attribute__((deprecated("warning"))); +@property id _Nullable openHiddenVar __attribute__((swift_name("openHiddenVar"))) __attribute__((deprecated("warning"))); +@property (readonly) id _Nullable openErrorVal __attribute__((swift_name("openErrorVal"))) __attribute__((deprecated("warning"))); +@property id _Nullable openErrorVar __attribute__((swift_name("openErrorVar"))) __attribute__((deprecated("warning"))); +@property (readonly) id _Nullable openWarningVal __attribute__((swift_name("openWarningVal"))) __attribute__((deprecated("warning"))); +@property id _Nullable openWarningVar __attribute__((swift_name("openWarningVar"))) __attribute__((deprecated("warning"))); +@property (readonly) id _Nullable openNormalVal __attribute__((swift_name("openNormalVal"))) __attribute__((deprecated("warning"))); +@property id _Nullable openNormalVar __attribute__((swift_name("openNormalVar"))) __attribute__((deprecated("warning"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestDeprecation.NormalOverride"))) +@interface KtTestDeprecationNormalOverride : KtTestDeprecation +- (instancetype)initWithHidden:(int8_t)hidden __attribute__((swift_name("init(hidden:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithError:(int16_t)error __attribute__((swift_name("init(error:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithWarning:(int32_t)warning __attribute__((swift_name("init(warning:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithNormal:(int64_t)normal __attribute__((swift_name("init(normal:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (void)openError __attribute__((swift_name("openError()"))) __attribute__((unavailable("Overrides deprecated member in 'conversions.TestDeprecation'. error"))); +- (void)openWarning __attribute__((swift_name("openWarning()"))) __attribute__((deprecated("Overrides deprecated member in 'conversions.TestDeprecation'. warning"))); +- (int32_t)openNormal __attribute__((swift_name("openNormal()"))); +@property (readonly) id _Nullable openErrorVal __attribute__((swift_name("openErrorVal"))) __attribute__((unavailable("Overrides deprecated member in 'conversions.TestDeprecation'. error"))); +@property id _Nullable openErrorVar __attribute__((swift_name("openErrorVar"))) __attribute__((unavailable("Overrides deprecated member in 'conversions.TestDeprecation'. error"))); +@property (readonly) id _Nullable openWarningVal __attribute__((swift_name("openWarningVal"))) __attribute__((deprecated("Overrides deprecated member in 'conversions.TestDeprecation'. warning"))); +@property id _Nullable openWarningVar __attribute__((swift_name("openWarningVar"))) __attribute__((deprecated("Overrides deprecated member in 'conversions.TestDeprecation'. warning"))); +@property (readonly) id _Nullable openNormalVal __attribute__((swift_name("openNormalVal"))); +@property id _Nullable openNormalVar __attribute__((swift_name("openNormalVar"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TopLevelHidden"))) +@interface KtTopLevelHidden : NSObject +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TopLevelHidden.Nested"))) +@interface KtTopLevelHiddenNested : NSObject +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TopLevelHidden.NestedNested"))) +@interface KtTopLevelHiddenNestedNested : NSObject +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TopLevelHidden.NestedInner"))) +@interface KtTopLevelHiddenNestedInner : NSObject +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TopLevelHidden.Inner"))) +@interface KtTopLevelHiddenInner : NSObject +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TopLevelHidden.InnerInner"))) +@interface KtTopLevelHiddenInnerInner : NSObject +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestWeakRefs"))) +@interface KtTestWeakRefs : KtBase +- (instancetype)initWithFrozen:(BOOL)frozen __attribute__((swift_name("init(frozen:)"))) __attribute__((objc_designated_initializer)); +- (id)getObj __attribute__((swift_name("getObj()"))); +- (void)clearObj __attribute__((swift_name("clearObj()"))); +- (NSArray *)createCycle __attribute__((swift_name("createCycle()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("SharedRefs"))) +@interface KtSharedRefs : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (KtSharedRefsMutableData *)createRegularObject __attribute__((swift_name("createRegularObject()"))); +- (void (^)(void))createLambda __attribute__((swift_name("createLambda()"))); +- (NSMutableArray *)createCollection __attribute__((swift_name("createCollection()"))); +- (KtSharedRefsMutableData *)createFrozenRegularObject __attribute__((swift_name("createFrozenRegularObject()"))); +- (void (^)(void))createFrozenLambda __attribute__((swift_name("createFrozenLambda()"))); +- (NSMutableArray *)createFrozenCollection __attribute__((swift_name("createFrozenCollection()"))); +- (BOOL)hasAliveObjects __attribute__((swift_name("hasAliveObjects()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("SharedRefs.MutableData"))) +@interface KtSharedRefsMutableData : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (void)update __attribute__((swift_name("update()"))); +@property int32_t x __attribute__((swift_name("x"))); +@end; + +__attribute__((swift_name("TestRememberNewObject"))) +@protocol KtTestRememberNewObject +@required +- (id)getObject __attribute__((swift_name("getObject()"))); +- (void)waitForCleanup __attribute__((swift_name("waitForCleanup()"))); +@end; + +__attribute__((swift_name("ClassForTypeCheck"))) +@interface KtClassForTypeCheck : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((swift_name("InterfaceForTypeCheck"))) +@protocol KtInterfaceForTypeCheck +@required +@end; + +__attribute__((swift_name("IAbstractInterface"))) +@protocol KtIAbstractInterface +@required +- (int32_t)foo __attribute__((swift_name("foo()"))); +@end; + +__attribute__((swift_name("IAbstractInterface2"))) +@protocol KtIAbstractInterface2 +@required +- (int32_t)foo __attribute__((swift_name("foo()"))); +@end; + +__attribute__((swift_name("AbstractInterfaceBase"))) +@interface KtAbstractInterfaceBase : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (int32_t)foo __attribute__((swift_name("foo()"))); +- (int32_t)bar __attribute__((swift_name("bar()"))); +@end; + +__attribute__((swift_name("AbstractInterfaceBase2"))) +@interface KtAbstractInterfaceBase2 : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((swift_name("AbstractInterfaceBase3"))) +@interface KtAbstractInterfaceBase3 : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (int32_t)foo __attribute__((swift_name("foo()"))); +@end; + +__attribute__((swift_name("GH3525Base"))) +@interface KtGH3525Base : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("GH3525"))) +@interface KtGH3525 : KtGH3525Base ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); ++ (instancetype)new __attribute__((unavailable)); ++ (instancetype)gH3525 __attribute__((swift_name("init()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TestStringConversion"))) +@interface KtTestStringConversion : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@property id str __attribute__((swift_name("str"))); +@end; + +__attribute__((swift_name("GH3825"))) +@protocol KtGH3825 +@required + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (BOOL)call0AndReturnError:(NSError * _Nullable * _Nullable)error callback:(KtBoolean *(^)(void))callback __attribute__((swift_name("call0(callback:)"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (BOOL)call1DoThrow:(BOOL)doThrow error:(NSError * _Nullable * _Nullable)error callback:(void (^)(void))callback __attribute__((swift_name("call1(doThrow:callback:)"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (BOOL)call2Callback:(void (^)(void))callback doThrow:(BOOL)doThrow error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("call2(callback:doThrow:)"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("GH3825KotlinImpl"))) +@interface KtGH3825KotlinImpl : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (BOOL)call0AndReturnError:(NSError * _Nullable * _Nullable)error callback:(KtBoolean *(^)(void))callback __attribute__((swift_name("call0(callback:)"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (BOOL)call1DoThrow:(BOOL)doThrow error:(NSError * _Nullable * _Nullable)error callback:(void (^)(void))callback __attribute__((swift_name("call1(doThrow:callback:)"))); + +/** + @note This method converts instances of MyException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (BOOL)call2Callback:(void (^)(void))callback doThrow:(BOOL)doThrow error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("call2(callback:doThrow:)"))); +@end; + +__attribute__((swift_name("Foo_FakeOverrideInInterface"))) +@protocol KtFoo_FakeOverrideInInterface +@required +- (void)fooT:(id _Nullable)t __attribute__((swift_name("foo(t:)"))); +@end; + +__attribute__((swift_name("Bar_FakeOverrideInInterface"))) +@protocol KtBar_FakeOverrideInInterface +@required +@end; + +@interface KtEnumeration (ValuesKt) +- (KtEnumeration *)getAnswer __attribute__((swift_name("getAnswer()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("ValuesKt"))) +@interface KtValuesKt : KtBase ++ (KtBoolean * _Nullable)boxBooleanValue:(BOOL)booleanValue __attribute__((swift_name("box(booleanValue:)"))); ++ (KtByte * _Nullable)boxByteValue:(int8_t)byteValue __attribute__((swift_name("box(byteValue:)"))); ++ (KtShort * _Nullable)boxShortValue:(int16_t)shortValue __attribute__((swift_name("box(shortValue:)"))); ++ (KtInt * _Nullable)boxIntValue:(int32_t)intValue __attribute__((swift_name("box(intValue:)"))); ++ (KtLong * _Nullable)boxLongValue:(int64_t)longValue __attribute__((swift_name("box(longValue:)"))); ++ (KtUByte * _Nullable)boxUByteValue:(uint8_t)uByteValue __attribute__((swift_name("box(uByteValue:)"))); ++ (KtUShort * _Nullable)boxUShortValue:(uint16_t)uShortValue __attribute__((swift_name("box(uShortValue:)"))); ++ (KtUInt * _Nullable)boxUIntValue:(uint32_t)uIntValue __attribute__((swift_name("box(uIntValue:)"))); ++ (KtULong * _Nullable)boxULongValue:(uint64_t)uLongValue __attribute__((swift_name("box(uLongValue:)"))); ++ (KtFloat * _Nullable)boxFloatValue:(float)floatValue __attribute__((swift_name("box(floatValue:)"))); ++ (KtDouble * _Nullable)boxDoubleValue:(double)doubleValue __attribute__((swift_name("box(doubleValue:)"))); ++ (void)ensureEqualBooleansActual:(KtBoolean * _Nullable)actual expected:(BOOL)expected __attribute__((swift_name("ensureEqualBooleans(actual:expected:)"))); ++ (void)ensureEqualBytesActual:(KtByte * _Nullable)actual expected:(int8_t)expected __attribute__((swift_name("ensureEqualBytes(actual:expected:)"))); ++ (void)ensureEqualShortsActual:(KtShort * _Nullable)actual expected:(int16_t)expected __attribute__((swift_name("ensureEqualShorts(actual:expected:)"))); ++ (void)ensureEqualIntsActual:(KtInt * _Nullable)actual expected:(int32_t)expected __attribute__((swift_name("ensureEqualInts(actual:expected:)"))); ++ (void)ensureEqualLongsActual:(KtLong * _Nullable)actual expected:(int64_t)expected __attribute__((swift_name("ensureEqualLongs(actual:expected:)"))); ++ (void)ensureEqualUBytesActual:(KtUByte * _Nullable)actual expected:(uint8_t)expected __attribute__((swift_name("ensureEqualUBytes(actual:expected:)"))); ++ (void)ensureEqualUShortsActual:(KtUShort * _Nullable)actual expected:(uint16_t)expected __attribute__((swift_name("ensureEqualUShorts(actual:expected:)"))); ++ (void)ensureEqualUIntsActual:(KtUInt * _Nullable)actual expected:(uint32_t)expected __attribute__((swift_name("ensureEqualUInts(actual:expected:)"))); ++ (void)ensureEqualULongsActual:(KtULong * _Nullable)actual expected:(uint64_t)expected __attribute__((swift_name("ensureEqualULongs(actual:expected:)"))); ++ (void)ensureEqualFloatsActual:(KtFloat * _Nullable)actual expected:(float)expected __attribute__((swift_name("ensureEqualFloats(actual:expected:)"))); ++ (void)ensureEqualDoublesActual:(KtDouble * _Nullable)actual expected:(double)expected __attribute__((swift_name("ensureEqualDoubles(actual:expected:)"))); ++ (void)emptyFun __attribute__((swift_name("emptyFun()"))); ++ (NSString *)strFun __attribute__((swift_name("strFun()"))); ++ (id)argsFunI:(int32_t)i l:(int64_t)l d:(double)d s:(NSString *)s __attribute__((swift_name("argsFun(i:l:d:s:)"))); ++ (NSString *)funArgumentFoo:(NSString *(^)(void))foo __attribute__((swift_name("funArgument(foo:)"))); ++ (id _Nullable)genericFooT:(id _Nullable)t foo:(id _Nullable (^)(id _Nullable))foo __attribute__((swift_name("genericFoo(t:foo:)"))); ++ (id)fooGenericNumberR:(id)r foo:(id (^)(id))foo __attribute__((swift_name("fooGenericNumber(r:foo:)"))); ++ (NSArray *)varargToListArgs:(KtKotlinArray *)args __attribute__((swift_name("varargToList(args:)"))); ++ (NSString *)subExt:(NSString *)receiver i:(int32_t)i __attribute__((swift_name("subExt(_:i:)"))); ++ (NSString *)toString:(id _Nullable)receiver __attribute__((swift_name("toString(_:)"))); ++ (void)print:(id _Nullable)receiver __attribute__((swift_name("print(_:)"))); ++ (id _Nullable)boxChar:(unichar)receiver __attribute__((swift_name("boxChar(_:)"))); ++ (BOOL)isA:(id _Nullable)receiver __attribute__((swift_name("isA(_:)"))); ++ (NSString *)iFunExt:(id)receiver __attribute__((swift_name("iFunExt(_:)"))); ++ (KtEnumeration *)passEnum __attribute__((swift_name("passEnum()"))); ++ (void)receiveEnumE:(int32_t)e __attribute__((swift_name("receiveEnum(e:)"))); ++ (KtEnumeration *)getValue:(int32_t)value __attribute__((swift_name("get(value:)"))); ++ (KtWithCompanionAndObjectCompanion *)getCompanionObject __attribute__((swift_name("getCompanionObject()"))); ++ (KtWithCompanionAndObjectNamed *)getNamedObject __attribute__((swift_name("getNamedObject()"))); ++ (KtOpenClassI *)getNamedObjectInterface __attribute__((swift_name("getNamedObjectInterface()"))); ++ (id)boxIc1:(int32_t)ic1 __attribute__((swift_name("box(ic1:)"))); ++ (id)boxIc2:(id)ic2 __attribute__((swift_name("box(ic2:)"))); ++ (id)boxIc3:(id _Nullable)ic3 __attribute__((swift_name("box(ic3:)"))); ++ (NSString *)concatenateInlineClassValuesIc1:(int32_t)ic1 ic1N:(id _Nullable)ic1N ic2:(id)ic2 ic2N:(id _Nullable)ic2N ic3:(id _Nullable)ic3 ic3N:(id _Nullable)ic3N __attribute__((swift_name("concatenateInlineClassValues(ic1:ic1N:ic2:ic2N:ic3:ic3N:)"))); ++ (int32_t)getValue1:(int32_t)receiver __attribute__((swift_name("getValue1(_:)"))); ++ (KtInt * _Nullable)getValueOrNull1:(id _Nullable)receiver __attribute__((swift_name("getValueOrNull1(_:)"))); ++ (NSString *)getValue2:(id)receiver __attribute__((swift_name("getValue2(_:)"))); ++ (NSString * _Nullable)getValueOrNull2:(id _Nullable)receiver __attribute__((swift_name("getValueOrNull2(_:)"))); ++ (KtTripleVals * _Nullable)getValue3:(id _Nullable)receiver __attribute__((swift_name("getValue3(_:)"))); ++ (KtTripleVals * _Nullable)getValueOrNull3:(id _Nullable)receiver __attribute__((swift_name("getValueOrNull3(_:)"))); ++ (BOOL)isFrozenObj:(id)obj __attribute__((swift_name("isFrozen(obj:)"))); ++ (id)kotlinLambdaBlock:(id (^)(id))block __attribute__((swift_name("kotlinLambda(block:)"))); ++ (int64_t)multiplyInt:(int32_t)int_ long:(int64_t)long_ __attribute__((swift_name("multiply(int:long:)"))); + +/** + @note This method converts instances of MyException, MyError to errors. + Other uncaught Kotlin exceptions are fatal. +*/ ++ (BOOL)throwExceptionError:(BOOL)error error:(NSError * _Nullable * _Nullable)error_ __attribute__((swift_name("throwException(error:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ ++ (KtKotlinObjCErrorException * _Nullable)testSwiftThrowingMethods:(id)methods error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("testSwiftThrowing(methods:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ ++ (BOOL)testSwiftNotThrowingMethods:(id)methods error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("testSwiftNotThrowing(methods:)"))); + +/** + @note This method converts instances of MyError to errors. + Other uncaught Kotlin exceptions are fatal. +*/ ++ (BOOL)callUnitMethods:(id)methods error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("callUnit(methods:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ ++ (BOOL)callUnitCallerCaller:(id)caller methods:(id)methods error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("callUnitCaller(caller:methods:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ ++ (BOOL)testSwiftThrowingTest:(id)test flag:(BOOL)flag error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("testSwiftThrowing(test:flag:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ ++ (BOOL)testSwiftNotThrowingTest:(id)test error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("testSwiftNotThrowing(test:)"))); ++ (id)same:(id)receiver __attribute__((swift_name("same(_:)"))); ++ (KtInt * _Nullable)callBase1:(id)base1 value:(KtInt * _Nullable)value __attribute__((swift_name("call(base1:value:)"))); ++ (KtInt * _Nullable)callExtendedBase1:(id)extendedBase1 value:(KtInt * _Nullable)value __attribute__((swift_name("call(extendedBase1:value:)"))); ++ (KtInt * _Nullable)callBase2:(id)base2 value:(KtInt * _Nullable)value __attribute__((swift_name("call(base2:value:)"))); ++ (int32_t)callBase3:(id)base3 value:(KtInt * _Nullable)value __attribute__((swift_name("call(base3:value:)"))); ++ (int32_t)callBase23:(KtBase23 *)base23 value:(KtInt * _Nullable)value __attribute__((swift_name("call(base23:value:)"))); ++ (id)createTransformDecimalStringToInt __attribute__((swift_name("createTransformDecimalStringToInt()"))); ++ (BOOL)runUnitBlockBlock:(void (^)(void))block __attribute__((swift_name("runUnitBlock(block:)"))); ++ (void (^)(void))asUnitBlockBlock:(id _Nullable (^)(void))block __attribute__((swift_name("asUnitBlock(block:)"))); ++ (BOOL)runNothingBlockBlock:(void (^)(void))block __attribute__((swift_name("runNothingBlock(block:)"))); ++ (void (^)(void))asNothingBlockBlock:(id _Nullable (^)(void))block __attribute__((swift_name("asNothingBlock(block:)"))); ++ (void (^ _Nullable)(void))getNullBlock __attribute__((swift_name("getNullBlock()"))); ++ (BOOL)isBlockNullBlock:(void (^ _Nullable)(void))block __attribute__((swift_name("isBlockNull(block:)"))); ++ (BOOL)isFunctionObj:(id _Nullable)obj __attribute__((swift_name("isFunction(obj:)"))); ++ (BOOL)isFunction0Obj:(id _Nullable)obj __attribute__((swift_name("isFunction0(obj:)"))); ++ (void)takeForwardDeclaredClassObj:(ForwardDeclaredClass *)obj __attribute__((swift_name("takeForwardDeclaredClass(obj:)"))); ++ (void)takeForwardDeclaredProtocolObj:(id)obj __attribute__((swift_name("takeForwardDeclaredProtocol(obj:)"))); ++ (void)error __attribute__((swift_name("error()"))) __attribute__((unavailable("error"))); ++ (void)warning __attribute__((swift_name("warning()"))) __attribute__((deprecated("warning"))); ++ (void)gc __attribute__((swift_name("gc()"))); ++ (void)testRememberNewObjectTest:(id)test __attribute__((swift_name("testRememberNewObject(test:)"))); ++ (BOOL)testClassTypeCheckX:(id)x __attribute__((swift_name("testClassTypeCheck(x:)"))); ++ (BOOL)testInterfaceTypeCheckX:(id)x __attribute__((swift_name("testInterfaceTypeCheck(x:)"))); ++ (int32_t)testAbstractInterfaceCallX:(id)x __attribute__((swift_name("testAbstractInterfaceCall(x:)"))); ++ (int32_t)testAbstractInterfaceCall2X:(id)x __attribute__((swift_name("testAbstractInterfaceCall2(x:)"))); ++ (void)fooA:(KtKotlinAtomicReference *)a __attribute__((swift_name("foo(a:)"))); + +/** + @note This method converts all Kotlin exceptions to errors. +*/ ++ (BOOL)testGH3825Gh3825:(id)gh3825 error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("testGH3825(gh3825:)"))); ++ (NSDictionary *)mapBoolean2String __attribute__((swift_name("mapBoolean2String()"))); ++ (NSDictionary *)mapByte2Short __attribute__((swift_name("mapByte2Short()"))); ++ (NSDictionary *)mapShort2Byte __attribute__((swift_name("mapShort2Byte()"))); ++ (NSDictionary *)mapInt2Long __attribute__((swift_name("mapInt2Long()"))); ++ (NSDictionary *)mapLong2Long __attribute__((swift_name("mapLong2Long()"))); ++ (NSDictionary *)mapUByte2Boolean __attribute__((swift_name("mapUByte2Boolean()"))); ++ (NSDictionary *)mapUShort2Byte __attribute__((swift_name("mapUShort2Byte()"))); ++ (NSDictionary *)mapUInt2Long __attribute__((swift_name("mapUInt2Long()"))); ++ (NSDictionary *)mapULong2Long __attribute__((swift_name("mapULong2Long()"))); ++ (NSDictionary *)mapFloat2Float __attribute__((swift_name("mapFloat2Float()"))); ++ (NSDictionary *)mapDouble2String __attribute__((swift_name("mapDouble2String()"))); ++ (KtMutableDictionary *)mutBoolean2String __attribute__((swift_name("mutBoolean2String()"))); ++ (KtMutableDictionary *)mutByte2Short __attribute__((swift_name("mutByte2Short()"))); ++ (KtMutableDictionary *)mutShort2Byte __attribute__((swift_name("mutShort2Byte()"))); ++ (KtMutableDictionary *)mutInt2Long __attribute__((swift_name("mutInt2Long()"))); ++ (KtMutableDictionary *)mutLong2Long __attribute__((swift_name("mutLong2Long()"))); ++ (KtMutableDictionary *)mutUByte2Boolean __attribute__((swift_name("mutUByte2Boolean()"))); ++ (KtMutableDictionary *)mutUShort2Byte __attribute__((swift_name("mutUShort2Byte()"))); ++ (KtMutableDictionary *)mutUInt2Long __attribute__((swift_name("mutUInt2Long()"))); ++ (KtMutableDictionary *)mutULong2Long __attribute__((swift_name("mutULong2Long()"))); ++ (KtMutableDictionary *)mutFloat2Float __attribute__((swift_name("mutFloat2Float()"))); ++ (KtMutableDictionary *)mutDouble2String __attribute__((swift_name("mutDouble2String()"))); ++ (void)callFoo_FakeOverrideInInterfaceObj:(id)obj __attribute__((swift_name("callFoo_FakeOverrideInInterface(obj:)"))); +@property (class, readonly) double dbl __attribute__((swift_name("dbl"))); +@property (class, readonly) float flt __attribute__((swift_name("flt"))); +@property (class, readonly) int32_t integer __attribute__((swift_name("integer"))); +@property (class, readonly) int64_t longInt __attribute__((swift_name("longInt"))); +@property (class) int32_t intVar __attribute__((swift_name("intVar"))); +@property (class) NSString *str __attribute__((swift_name("str"))); +@property (class) id strAsAny __attribute__((swift_name("strAsAny"))); +@property (class) id minDoubleVal __attribute__((swift_name("minDoubleVal"))); +@property (class) id maxDoubleVal __attribute__((swift_name("maxDoubleVal"))); +@property (class, readonly) double nanDoubleVal __attribute__((swift_name("nanDoubleVal"))); +@property (class, readonly) float nanFloatVal __attribute__((swift_name("nanFloatVal"))); +@property (class, readonly) double infDoubleVal __attribute__((swift_name("infDoubleVal"))); +@property (class, readonly) float infFloatVal __attribute__((swift_name("infFloatVal"))); +@property (class, readonly) BOOL boolVal __attribute__((swift_name("boolVal"))); +@property (class, readonly) id boolAnyVal __attribute__((swift_name("boolAnyVal"))); +@property (class, readonly) NSArray *numbersList __attribute__((swift_name("numbersList"))); +@property (class, readonly) NSArray *anyList __attribute__((swift_name("anyList"))); +@property (class) id lateinitIntVar __attribute__((swift_name("lateinitIntVar"))); +@property (class, readonly) NSString *lazyVal __attribute__((swift_name("lazyVal"))); +@property (class) KtKotlinArray *delegatedGlobalArray __attribute__((swift_name("delegatedGlobalArray"))); +@property (class, readonly) NSArray *delegatedList __attribute__((swift_name("delegatedList"))); +@property (class, readonly) id _Nullable nullVal __attribute__((swift_name("nullVal"))); +@property (class) NSString * _Nullable nullVar __attribute__((swift_name("nullVar"))); +@property (class) id anyValue __attribute__((swift_name("anyValue"))); +@property (class, readonly) KtInt *(^sumLambda)(KtInt *, KtInt *) __attribute__((swift_name("sumLambda"))); +@property (class, readonly) int32_t PROPERTY_NAME_MUST_NOT_BE_ALTERED_BY_SWIFT __attribute__((swift_name("PROPERTY_NAME_MUST_NOT_BE_ALTERED_BY_SWIFT"))); +@property (class, readonly) id _Nullable errorVal __attribute__((swift_name("errorVal"))) __attribute__((unavailable("error"))); +@property (class) id _Nullable errorVar __attribute__((swift_name("errorVar"))) __attribute__((unavailable("error"))); +@property (class, readonly) id _Nullable warningVal __attribute__((swift_name("warningVal"))) __attribute__((deprecated("warning"))); +@property (class) id _Nullable warningVar __attribute__((swift_name("warningVar"))) __attribute__((deprecated("warning"))); +@property (class) int32_t gh3525BaseInitCount __attribute__((swift_name("gh3525BaseInitCount"))); +@property (class) int32_t gh3525InitCount __attribute__((swift_name("gh3525InitCount"))); +@end; + +__attribute__((swift_name("InvariantSuper"))) +@interface KtInvariantSuper : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Invariant"))) +@interface KtInvariant : KtInvariantSuper +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((swift_name("OutVariantSuper"))) +@interface KtOutVariantSuper : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("OutVariant"))) +@interface KtOutVariant : KtOutVariantSuper +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((swift_name("InVariantSuper"))) +@interface KtInVariantSuper : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("InVariant"))) +@interface KtInVariant : KtInVariantSuper +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@end; + diff --git a/kotlin-native/backend.native/tests/objcexport/headerWarnings.swift b/kotlin-native/backend.native/tests/objcexport/headerWarnings.swift index 7c23c799b82..9726b01fb07 100644 --- a/kotlin-native/backend.native/tests/objcexport/headerWarnings.swift +++ b/kotlin-native/backend.native/tests/objcexport/headerWarnings.swift @@ -9,6 +9,7 @@ import Kt // It is enough to have just Kotlin declarations at the moment. // Adding usages for all declarations to avoid any kind of DCE that may appear later. +#if !NO_GENERICS private func testIncompatiblePropertyType() throws { let c = TestIncompatiblePropertyTypeWarning.ClassOverridingInterfaceWithGenericProperty( p: TestIncompatiblePropertyTypeWarningGeneric(value: "cba") @@ -21,6 +22,7 @@ private func testIncompatiblePropertyType() throws { let pi: TestIncompatiblePropertyTypeWarningGeneric = i.p try assertEquals(actual: pi.value as! String, expected: "cba") } +#endif private func testGH3992() throws { let d = TestGH3992.D(a: TestGH3992.B()) @@ -36,7 +38,9 @@ class HeaderWarningsTests : SimpleTestProvider { override init() { super.init() +#if !NO_GENERICS test("TestIncompatiblePropertyType", testIncompatiblePropertyType) +#endif test("TestGH3992", testGH3992) } } \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/objcexport/values.swift b/kotlin-native/backend.native/tests/objcexport/values.swift index 2605878cd58..5d7f7b2cfe4 100644 --- a/kotlin-native/backend.native/tests/objcexport/values.swift +++ b/kotlin-native/backend.native/tests/objcexport/values.swift @@ -384,7 +384,11 @@ func testGenericsFoo() throws { } func testVararg() throws { +#if NO_GENERICS + let ktArray = KotlinArray(size: 3, init: { (_) -> NSNumber in return 42 }) +#else let ktArray = KotlinArray(size: 3, init: { (_) -> NSNumber in return 42 }) +#endif let arr: [Int] = ValuesKt.varargToList(args: ktArray) as! [Int] try assertEquals(actual: arr, expected: [42, 42, 42]) } @@ -507,13 +511,21 @@ func testDataClass() throws { let s = "2" let t = "3" +#if NO_GENERICS + let tripleVal = TripleVals(first: f as NSString, second: s as NSString, third: t as NSString) +#else let tripleVal = TripleVals(first: f as NSString, second: s as NSString, third: t as NSString) +#endif try assertEquals(actual: tripleVal.first as! String, expected: f, "Data class' value") try assertEquals(actual: tripleVal.component2() as! String, expected: s, "Data class' component") print(tripleVal) try assertEquals(actual: String(describing: tripleVal), expected: "TripleVals(first=\(f), second=\(s), third=\(t))") +#if NO_GENERICS + let tripleVar = TripleVars(first: f as NSString, second: s as NSString, third: t as NSString) +#else let tripleVar = TripleVars(first: f as NSString, second: s as NSString, third: t as NSString) +#endif try assertEquals(actual: tripleVar.first as! String, expected: f, "Data class' value") try assertEquals(actual: tripleVar.component2() as! String, expected: s, "Data class' component") print(tripleVar) @@ -542,7 +554,11 @@ func testInlineClasses() throws { let ic1N = ValuesKt.box(ic1: 17) let ic2 = "foo" let ic2N = "bar" +#if NO_GENERICS + let ic3 = TripleVals(first: 1, second: 2, third: 3) +#else let ic3 = TripleVals(first: 1, second: 2, third: 3) +#endif let ic3N = ValuesKt.box(ic3: nil) try assertEquals( @@ -609,7 +625,11 @@ func testPureSwiftClasses() throws { func testNames() throws { try assertEquals(actual: ValuesKt.PROPERTY_NAME_MUST_NOT_BE_ALTERED_BY_SWIFT, expected: 111) try assertEquals(actual: Deeply.NestedType().thirtyTwo, expected: 32) +#if NO_GENERICS + try assertEquals(actual: WithGenericDeeply.NestedType().thirtyThree, expected: 33) +#else try assertEquals(actual: WithGenericDeeplyNestedType().thirtyThree, expected: 33) +#endif try assertEquals(actual: CKeywords(float: 1.0, enum : 42, goto: true).goto_, expected: true) try assertEquals(actual: TypeOuter.Type_().thirtyFour, expected: 34) try assertTrue(String(describing: DeeplyNestedIType.self).hasSuffix("DeeplyNestedIType")) @@ -637,7 +657,11 @@ class TransformIntToLongCallingSuper : TransformIntToLong { } func testKotlinOverride() throws { +#if NO_GENERICS + try assertEquals(actual: TransformInheritingDefault().map(value: 1) as! Int32, expected: 1) +#else try assertEquals(actual: TransformInheritingDefault().map(value: 1) as! Int32, expected: 1) +#endif try assertEquals(actual: TransformIntToDecimalString().map(value: 2), expected: "2") try assertEquals(actual: TransformIntToDecimalString().map(intValue: 3), expected: "3") try assertEquals(actual: ValuesKt.createTransformDecimalStringToInt().map(value: "4") as! Int32, expected: 4) diff --git a/kotlin-native/backend.native/tests/objcexport/variance.kt b/kotlin-native/backend.native/tests/objcexport/variance.kt new file mode 100644 index 00000000000..9b838b34bcf --- /dev/null +++ b/kotlin-native/backend.native/tests/objcexport/variance.kt @@ -0,0 +1,15 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +package variance + +sealed class InvariantSuper +class Invariant : InvariantSuper() + +sealed class OutVariantSuper +class OutVariant : OutVariantSuper() + +sealed class InVariantSuper +class InVariant : InVariantSuper() diff --git a/kotlin-native/backend.native/tests/objcexport/variance.swift b/kotlin-native/backend.native/tests/objcexport/variance.swift new file mode 100644 index 00000000000..22612777e46 --- /dev/null +++ b/kotlin-native/backend.native/tests/objcexport/variance.swift @@ -0,0 +1,31 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +import Foundation +import Kt + +// -------- Tests -------- + +func testInstantiation() { +#if NO_GENERICS + Invariant() + OutVariant() + InVariant() +#else + Invariant() + OutVariant() + InVariant() +#endif +} + +// -------- Execution of the test -------- + +class VarianceTests : SimpleTestProvider { + override init() { + super.init() + + test("TestInstantiation", testInstantiation) + } +} \ No newline at end of file diff --git a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt index 147fa1070ea..96f811fff70 100644 --- a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt +++ b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt @@ -30,6 +30,9 @@ open class FrameworkTest : DefaultTask(), KonanTestExecutable { @Input lateinit var swiftSources: List + @Input + var swiftExtraOpts: List = emptyList() + @Input lateinit var frameworks: MutableList @@ -159,7 +162,7 @@ open class FrameworkTest : DefaultTask(), KonanTestExecutable { "-F", frameworkParentDirPath, "-Xcc", "-Werror" // To fail compilation on warnings in framework header. ) - compileSwift(project, project.testTarget, sources, options, Paths.get(executable), fullBitcode) + compileSwift(project, project.testTarget, sources, options + swiftExtraOpts, Paths.get(executable), fullBitcode) } @TaskAction