diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/BinaryOptions.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/BinaryOptions.kt index 0994241c830..d05190e21c3 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/BinaryOptions.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/BinaryOptions.kt @@ -23,6 +23,8 @@ object BinaryOptions : BinaryOptionRegistry() { val sourceInfoType by option() val androidProgramType by option() + + val unitSuspendFunctionObjCExport by option() } open class BinaryOption( diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanCompilerFrontendServices.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanCompilerFrontendServices.kt index db0e679a51a..7c1525bc43f 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanCompilerFrontendServices.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanCompilerFrontendServices.kt @@ -38,6 +38,9 @@ internal fun StorageComponentContainer.initContainer(config: KonanConfig) { override val objcGenerics: Boolean get() = config.configuration.getBoolean(KonanConfigKeys.OBJC_GENERICS) + + override val unitSuspendFunctionExport: UnitSuspendFunctionObjCExport + get() = config.unitSuspendFunctionObjCExport }) } } diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfig.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfig.kt index 3b5edd0ee18..b1f76b1d65d 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfig.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfig.kt @@ -303,6 +303,9 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration } "Konan_main" } + + internal val unitSuspendFunctionObjCExport: UnitSuspendFunctionObjCExport + get() = configuration.get(BinaryOptions.unitSuspendFunctionObjCExport) ?: UnitSuspendFunctionObjCExport.LEGACY } fun CompilerConfiguration.report(priority: CompilerMessageSeverity, message: String) diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/UnitSuspendFunctionObjCExport.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/UnitSuspendFunctionObjCExport.kt new file mode 100644 index 00000000000..0457a3779d4 --- /dev/null +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/UnitSuspendFunctionObjCExport.kt @@ -0,0 +1,26 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.backend.konan + +enum class UnitSuspendFunctionObjCExport { + /** + * In this mode suspend functions and methods with [Unit] return type are exported to Objective-C with an additional argument, + * continuation callback, with the following Objective-C signature: `(^)(KtKotlinUnit * _Nullable, NSError * _Nullable)`. + */ + LEGACY, + + /** + * In this mode suspend functions and methods with [Unit] return type are exported to Objective-C with an additional argument, + * continuation callback, with the following Objective-C signature: `(^)(NSError * _Nullable)`. + * + * Methods overriding superclass methods or implementing interface requirements narrowing down a more general return type + * to [Unit] are exported like in [LEGACY] mode. + * + * Note that in Swift 5.5 and higher suspend functions exported this way are transparently mapped to + * async functions with `Void` return type + */ + PROPER, +} \ No newline at end of file diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/ContextUtils.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/ContextUtils.kt index 61f60399868..0bc22d8e24e 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/ContextUtils.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/ContextUtils.kt @@ -503,6 +503,7 @@ internal class Llvm(val context: Context, val llvmModule: LLVMModuleRef) : Runti val Kotlin_ObjCExport_RethrowNSErrorAsException by lazyRtFunction val Kotlin_ObjCExport_AllocInstanceWithAssociatedObject by lazyRtFunction val Kotlin_ObjCExport_createContinuationArgument by lazyRtFunction + val Kotlin_ObjCExport_createUnitContinuationArgument by lazyRtFunction val Kotlin_ObjCExport_resumeContinuation by lazyRtFunction private val Kotlin_ObjCExport_NSIntegerTypeProvider by lazyRtFunction diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/objcexport/ObjCExportCodeGenerator.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/objcexport/ObjCExportCodeGenerator.kt index 0cd03e90b9c..cc45628db12 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/objcexport/ObjCExportCodeGenerator.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/objcexport/ObjCExportCodeGenerator.kt @@ -243,6 +243,10 @@ internal class ObjCExportCodeGenerator( generateContinuationToRetainedCompletionConverter(blockGenerator) } + internal val unitContinuationToRetainedCompletionConverter: LLVMValueRef by lazy { + generateUnitContinuationToRetainedCompletionConverter(blockGenerator) + } + fun meaningfulBridgeNameOrNull(irFunction: IrFunction?): String? { if (!context.config.configuration.getBoolean(KonanConfigKeys.MEANINGFUL_BRIDGE_NAMES)) { return null @@ -771,7 +775,31 @@ private fun ObjCExportCodeGenerator.generateContinuationToRetainedCompletionConv invokeName = "invokeCompletion" ) { continuation, arguments -> check(arguments.size == 2) - callFromBridge(context.llvm.Kotlin_ObjCExport_resumeContinuation, listOf(continuation) + arguments) + + val resultArgument = objCReferenceToKotlin(arguments[0], Lifetime.ARGUMENT) + val errorArgument = arguments[1] + + callFromBridge(context.llvm.Kotlin_ObjCExport_resumeContinuation, listOf(continuation, resultArgument, errorArgument)) + ret(null) + } +} + +private fun ObjCExportCodeGenerator.generateUnitContinuationToRetainedCompletionConverter( + blockGenerator: BlockGenerator +): LLVMValueRef = with(blockGenerator) { + generateWrapKotlinObjectToRetainedBlock( + BlockType(numberOfParameters = 1, returnsVoid = true), + convertName = "convertUnitContinuation", + invokeName = "invokeUnitCompletion" + ) { continuation, arguments -> + check(arguments.size == 1) + + val errorArgument = arguments[0] + val resultArgument = ifThenElse(icmpNe(errorArgument, kNullInt8Ptr), kNullObjHeaderPtr) { + codegen.theUnitInstanceRef.llvm + } + + callFromBridge(context.llvm.Kotlin_ObjCExport_resumeContinuation, listOf(continuation, resultArgument, errorArgument)) ret(null) } } @@ -979,9 +1007,14 @@ private fun ObjCExportCodeGenerator.generateObjCImp( null } - MethodBridgeValueParameter.SuspendCompletion -> { + is MethodBridgeValueParameter.SuspendCompletion -> { + val createContinuationArgument = if (paramBridge.useUnitCompletion) { + context.llvm.Kotlin_ObjCExport_createUnitContinuationArgument + } else { + context.llvm.Kotlin_ObjCExport_createContinuationArgument + } callFromBridge( - context.llvm.Kotlin_ObjCExport_createContinuationArgument, + createContinuationArgument, listOf(parameter, generateExceptionTypeInfoArray(baseMethod!!)), Lifetime.ARGUMENT ).also { @@ -1187,7 +1220,7 @@ private fun ObjCExportCodeGenerator.generateKotlinToObjCBridge( errorOutPtr = it } - MethodBridgeValueParameter.SuspendCompletion -> { + is MethodBridgeValueParameter.SuspendCompletion -> { val continuation = param(irFunction.allParametersCount) // The last argument. // TODO: consider placing interception into the converter to reduce code size. val intercepted = callFromBridge( @@ -1195,7 +1228,13 @@ private fun ObjCExportCodeGenerator.generateKotlinToObjCBridge( listOf(continuation), Lifetime.ARGUMENT ) - val retainedCompletion = callFromBridge(continuationToRetainedCompletionConverter, listOf(intercepted)) + + val converter = if (bridge.useUnitCompletion) { + unitContinuationToRetainedCompletionConverter + } else { + continuationToRetainedCompletionConverter + } + val retainedCompletion = callFromBridge(converter, listOf(intercepted)) callFromBridge(objcAutorelease, listOf(retainedCompletion)) // TODO: use stack-allocated block here instead. } } @@ -1771,7 +1810,7 @@ private fun MethodBridgeParameter.toLlvmParamType(): LlvmParamType = when (this) is MethodBridgeReceiver -> ReferenceBridge.toLlvmParamType() MethodBridgeSelector -> LlvmParamType(int8TypePtr) MethodBridgeValueParameter.ErrorOutParameter -> LlvmParamType(pointerType(ReferenceBridge.toLlvmParamType().llvmType)) - MethodBridgeValueParameter.SuspendCompletion -> LlvmParamType(int8TypePtr) + is MethodBridgeValueParameter.SuspendCompletion -> LlvmParamType(int8TypePtr) } private fun MethodBridge.ReturnValue.toLlvmRetType( @@ -1827,7 +1866,7 @@ private val MethodBridgeParameter.objCEncoding: String get() = when (this) { is MethodBridgeReceiver -> ReferenceBridge.objCEncoding MethodBridgeSelector -> ":" MethodBridgeValueParameter.ErrorOutParameter -> "^${ReferenceBridge.objCEncoding}" - MethodBridgeValueParameter.SuspendCompletion -> "@" + is MethodBridgeValueParameter.SuspendCompletion -> "@" } private val TypeBridge.objCEncoding: String get() = when (this) { diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/MethodBridge.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/MethodBridge.kt index b4e3e82a097..d3568b67986 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/MethodBridge.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/MethodBridge.kt @@ -35,7 +35,7 @@ internal object MethodBridgeSelector : MethodBridgeParameter() internal sealed class MethodBridgeValueParameter : MethodBridgeParameter() { data class Mapped(val bridge: TypeBridge) : MethodBridgeValueParameter() object ErrorOutParameter : MethodBridgeValueParameter() - object SuspendCompletion : MethodBridgeValueParameter() + data class SuspendCompletion(val useUnitCompletion: Boolean) : MethodBridgeValueParameter() } internal data class MethodBridge( @@ -92,7 +92,7 @@ internal fun MethodBridge.valueParametersAssociated( when (it) { is MethodBridgeValueParameter.Mapped -> it to kotlinParameters.next() - MethodBridgeValueParameter.SuspendCompletion, + is MethodBridgeValueParameter.SuspendCompletion, is MethodBridgeValueParameter.ErrorOutParameter -> it to null } }.also { assert(!kotlinParameters.hasNext()) } @@ -108,7 +108,7 @@ internal fun MethodBridge.parametersAssociated( is MethodBridgeValueParameter.Mapped, MethodBridgeReceiver.Instance -> it to kotlinParameters.next() - MethodBridgeValueParameter.SuspendCompletion, + is MethodBridgeValueParameter.SuspendCompletion, MethodBridgeReceiver.Static, MethodBridgeSelector, MethodBridgeValueParameter.ErrorOutParameter -> it to null diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExport.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExport.kt index b7a0e5de66b..8e9cd8dda3f 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExport.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExport.kt @@ -56,7 +56,8 @@ internal class ObjCExport(val context: Context, symbolTable: SymbolTable) { val produceFramework = context.config.produce == CompilerOutputKind.FRAMEWORK return if (produceFramework) { - val mapper = ObjCExportMapper(context.frontendServices.deprecationResolver) + val unitSuspendFunctionExport = context.config.unitSuspendFunctionObjCExport + val mapper = ObjCExportMapper(context.frontendServices.deprecationResolver, unitSuspendFunctionExport = unitSuspendFunctionExport) val moduleDescriptors = listOf(context.moduleDescriptor) + context.getExportedDependencies() val objcGenerics = context.configuration.getBoolean(KonanConfigKeys.OBJC_GENERICS) val namer = ObjCExportNamerImpl( @@ -86,7 +87,7 @@ internal class ObjCExport(val context: Context, symbolTable: SymbolTable) { if (!context.config.produce.isFinalBinary) return // TODO: emit RTTI to the same modules as classes belong to. - val mapper = exportedInterface?.mapper ?: ObjCExportMapper() + val mapper = exportedInterface?.mapper ?: ObjCExportMapper(unitSuspendFunctionExport = context.config.unitSuspendFunctionObjCExport) namer = exportedInterface?.namer ?: ObjCExportNamerImpl( setOf(codegen.context.moduleDescriptor), context.moduleDescriptor.builtIns, 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 c1378645c01..f4e75acb19a 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 @@ -644,7 +644,7 @@ internal class ObjCExportTranslatorImpl( } } MethodBridgeValueParameter.ErrorOutParameter -> "error" - MethodBridgeValueParameter.SuspendCompletion -> "completionHandler" + is MethodBridgeValueParameter.SuspendCompletion -> "completionHandler" } val uniqueName = unifyName(candidateName, usedNames) @@ -655,14 +655,18 @@ internal class ObjCExportTranslatorImpl( MethodBridgeValueParameter.ErrorOutParameter -> ObjCPointerType(ObjCNullableReferenceType(ObjCClassType("NSError")), nullable = true) - MethodBridgeValueParameter.SuspendCompletion -> { - val resultType = when (val it = mapReferenceType(method.returnType!!, objCExportScope)) { - is ObjCNonNullReferenceType -> ObjCNullableReferenceType(it, isNullableResult = false) - is ObjCNullableReferenceType -> ObjCNullableReferenceType(it.nonNullType, isNullableResult = true) + is MethodBridgeValueParameter.SuspendCompletion -> { + val resultType = if (bridge.useUnitCompletion) { + null + } else { + when (val it = mapReferenceType(method.returnType!!, objCExportScope)) { + is ObjCNonNullReferenceType -> ObjCNullableReferenceType(it, isNullableResult = false) + is ObjCNullableReferenceType -> ObjCNullableReferenceType(it.nonNullType, isNullableResult = true) + } } ObjCBlockPointerType( returnType = ObjCVoidType, - parameterTypes = listOf( + parameterTypes = listOfNotNull( resultType, ObjCNullableReferenceType(ObjCClassType("NSError")) ) 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 34aebf55895..4a030ac4549 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 @@ -7,6 +7,7 @@ package org.jetbrains.kotlin.backend.konan.objcexport import com.intellij.psi.PsiElement import org.jetbrains.kotlin.analyzer.ModuleInfo +import org.jetbrains.kotlin.backend.konan.UnitSuspendFunctionObjCExport import org.jetbrains.kotlin.descriptors.konan.isNativeStdlib import org.jetbrains.kotlin.builtins.KotlinBuiltIns import org.jetbrains.kotlin.descriptors.* @@ -43,6 +44,7 @@ interface ObjCExportLazy { fun isIncluded(moduleInfo: ModuleInfo): Boolean fun getCompilerModuleName(moduleInfo: ModuleInfo): String val objcGenerics: Boolean + val unitSuspendFunctionExport: UnitSuspendFunctionObjCExport } fun generateBase(): List> @@ -86,7 +88,7 @@ internal class ObjCExportLazyImpl( private val nameTranslator: ObjCExportNameTranslator = ObjCExportNameTranslatorImpl(namerConfiguration) - private val mapper = ObjCExportMapper(deprecationResolver, local = true) + private val mapper = ObjCExportMapper(deprecationResolver, local = true, configuration.unitSuspendFunctionExport) private val namer = ObjCExportNamerImpl(namerConfiguration, builtIns, mapper, local = true) diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportMapper.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportMapper.kt index ca01c9b015b..f8444074328 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportMapper.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportMapper.kt @@ -25,7 +25,8 @@ import org.jetbrains.kotlin.types.typeUtil.isUnit internal class ObjCExportMapper( internal val deprecationResolver: DeprecationResolver? = null, - private val local: Boolean = false + private val local: Boolean = false, + internal val unitSuspendFunctionExport: UnitSuspendFunctionObjCExport ) { fun getCustomTypeMapper(descriptor: ClassDescriptor): CustomTypeMapper? = CustomTypeMappers.getMapper(descriptor) @@ -331,7 +332,8 @@ private fun ObjCExportMapper.bridgeMethodImpl(descriptor: FunctionDescriptor): M val returnBridge = bridgeReturnType(descriptor, convertExceptionsToErrors) if (descriptor.isSuspend) { - valueParameters += MethodBridgeValueParameter.SuspendCompletion + val useUnitCompletion = (unitSuspendFunctionExport == UnitSuspendFunctionObjCExport.PROPER) && (descriptor.returnType!!.isUnit()) + valueParameters += MethodBridgeValueParameter.SuspendCompletion(useUnitCompletion) } else if (convertExceptionsToErrors) { // Add error out parameter before tail block parameters. The convention allows this. // Placing it after would trigger https://bugs.swift.org/browse/SR-12201 @@ -349,7 +351,7 @@ private fun MethodBridgeValueParameter.isBlockPointer(): Boolean = when (this) { is BlockPointerBridge -> true } MethodBridgeValueParameter.ErrorOutParameter -> false - MethodBridgeValueParameter.SuspendCompletion -> true + is MethodBridgeValueParameter.SuspendCompletion -> true } internal fun ObjCExportMapper.bridgePropertyType(descriptor: PropertyDescriptor): TypeBridge { diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportNamer.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportNamer.kt index 9760baeb16a..daeb2daa10e 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportNamer.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportNamer.kt @@ -7,6 +7,7 @@ package org.jetbrains.kotlin.backend.konan.objcexport import org.jetbrains.kotlin.backend.common.serialization.findSourceFile import org.jetbrains.kotlin.backend.konan.Context +import org.jetbrains.kotlin.backend.konan.UnitSuspendFunctionObjCExport import org.jetbrains.kotlin.backend.konan.cKeywords import org.jetbrains.kotlin.backend.konan.descriptors.isArray import org.jetbrains.kotlin.backend.konan.descriptors.isInterface @@ -89,7 +90,7 @@ fun createNamer( ): ObjCExportNamer = ObjCExportNamerImpl( (exportedDependencies + moduleDescriptor).toSet(), moduleDescriptor.builtIns, - ObjCExportMapper(local = true), + ObjCExportMapper(local = true, unitSuspendFunctionExport = UnitSuspendFunctionObjCExport.LEGACY), topLevelNamePrefix, local = true ) @@ -472,7 +473,7 @@ internal class ObjCExportNamerImpl( else -> it!!.name.asString().toIdentifier() } MethodBridgeValueParameter.ErrorOutParameter -> "error" - MethodBridgeValueParameter.SuspendCompletion -> "completionHandler" + is MethodBridgeValueParameter.SuspendCompletion -> "completionHandler" } if (index == 0) { @@ -525,7 +526,7 @@ internal class ObjCExportNamerImpl( else -> it!!.name.asString().toIdentifier() } MethodBridgeValueParameter.ErrorOutParameter -> continue@parameters - MethodBridgeValueParameter.SuspendCompletion -> "completionHandler" + is MethodBridgeValueParameter.SuspendCompletion -> "completionHandler" } append(label) diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportTranslatorMobile.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportTranslatorMobile.kt index 9240e8ca0bf..fca28c9e9ea 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportTranslatorMobile.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportTranslatorMobile.kt @@ -10,9 +10,9 @@ import org.jetbrains.kotlin.descriptors.FunctionDescriptor class ObjCExportTranslatorMobile internal constructor(private val delegate: ObjCExportTranslatorImpl) : ObjCExportTranslator by delegate { companion object { - fun create(namer: ObjCExportNamer): ObjCExportTranslatorMobile { - val mapper = ObjCExportMapper(local = true) - return ObjCExportTranslatorMobile(ObjCExportTranslatorImpl(null, mapper, namer, ObjCExportProblemCollector.SILENT, false)) + fun create(namer: ObjCExportNamer, configuration: ObjCExportLazy.Configuration): ObjCExportTranslatorMobile { + val mapper = ObjCExportMapper(local = true, unitSuspendFunctionExport = configuration.unitSuspendFunctionExport) + return ObjCExportTranslatorMobile(ObjCExportTranslatorImpl(null, mapper, namer, ObjCExportProblemCollector.SILENT, configuration.objcGenerics)) } } diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjcExportHeaderGeneratorMobile.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjcExportHeaderGeneratorMobile.kt index ef64c3b4756..af0f9cfee8d 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjcExportHeaderGeneratorMobile.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjcExportHeaderGeneratorMobile.kt @@ -24,7 +24,7 @@ class ObjcExportHeaderGeneratorMobile internal constructor( deprecationResolver: DeprecationResolver? = null, local: Boolean = false, restrictToLocalModules: Boolean = false): ObjCExportHeaderGenerator { - val mapper = ObjCExportMapper(deprecationResolver, local) + val mapper = ObjCExportMapper(deprecationResolver, local, configuration.unitSuspendFunctionExport) val namerConfiguration = createNamerConfiguration(configuration) val namer = ObjCExportNamerImpl(namerConfiguration, builtIns, mapper, local) diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index 6f73948ef75..d3176762bd6 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -5321,7 +5321,7 @@ if (isAppleTarget(project)) { framework(frameworkName) { sources = ['objcexport'] library = libraryName - opts = ["-Xemit-lazy-objc-header=$lazyHeader", "-Xexport-kdoc", "-Xbundle-id=foo.bar"] + opts = ["-Xemit-lazy-objc-header=$lazyHeader", "-Xexport-kdoc", "-Xbundle-id=foo.bar", "-Xbinary=unitSuspendFunctionObjCExport=proper"] } swiftSources = ['objcexport'] if (isNoopGC) { @@ -5375,7 +5375,7 @@ if (isAppleTarget(project)) { sources = ['objcexport'] artifact = frameworkArtifactName library = libraryName - opts = ["-Xemit-lazy-objc-header=$lazyHeader", "-Xno-objc-generics"] + opts = ["-Xemit-lazy-objc-header=$lazyHeader", "-Xno-objc-generics", "-Xbinary=unitSuspendFunctionObjCExport=proper"] } swiftSources = ['objcexport'] swiftExtraOpts = [ '-D', 'NO_GENERICS' ] @@ -5384,6 +5384,61 @@ if (isAppleTarget(project)) { } } + frameworkTest('testObjCExportLegacySuspendUnit') { + final String frameworkName = 'KtLegacySuspendUnit' + final String frameworkArtifactName = 'Kt' + final String dir = "$testOutputFramework/testObjCExportLegacySuspendUnit" + final File lazyHeader = file("$dir/$target-lazy.h") + + doLast { + final String expectedLazyHeaderName = "expectedLazyLegacySuspendUnit.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"] + } + swiftSources = ['objcexport'] + swiftExtraOpts = [ '-D', 'LEGACY_SUSPEND_UNIT_FUNCTION_EXPORT' ] + if (isNoopGC) { + swiftExtraOpts += ["-D", "NOOP_GC"] + } + } + frameworkTest('testObjCExportStatic') { final String frameworkName = 'KtStatic' final String frameworkArtifactName = 'Kt' @@ -5410,6 +5465,7 @@ if (isAppleTarget(project)) { artifact = frameworkArtifactName library = libraryName isStatic = true + opts = ["-Xbinary=unitSuspendFunctionObjCExport=proper"] } swiftSources = ['objcexport'] if (isNoopGC) { diff --git a/kotlin-native/backend.native/tests/objcexport/coroutines.kt b/kotlin-native/backend.native/tests/objcexport/coroutines.kt index 15f60c76955..f247b5a8e92 100644 --- a/kotlin-native/backend.native/tests/objcexport/coroutines.kt +++ b/kotlin-native/backend.native/tests/objcexport/coroutines.kt @@ -15,6 +15,7 @@ import kotlin.test.* class CoroutineException : Throwable() suspend fun suspendFun() = 42 +suspend fun unitSuspendFun() = Unit @Throws(CoroutineException::class, CancellationException::class) suspend fun suspendFun(result: Any?, doSuspend: Boolean, doThrow: Boolean): Any? { @@ -30,6 +31,18 @@ suspend fun suspendFun(result: Any?, doSuspend: Boolean, doThrow: Boolean): Any? return result } +@Throws(CoroutineException::class, CancellationException::class) +suspend fun unitSuspendFun(doSuspend: Boolean, doThrow: Boolean) { + if (doSuspend) { + suspendCoroutineUninterceptedOrReturn { + it.resume(Unit) + COROUTINE_SUSPENDED + } + } + + if (doThrow) throw CoroutineException() +} + class ContinuationHolder { internal lateinit var continuation: Continuation @@ -96,6 +109,7 @@ interface SuspendBridge { suspend fun unit(value: T): Unit suspend fun unitAsAny(value: T): Any? + suspend fun nullableUnit(value: T): Unit? @Throws(Throwable::class) suspend fun nothing(value: T): Nothing @Throws(Throwable::class) suspend fun nothingAsInt(value: T): Int @@ -106,7 +120,9 @@ interface SuspendBridge { abstract class AbstractSuspendBridge : SuspendBridge { override suspend fun intAsAny(value: Int): Int = TODO() + override suspend fun unit(value: Int): Unit = TODO() override suspend fun unitAsAny(value: Int): Unit = TODO() + override suspend fun nullableUnit(value: Int): Unit? = TODO() override suspend fun nothingAsInt(value: Int): Nothing = TODO() override suspend fun nothingAsAny(value: Int): Nothing = TODO() @@ -116,21 +132,25 @@ abstract class AbstractSuspendBridge : SuspendBridge { private suspend fun callSuspendBridgeImpl(bridge: SuspendBridge) { assertEquals(1, bridge.intAsAny(1)) - assertSame(Unit, bridge.unitAsAny(2)) + assertSame(Unit, bridge.unit(2)) + assertSame(Unit, bridge.unitAsAny(3)) + assertSame(Unit, bridge.nullableUnit(4)) - assertFailsWith { bridge.nothingAsInt(3) } - assertFailsWith { bridge.nothingAsAny(4) } - assertFailsWith { bridge.nothingAsUnit(5) } + assertFailsWith { bridge.nothingAsInt(5) } + assertFailsWith { bridge.nothingAsAny(6) } + assertFailsWith { bridge.nothingAsUnit(7) } } private suspend fun callAbstractSuspendBridgeImpl(bridge: AbstractSuspendBridge) { - assertEquals(6, bridge.intAsAny(6)) + assertEquals(8, bridge.intAsAny(8)) - assertSame(Unit, bridge.unitAsAny(7)) + assertSame(Unit, bridge.unit(9)) + assertSame(Unit, bridge.unitAsAny(10)) + assertSame(Unit, bridge.nullableUnit(11)) - assertFailsWith { bridge.nothingAsInt(8) } - assertFailsWith { bridge.nothingAsAny(9) } - assertFailsWith { bridge.nothingAsUnit(10) } + assertFailsWith { bridge.nothingAsInt(12) } + assertFailsWith { bridge.nothingAsAny(13) } + assertFailsWith { bridge.nothingAsUnit(14) } } @Throws(Throwable::class) diff --git a/kotlin-native/backend.native/tests/objcexport/coroutines.swift b/kotlin-native/backend.native/tests/objcexport/coroutines.swift index eebee70e555..111352f72f4 100644 --- a/kotlin-native/backend.native/tests/objcexport/coroutines.swift +++ b/kotlin-native/backend.native/tests/objcexport/coroutines.swift @@ -21,6 +21,33 @@ private func testCallSimple() throws { try assertNil(error) } +private func testUnitCallSimple() throws { +#if LEGACY_SUSPEND_UNIT_FUNCTION_EXPORT + var result: KotlinUnit? = nil +#endif + var error: Error? = nil + var completionCalled = 0 + +#if LEGACY_SUSPEND_UNIT_FUNCTION_EXPORT + CoroutinesKt.unitSuspendFun { _result, _error in + completionCalled += 1 + result = _result + error = _error + } +#else + CoroutinesKt.unitSuspendFun { _error in + completionCalled += 1 + error = _error + } +#endif + +#if LEGACY_SUSPEND_UNIT_FUNCTION_EXPORT + try assertSame(actual: result, expected: KotlinUnit.shared) +#endif + try assertEquals(actual: completionCalled, expected: 1) + try assertNil(error) +} + private func testCallSuspendFun(doSuspend: Bool, doThrow: Bool) throws { class C {} let expectedResult = C() @@ -46,6 +73,39 @@ private func testCallSuspendFun(doSuspend: Bool, doThrow: Bool) throws { } } +private func testCallUnitSuspendFun(doSuspend: Bool, doThrow: Bool) throws { + var completionCalled = 0 + var result: AnyObject? = nil + var error: Error? = nil + +#if LEGACY_SUSPEND_UNIT_FUNCTION_EXPORT + CoroutinesKt.unitSuspendFun(doSuspend: doSuspend, doThrow: doThrow) { _result, _error in + completionCalled += 1 + result = _result as AnyObject? + error = _error + } +#else + CoroutinesKt.unitSuspendFun(doSuspend: doSuspend, doThrow: doThrow) { _error in + completionCalled += 1 + error = _error + } +#endif + + try assertEquals(actual: completionCalled, expected: 1) + + if doThrow { +#if LEGACY_SUSPEND_UNIT_FUNCTION_EXPORT + try assertNil(result) +#endif + try assertTrue(error?.kotlinException is CoroutineException) + } else { +#if LEGACY_SUSPEND_UNIT_FUNCTION_EXPORT + try assertSame(actual: result, expected: KotlinUnit.shared) +#endif + try assertNil(error) + } +} + private func testSuspendFuncAsync(doThrow: Bool) throws { var completionCalled = 0 var result: AnyObject? = nil @@ -91,6 +151,11 @@ private func testCall() throws { try testCallSuspendFun(doSuspend: true, doThrow: true) try testCallSuspendFun(doSuspend: false, doThrow: true) + try testCallUnitSuspendFun(doSuspend: true, doThrow: false) + try testCallUnitSuspendFun(doSuspend: false, doThrow: false) + try testCallUnitSuspendFun(doSuspend: true, doThrow: true) + try testCallUnitSuspendFun(doSuspend: false, doThrow: true) + try testSuspendFuncAsync(doThrow: false) try testSuspendFuncAsync(doThrow: true) } @@ -237,10 +302,24 @@ private class SwiftSuspendBridge : AbstractSuspendBridge { completionHandler(value, nil) } +#if LEGACY_SUSPEND_UNIT_FUNCTION_EXPORT + override func unit(value: KotlinInt, completionHandler: @escaping (KotlinUnit?, Error?) -> Void) { + completionHandler(KotlinUnit(), nil) + } +#else + override func unit(value: KotlinInt, completionHandler: @escaping (Error?) -> Void) { + completionHandler(nil) + } +#endif + override func unitAsAny(value: KotlinInt, completionHandler: @escaping (KotlinUnit?, Error?) -> Void) { completionHandler(KotlinUnit(), nil) } + override func nullableUnit(value: KotlinInt, completionHandler: @escaping (KotlinUnit?, Error?) -> Void) { + completionHandler(KotlinUnit(), nil) + } + override func nothingAsInt(value: KotlinInt, completionHandler: @escaping (KotlinNothing?, Error?) -> Void) { completionHandler(nil, E()) } @@ -249,9 +328,15 @@ private class SwiftSuspendBridge : AbstractSuspendBridge { completionHandler(nil, E()) } +#if LEGACY_SUSPEND_UNIT_FUNCTION_EXPORT override func nothingAsUnit(value: KotlinInt, completionHandler: @escaping (KotlinNothing?, Error?) -> Void) { completionHandler(nil, E()) } +#else + override func nothingAsUnit(value: KotlinInt, completionHandler: @escaping (Error?) -> Void) { + completionHandler(E()) + } +#endif } private func testBridges() throws { @@ -268,34 +353,52 @@ private func testBridges() throws { } private func testImplicitThrows1() throws { - var result: KotlinUnit? = nil var error: Error? = nil var completionCalled = 0 +#if LEGACY_SUSPEND_UNIT_FUNCTION_EXPORT + var result: KotlinUnit? = nil + CoroutinesKt.throwCancellationException { _result, _error in completionCalled += 1 result = _result error = _error } - try assertEquals(actual: completionCalled, expected: 1) try assertNil(result) +#else + CoroutinesKt.throwCancellationException { _error in + completionCalled += 1 + error = _error + } +#endif + + try assertEquals(actual: completionCalled, expected: 1) try assertTrue(error?.kotlinException is KotlinCancellationException) } private func testImplicitThrows2() throws { - var result: KotlinUnit? = nil var error: Error? = nil var completionCalled = 0 +#if LEGACY_SUSPEND_UNIT_FUNCTION_EXPORT + var result: KotlinUnit? = nil + ThrowCancellationExceptionImpl().throwCancellationException { _result, _error in - completionCalled += 1 - result = _result - error = _error + completionCalled += 1 + result = _result + error = _error } - try assertEquals(actual: completionCalled, expected: 1) try assertNil(result) +#else + ThrowCancellationExceptionImpl().throwCancellationException { _error in + completionCalled += 1 + error = _error + } +#endif + + try assertEquals(actual: completionCalled, expected: 1) try assertTrue(error?.kotlinException is KotlinCancellationException) } @@ -369,6 +472,7 @@ class CoroutinesTests : SimpleTestProvider { super.init() test("TestCallSimple", testCallSimple) + test("TestCallUnitSimple", testUnitCallSimple) test("TestCall", testCall) test("TestCallChain", testCallChain) test("TestOverride", testOverride) diff --git a/kotlin-native/backend.native/tests/objcexport/expectedLazy.h b/kotlin-native/backend.native/tests/objcexport/expectedLazy.h index 82af320aad5..07ac948fbca 100644 --- a/kotlin-native/backend.native/tests/objcexport/expectedLazy.h +++ b/kotlin-native/backend.native/tests/objcexport/expectedLazy.h @@ -180,7 +180,7 @@ __attribute__((swift_name("SuspendBridge"))) @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:)"))); +- (void)unitValue:(id _Nullable)value completionHandler:(void (^)(NSError * _Nullable))completionHandler __attribute__((swift_name("unit(value:completionHandler:)"))); /** @note This method converts instances of CancellationException to errors. @@ -188,6 +188,12 @@ __attribute__((swift_name("SuspendBridge"))) */ - (void)unitAsAnyValue:(id _Nullable)value completionHandler:(void (^)(id _Nullable_result, NSError * _Nullable))completionHandler __attribute__((swift_name("unitAsAny(value:completionHandler:)"))); +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void)nullableUnitValue:(id _Nullable)value completionHandler:(void (^)(KtKotlinUnit * _Nullable_result, NSError * _Nullable))completionHandler __attribute__((swift_name("nullableUnit(value:completionHandler:)"))); + /** @note This method converts all Kotlin exceptions to errors. */ @@ -206,7 +212,7 @@ __attribute__((swift_name("SuspendBridge"))) /** @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:)"))); +- (void)nothingAsUnitValue:(id _Nullable)value completionHandler:(void (^)(NSError * _Nullable))completionHandler __attribute__((swift_name("nothingAsUnit(value:completionHandler:)"))); @end; __attribute__((swift_name("AbstractSuspendBridge"))) @@ -220,12 +226,24 @@ __attribute__((swift_name("AbstractSuspendBridge"))) */ - (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)unitValue:(KtInt *)value completionHandler:(void (^)(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:(KtInt *)value completionHandler:(void (^)(KtKotlinUnit * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("unitAsAny(value:completionHandler:)"))); +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void)nullableUnitValue:(KtInt *)value completionHandler:(void (^)(KtKotlinUnit * _Nullable_result, NSError * _Nullable))completionHandler __attribute__((swift_name("nullableUnit(value:completionHandler:)"))); + /** @note This method converts all Kotlin exceptions to errors. */ @@ -239,7 +257,7 @@ __attribute__((swift_name("AbstractSuspendBridge"))) /** @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:)"))); +- (void)nothingAsUnitValue:(KtInt *)value completionHandler:(void (^)(NSError * _Nullable))completionHandler __attribute__((swift_name("nothingAsUnit(value:completionHandler:)"))); @end; __attribute__((swift_name("ThrowCancellationException"))) @@ -258,7 +276,7 @@ __attribute__((swift_name("ThrowCancellationExceptionImpl"))) @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:)"))); +- (void)throwCancellationExceptionWithCompletionHandler:(void (^)(NSError * _Nullable))completionHandler __attribute__((swift_name("throwCancellationException(completionHandler:)"))); @end; __attribute__((objc_subclassing_restricted)) @@ -271,12 +289,24 @@ __attribute__((swift_name("CoroutinesKt"))) */ + (void)suspendFunWithCompletionHandler:(void (^)(KtInt * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("suspendFun(completionHandler:)"))); +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ ++ (void)unitSuspendFunWithCompletionHandler:(void (^)(NSError * _Nullable))completionHandler __attribute__((swift_name("unitSuspendFun(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_result, 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)unitSuspendFunDoSuspend:(BOOL)doSuspend doThrow:(BOOL)doThrow completionHandler:(void (^)(NSError * _Nullable))completionHandler __attribute__((swift_name("unitSuspendFun(doSuspend:doThrow:completionHandler:)"))); + /** @note This method converts instances of CoroutineException, CancellationException to errors. Other uncaught Kotlin exceptions are fatal. @@ -305,7 +335,7 @@ __attribute__((swift_name("CoroutinesKt"))) @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:)"))); ++ (void)throwCancellationExceptionWithCompletionHandler:(void (^)(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()"))); @@ -1191,7 +1221,7 @@ __attribute__((swift_name("ThrowsThrowableAsErrorSuspend"))) @note This method converts instances of CancellationException to errors. Other uncaught Kotlin exceptions are fatal. */ -- (void)throwErrorWithCompletionHandler:(void (^)(KtKotlinUnit * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("throwError(completionHandler:)"))); +- (void)throwErrorWithCompletionHandler:(void (^)(NSError * _Nullable))completionHandler __attribute__((swift_name("throwError(completionHandler:)"))); @end; __attribute__((objc_subclassing_restricted)) diff --git a/kotlin-native/backend.native/tests/objcexport/expectedLazyLegacySuspendUnit.h b/kotlin-native/backend.native/tests/objcexport/expectedLazyLegacySuspendUnit.h new file mode 100644 index 00000000000..55f1cd0050f --- /dev/null +++ b/kotlin-native/backend.native/tests/objcexport/expectedLazyLegacySuspendUnit.h @@ -0,0 +1,2688 @@ +__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:(T _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 T _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_result, 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_result, NSError * _Nullable))completionHandler __attribute__((swift_name("unitAsAny(value:completionHandler:)"))); + +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void)nullableUnitValue:(id _Nullable)value completionHandler:(void (^)(KtKotlinUnit * _Nullable_result, NSError * _Nullable))completionHandler __attribute__((swift_name("nullableUnit(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_result, 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)unitValue:(KtInt *)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:(KtInt *)value completionHandler:(void (^)(KtKotlinUnit * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("unitAsAny(value:completionHandler:)"))); + +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void)nullableUnitValue:(KtInt *)value completionHandler:(void (^)(KtKotlinUnit * _Nullable_result, NSError * _Nullable))completionHandler __attribute__((swift_name("nullableUnit(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 CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ ++ (void)unitSuspendFunWithCompletionHandler:(void (^)(KtKotlinUnit * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("unitSuspendFun(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_result, 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)unitSuspendFunDoSuspend:(BOOL)doSuspend doThrow:(BOOL)doThrow completionHandler:(void (^)(KtKotlinUnit * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("unitSuspendFun(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_result, 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_result, 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("TestIncompatiblePropertyTypeWarningGeneric"))) +@interface KtTestIncompatiblePropertyTypeWarningGeneric : KtBase +- (instancetype)initWithValue:(T _Nullable)value __attribute__((swift_name("init(value:)"))) __attribute__((objc_designated_initializer)); +@property (readonly) T _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("KDocExport"))) +@interface KtKDocExport : KtBase +- (instancetype)initWithName:(NSString *)name __attribute__((swift_name("init(name:)"))) __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"))); +@property (readonly) NSString *xyzzy __attribute__((swift_name("xyzzy"))); +@property (readonly) NSString *foo __attribute__((swift_name("foo"))); +@property int32_t yxxyz __attribute__((swift_name("yxxyz"))); +@end; + +__attribute__((swift_name("SomeClassWithProperty"))) +@interface KtSomeClassWithProperty : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@property (readonly) KtSomeClassWithProperty *heavyFormattedKDocFoo __attribute__((swift_name("heavyFormattedKDocFoo"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("KdocExportKt"))) +@interface KtKdocExportKt : KtBase + +/** + @note This method converts instances of IllegalArgumentException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ ++ (NSString * _Nullable)whateverA:(NSString *)a error:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("whatever(a:)"))); +@end; + +__attribute__((swift_name("KotlinPrivateOverrideI1"))) +@protocol KtKotlinPrivateOverrideI1 +@required +- (int32_t)i123AbstractMethod __attribute__((swift_name("i123AbstractMethod()"))); +- (int32_t)i1OpenMethod __attribute__((swift_name("i1OpenMethod()"))); +@end; + +__attribute__((swift_name("KotlinPrivateOverrideI2"))) +@protocol KtKotlinPrivateOverrideI2 +@required +- (int32_t)i123AbstractMethod __attribute__((swift_name("i123AbstractMethod()"))); +- (int32_t)i234AbstractMethod __attribute__((swift_name("i234AbstractMethod()"))); +- (int32_t)i2AbstractMethod __attribute__((swift_name("i2AbstractMethod()"))); +@end; + +__attribute__((swift_name("KotlinPrivateOverrideA1"))) +@interface KtKotlinPrivateOverrideA1 : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (int32_t)a1AbstractMethod __attribute__((swift_name("a1AbstractMethod()"))); +- (int32_t)a1OpenMethod __attribute__((swift_name("a1OpenMethod()"))); +@end; + +__attribute__((swift_name("KotlinPrivateOverrideI3"))) +@protocol KtKotlinPrivateOverrideI3 +@required +- (int32_t)i123AbstractMethod __attribute__((swift_name("i123AbstractMethod()"))); +- (int32_t)i234AbstractMethod __attribute__((swift_name("i234AbstractMethod()"))); +- (int32_t)i3AbstractMethod __attribute__((swift_name("i3AbstractMethod()"))); +@end; + +__attribute__((swift_name("KotlinPrivateOverrideI4"))) +@protocol KtKotlinPrivateOverrideI4 +@required +- (int32_t)i234AbstractMethod __attribute__((swift_name("i234AbstractMethod()"))); +- (int32_t)i4AbstractMethod __attribute__((swift_name("i4AbstractMethod()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("KotlinPrivateOverrideKt"))) +@interface KtKotlinPrivateOverrideKt : KtBase ++ (id)createP1 __attribute__((swift_name("createP1()"))); ++ (id)createP12 __attribute__((swift_name("createP12()"))); +@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("KT43780TestObject"))) +@interface KtKT43780TestObject : KtBase ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); ++ (instancetype)kT43780TestObject __attribute__((swift_name("init()"))); +@property (class, readonly, getter=shared) KtKT43780TestObject *shared __attribute__((swift_name("shared"))); +@property (readonly) int32_t x __attribute__((swift_name("x"))); +@property (readonly) int32_t y __attribute__((swift_name("y"))); +@property (readonly) NSString *shared __attribute__((swift_name("shared"))); +@property (readonly) NSString *Shared __attribute__((swift_name("Shared"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("KT43780TestClassWithCompanion"))) +@interface KtKT43780TestClassWithCompanion : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@property (class, readonly, getter=companion) KtKT43780TestClassWithCompanionCompanion *companion __attribute__((swift_name("companion"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("KT43780TestClassWithCompanion.Companion"))) +@interface KtKT43780TestClassWithCompanionCompanion : KtBase ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); ++ (instancetype)companion __attribute__((swift_name("init()"))); +@property (class, readonly, getter=shared) KtKT43780TestClassWithCompanionCompanion *shared __attribute__((swift_name("shared"))); +@property (readonly) int32_t z __attribute__((swift_name("z"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Shared"))) +@interface KtShared : KtBase ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); ++ (instancetype)shared __attribute__((swift_name("init()"))); +@property (class, readonly, getter=shared_) KtShared *shared __attribute__((swift_name("shared"))); +@property (readonly) int32_t x __attribute__((swift_name("x"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Companion"))) +@interface KtCompanion : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +@property (class, readonly, getter=companion) KtCompanionCompanion *companion __attribute__((swift_name("companion"))); +@property (readonly) int32_t t __attribute__((swift_name("t"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Companion.Companion"))) +@interface KtCompanionCompanion : KtBase ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); ++ (instancetype)companion __attribute__((swift_name("init()"))); +@property (class, readonly, getter=shared) KtCompanionCompanion *shared __attribute__((swift_name("shared"))); +@property (readonly) int32_t x __attribute__((swift_name("x"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("KT43780Enum"))) +@interface KtKT43780Enum : 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) KtKT43780Enum *otherEntry __attribute__((swift_name("otherEntry"))); +@property (class, readonly) KtKT43780Enum *companion __attribute__((swift_name("companion"))); ++ (KtKotlinArray *)values __attribute__((swift_name("values()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("KT43780Enum.Companion"))) +@interface KtKT43780EnumCompanion : KtBase ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); ++ (instancetype)companion __attribute__((swift_name("init()"))); +@property (class, readonly, getter=shared) KtKT43780EnumCompanion *shared __attribute__((swift_name("shared"))); +@property (readonly) int32_t x __attribute__((swift_name("x"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("ClassWithInternalCompanion"))) +@interface KtClassWithInternalCompanion : 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 y __attribute__((swift_name("y"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("ClassWithPrivateCompanion"))) +@interface KtClassWithPrivateCompanion : 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 y __attribute__((swift_name("y"))); +@end; + +__attribute__((swift_name("Host"))) +@protocol KtHost +@required +@property (readonly) NSString *test __attribute__((swift_name("test"))); +@end; + +__attribute__((swift_name("AbstractHost"))) +@interface KtAbstractHost : 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("Kt46431Kt"))) +@interface KtKt46431Kt : KtBase ++ (id)createAbstractHost __attribute__((swift_name("createAbstractHost()"))); +@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__((objc_subclassing_restricted)) +__attribute__((swift_name("KotlinLivenessTracker"))) +@interface KtKotlinLivenessTracker : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (void)addObj:(id _Nullable)obj __attribute__((swift_name("add(obj:)"))); +- (BOOL)isEmpty __attribute__((swift_name("isEmpty()"))); +- (BOOL)objectsAreDead __attribute__((swift_name("objectsAreDead()"))); +@property (readonly) NSMutableArray *> *weakRefs __attribute__((swift_name("weakRefs"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("KotlinObject"))) +@interface KtKotlinObject : 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("NoAutoreleaseSendHelper"))) +@protocol KtNoAutoreleaseSendHelper +@required +- (void)sendKotlinObjectKotlinObject:(KtKotlinObject *)kotlinObject __attribute__((swift_name("sendKotlinObject(kotlinObject:)"))); +- (void)sendSwiftObjectSwiftObject:(id)swiftObject __attribute__((swift_name("sendSwiftObject(swiftObject:)"))); +- (void)sendListList:(NSArray *)list __attribute__((swift_name("sendList(list:)"))); +- (void)sendStringString:(NSString *)string __attribute__((swift_name("sendString(string:)"))); +- (void)sendNumberNumber:(id)number __attribute__((swift_name("sendNumber(number:)"))); +- (void)sendBlockBlock:(KtKotlinObject *(^)(void))block __attribute__((swift_name("sendBlock(block:)"))); +@end; + +__attribute__((swift_name("NoAutoreleaseReceiveHelper"))) +@protocol KtNoAutoreleaseReceiveHelper +@required +- (KtKotlinObject *)receiveKotlinObject __attribute__((swift_name("receiveKotlinObject()"))); +- (id)receiveSwiftObject __attribute__((swift_name("receiveSwiftObject()"))); +- (NSArray *)receiveList __attribute__((swift_name("receiveList()"))); +- (NSString *)receiveString __attribute__((swift_name("receiveString()"))); +- (id)receiveNumber __attribute__((swift_name("receiveNumber()"))); +- (KtKotlinObject *(^)(void))receiveBlock __attribute__((swift_name("receiveBlock()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("NoAutoreleaseKotlinSendHelper"))) +@interface KtNoAutoreleaseKotlinSendHelper : KtBase +- (instancetype)initWithKotlinLivenessTracker:(KtKotlinLivenessTracker *)kotlinLivenessTracker __attribute__((swift_name("init(kotlinLivenessTracker:)"))) __attribute__((objc_designated_initializer)); +- (void)sendKotlinObjectKotlinObject:(KtKotlinObject *)kotlinObject __attribute__((swift_name("sendKotlinObject(kotlinObject:)"))); +- (void)sendSwiftObjectSwiftObject:(id)swiftObject __attribute__((swift_name("sendSwiftObject(swiftObject:)"))); +- (void)sendListList:(NSArray *)list __attribute__((swift_name("sendList(list:)"))); +- (void)sendStringString:(NSString *)string __attribute__((swift_name("sendString(string:)"))); +- (void)sendNumberNumber:(id)number __attribute__((swift_name("sendNumber(number:)"))); +- (void)sendBlockBlock:(KtKotlinObject *(^)(void))block __attribute__((swift_name("sendBlock(block:)"))); +@property (readonly) KtKotlinLivenessTracker *kotlinLivenessTracker __attribute__((swift_name("kotlinLivenessTracker"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("NoAutoreleaseKotlinReceiveHelper"))) +@interface KtNoAutoreleaseKotlinReceiveHelper : KtBase +- (instancetype)initWithKotlinLivenessTracker:(KtKotlinLivenessTracker *)kotlinLivenessTracker __attribute__((swift_name("init(kotlinLivenessTracker:)"))) __attribute__((objc_designated_initializer)); +- (KtKotlinObject *)receiveKotlinObject __attribute__((swift_name("receiveKotlinObject()"))); +- (id)receiveSwiftObject __attribute__((swift_name("receiveSwiftObject()"))); +- (NSArray *)receiveList __attribute__((swift_name("receiveList()"))); +- (NSString *)receiveString __attribute__((swift_name("receiveString()"))); +- (id)receiveNumber __attribute__((swift_name("receiveNumber()"))); +- (KtKotlinObject *(^)(void))receiveBlock __attribute__((swift_name("receiveBlock()"))); +@property id swiftObject __attribute__((swift_name("swiftObject"))); +@property (readonly) KtKotlinLivenessTracker *kotlinLivenessTracker __attribute__((swift_name("kotlinLivenessTracker"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("NoAutoreleaseSingleton"))) +@interface KtNoAutoreleaseSingleton : KtBase ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); ++ (instancetype)noAutoreleaseSingleton __attribute__((swift_name("init()"))); +@property (class, readonly, getter=shared) KtNoAutoreleaseSingleton *shared __attribute__((swift_name("shared"))); +@property (readonly) int32_t x __attribute__((swift_name("x"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("NoAutoreleaseEnum"))) +@interface KtNoAutoreleaseEnum : 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) KtNoAutoreleaseEnum *entry __attribute__((swift_name("entry"))); ++ (KtKotlinArray *)values __attribute__((swift_name("values()"))); +@property (readonly) int32_t x __attribute__((swift_name("x"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("NoAutoreleaseKt"))) +@interface KtNoAutoreleaseKt : KtBase ++ (void)gc __attribute__((swift_name("gc()"))); ++ (void)callSendKotlinObjectHelper:(id)helper tracker:(KtKotlinLivenessTracker *)tracker __attribute__((swift_name("callSendKotlinObject(helper:tracker:)"))); ++ (void)callSendSwiftObjectHelper:(id)helper tracker:(KtKotlinLivenessTracker *)tracker swiftObject:(id)swiftObject __attribute__((swift_name("callSendSwiftObject(helper:tracker:swiftObject:)"))); ++ (void)callSendListHelper:(id)helper tracker:(KtKotlinLivenessTracker *)tracker __attribute__((swift_name("callSendList(helper:tracker:)"))); ++ (void)callSendStringHelper:(id)helper tracker:(KtKotlinLivenessTracker *)tracker __attribute__((swift_name("callSendString(helper:tracker:)"))); ++ (void)callSendNumberHelper:(id)helper tracker:(KtKotlinLivenessTracker *)tracker __attribute__((swift_name("callSendNumber(helper:tracker:)"))); ++ (void)callSendBlockHelper:(id)helper tracker:(KtKotlinLivenessTracker *)tracker __attribute__((swift_name("callSendBlock(helper:tracker:)"))); ++ (void)callReceiveKotlinObjectHelper:(id)helper tracker:(KtKotlinLivenessTracker *)tracker __attribute__((swift_name("callReceiveKotlinObject(helper:tracker:)"))); ++ (void)callReceiveSwiftObjectHelper:(id)helper tracker:(KtKotlinLivenessTracker *)tracker __attribute__((swift_name("callReceiveSwiftObject(helper:tracker:)"))); ++ (void)callReceiveListHelper:(id)helper tracker:(KtKotlinLivenessTracker *)tracker __attribute__((swift_name("callReceiveList(helper:tracker:)"))); ++ (void)callReceiveStringHelper:(id)helper tracker:(KtKotlinLivenessTracker *)tracker __attribute__((swift_name("callReceiveString(helper:tracker:)"))); ++ (void)callReceiveNumberHelper:(id)helper tracker:(KtKotlinLivenessTracker *)tracker __attribute__((swift_name("callReceiveNumber(helper:tracker:)"))); ++ (void)callReceiveBlockHelper:(id)helper tracker:(KtKotlinLivenessTracker *)tracker __attribute__((swift_name("callReceiveBlock(helper:tracker:)"))); ++ (void)callReceiveBlockAndCallHelper:(id)helper tracker:(KtKotlinLivenessTracker *)tracker __attribute__((swift_name("callReceiveBlockAndCall(helper:tracker:)"))); ++ (void * _Nullable)objc_autoreleasePoolPush __attribute__((swift_name("objc_autoreleasePoolPush()"))); ++ (void)objc_autoreleasePoolPopHandle:(void * _Nullable)handle __attribute__((swift_name("objc_autoreleasePoolPop(handle:)"))); ++ (void)useIntArrayArray:(KtKotlinIntArray *)array __attribute__((swift_name("useIntArray(array:)"))); +@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__((swift_name("Person"))) +@interface KtPerson : KtBase +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Person.User"))) +@interface KtPersonUser : KtPerson +- (instancetype)initWithId:(int32_t)id __attribute__((swift_name("init(id:)"))) __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()"))); +- (int32_t)component1 __attribute__((swift_name("component1()"))); +- (KtPersonUser *)doCopyId:(int32_t)id __attribute__((swift_name("doCopy(id:)"))); +@property (readonly) int32_t id __attribute__((swift_name("id"))); +@end; + +__attribute__((swift_name("Person.Worker"))) +@interface KtPersonWorker : 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("Person.WorkerEmployee"))) +@interface KtPersonWorkerEmployee : KtPersonWorker +- (instancetype)initWithId:(int32_t)id __attribute__((swift_name("init(id:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); ++ (instancetype)new __attribute__((unavailable)); +- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)"))); +- (NSUInteger)hash __attribute__((swift_name("hash()"))); +- (NSString *)description __attribute__((swift_name("description()"))); +- (int32_t)component1 __attribute__((swift_name("component1()"))); +- (KtPersonWorkerEmployee *)doCopyId:(int32_t)id __attribute__((swift_name("doCopy(id:)"))); +@property (readonly) int32_t id __attribute__((swift_name("id"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Person.WorkerContractor"))) +@interface KtPersonWorkerContractor : KtPersonWorker +- (instancetype)initWithId:(int32_t)id __attribute__((swift_name("init(id:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); ++ (instancetype)new __attribute__((unavailable)); +- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)"))); +- (NSUInteger)hash __attribute__((swift_name("hash()"))); +- (NSString *)description __attribute__((swift_name("description()"))); +- (int32_t)component1 __attribute__((swift_name("component1()"))); +- (KtPersonWorkerContractor *)doCopyId:(int32_t)id __attribute__((swift_name("doCopy(id:)"))); +@property (readonly) int32_t id __attribute__((swift_name("id"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("ThrowableAsError"))) +@interface KtThrowableAsError : 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__((swift_name("ThrowsThrowableAsError"))) +@protocol KtThrowsThrowableAsError +@required + +/** + @note This method converts all Kotlin exceptions to errors. +*/ +- (BOOL)throwErrorAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("throwError()"))); +@end; + +__attribute__((swift_name("ThrowsThrowableAsErrorSuspend"))) +@protocol KtThrowsThrowableAsErrorSuspend +@required + +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void)throwErrorWithCompletionHandler:(void (^)(KtKotlinUnit * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("throwError(completionHandler:)"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("ThrowableAsErrorKt"))) +@interface KtThrowableAsErrorKt : KtBase ++ (KtThrowableAsError * _Nullable)callAndCatchThrowableAsErrorThrowsThrowableAsError:(id)throwsThrowableAsError __attribute__((swift_name("callAndCatchThrowableAsError(throwsThrowableAsError:)"))); ++ (KtThrowableAsError * _Nullable)callAndCatchThrowableAsErrorSuspendThrowsThrowableAsErrorSuspend:(id)throwsThrowableAsErrorSuspend __attribute__((swift_name("callAndCatchThrowableAsErrorSuspend(throwsThrowableAsErrorSuspend:)"))); +@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:(T _Nullable)first second:(T _Nullable)second third:(T _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()"))); +- (T _Nullable)component1 __attribute__((swift_name("component1()"))); +- (T _Nullable)component2 __attribute__((swift_name("component2()"))); +- (T _Nullable)component3 __attribute__((swift_name("component3()"))); +- (KtTripleVals *)doCopyFirst:(T _Nullable)first second:(T _Nullable)second third:(T _Nullable)third __attribute__((swift_name("doCopy(first:second:third:)"))); +@property (readonly) T _Nullable first __attribute__((swift_name("first"))); +@property (readonly) T _Nullable second __attribute__((swift_name("second"))); +@property (readonly) T _Nullable third __attribute__((swift_name("third"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("TripleVars"))) +@interface KtTripleVars : KtBase +- (instancetype)initWithFirst:(T _Nullable)first second:(T _Nullable)second third:(T _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()"))); +- (T _Nullable)component1 __attribute__((swift_name("component1()"))); +- (T _Nullable)component2 __attribute__((swift_name("component2()"))); +- (T _Nullable)component3 __attribute__((swift_name("component3()"))); +- (KtTripleVars *)doCopyFirst:(T _Nullable)first second:(T _Nullable)second third:(T _Nullable)third __attribute__((swift_name("doCopy(first:second:third:)"))); +@property T _Nullable first __attribute__((swift_name("first"))); +@property T _Nullable second __attribute__((swift_name("second"))); +@property T _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"))); +@property (class, readonly, getter=companion) KtWithCompanionAndObjectCompanion *companion __attribute__((swift_name("companion"))); +@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 (class, readonly, getter=shared) KtWithCompanionAndObjectCompanion *shared __attribute__((swift_name("shared"))); +@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()"))); +@property (class, readonly, getter=shared) KtWithCompanionAndObjectNamed *shared __attribute__((swift_name("shared"))); +- (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("WithGenericDeeplyNestedType"))) +@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()"))); +@property (class, readonly, getter=shared) KtIntBlocksImpl *shared __attribute__((swift_name("shared"))); +- (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()"))); +@property (class, readonly, getter=shared) KtUnitBlockCoercionImpl *shared __attribute__((swift_name("shared"))); +- (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"))); +@property (class, readonly, getter=companion) KtTestInvalidIdentifiersCompanion_ *companion __attribute__((swift_name("companion"))); +- (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 (class, readonly, getter=shared) KtTestInvalidIdentifiersCompanion_ *shared __attribute__((swift_name("shared"))); +@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()"))); +@property (class, readonly, getter=shared) KtGH3525 *shared __attribute__((swift_name("shared"))); +@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"))); +@property (class, readonly) BOOL isExperimentalMM __attribute__((swift_name("isExperimentalMM"))); +@end; + +__attribute__((swift_name("InvariantSuper"))) +@interface KtInvariantSuper : KtBase +@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 +@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 +@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 index 97650fb3f43..cffdf842ac8 100644 --- a/kotlin-native/backend.native/tests/objcexport/expectedLazyNoGenerics.h +++ b/kotlin-native/backend.native/tests/objcexport/expectedLazyNoGenerics.h @@ -180,7 +180,7 @@ __attribute__((swift_name("SuspendBridge"))) @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:)"))); +- (void)unitValue:(id _Nullable)value completionHandler:(void (^)(NSError * _Nullable))completionHandler __attribute__((swift_name("unit(value:completionHandler:)"))); /** @note This method converts instances of CancellationException to errors. @@ -188,6 +188,12 @@ __attribute__((swift_name("SuspendBridge"))) */ - (void)unitAsAnyValue:(id _Nullable)value completionHandler:(void (^)(id _Nullable_result, NSError * _Nullable))completionHandler __attribute__((swift_name("unitAsAny(value:completionHandler:)"))); +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void)nullableUnitValue:(id _Nullable)value completionHandler:(void (^)(KtKotlinUnit * _Nullable_result, NSError * _Nullable))completionHandler __attribute__((swift_name("nullableUnit(value:completionHandler:)"))); + /** @note This method converts all Kotlin exceptions to errors. */ @@ -206,7 +212,7 @@ __attribute__((swift_name("SuspendBridge"))) /** @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:)"))); +- (void)nothingAsUnitValue:(id _Nullable)value completionHandler:(void (^)(NSError * _Nullable))completionHandler __attribute__((swift_name("nothingAsUnit(value:completionHandler:)"))); @end; __attribute__((swift_name("AbstractSuspendBridge"))) @@ -220,12 +226,24 @@ __attribute__((swift_name("AbstractSuspendBridge"))) */ - (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)unitValue:(KtInt *)value completionHandler:(void (^)(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:(KtInt *)value completionHandler:(void (^)(KtKotlinUnit * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("unitAsAny(value:completionHandler:)"))); +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ +- (void)nullableUnitValue:(KtInt *)value completionHandler:(void (^)(KtKotlinUnit * _Nullable_result, NSError * _Nullable))completionHandler __attribute__((swift_name("nullableUnit(value:completionHandler:)"))); + /** @note This method converts all Kotlin exceptions to errors. */ @@ -239,7 +257,7 @@ __attribute__((swift_name("AbstractSuspendBridge"))) /** @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:)"))); +- (void)nothingAsUnitValue:(KtInt *)value completionHandler:(void (^)(NSError * _Nullable))completionHandler __attribute__((swift_name("nothingAsUnit(value:completionHandler:)"))); @end; __attribute__((swift_name("ThrowCancellationException"))) @@ -258,7 +276,7 @@ __attribute__((swift_name("ThrowCancellationExceptionImpl"))) @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:)"))); +- (void)throwCancellationExceptionWithCompletionHandler:(void (^)(NSError * _Nullable))completionHandler __attribute__((swift_name("throwCancellationException(completionHandler:)"))); @end; __attribute__((objc_subclassing_restricted)) @@ -271,12 +289,24 @@ __attribute__((swift_name("CoroutinesKt"))) */ + (void)suspendFunWithCompletionHandler:(void (^)(KtInt * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("suspendFun(completionHandler:)"))); +/** + @note This method converts instances of CancellationException to errors. + Other uncaught Kotlin exceptions are fatal. +*/ ++ (void)unitSuspendFunWithCompletionHandler:(void (^)(NSError * _Nullable))completionHandler __attribute__((swift_name("unitSuspendFun(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_result, 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)unitSuspendFunDoSuspend:(BOOL)doSuspend doThrow:(BOOL)doThrow completionHandler:(void (^)(NSError * _Nullable))completionHandler __attribute__((swift_name("unitSuspendFun(doSuspend:doThrow:completionHandler:)"))); + /** @note This method converts instances of CoroutineException, CancellationException to errors. Other uncaught Kotlin exceptions are fatal. @@ -305,7 +335,7 @@ __attribute__((swift_name("CoroutinesKt"))) @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:)"))); ++ (void)throwCancellationExceptionWithCompletionHandler:(void (^)(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()"))); @@ -1133,7 +1163,7 @@ __attribute__((swift_name("ThrowsThrowableAsErrorSuspend"))) @note This method converts instances of CancellationException to errors. Other uncaught Kotlin exceptions are fatal. */ -- (void)throwErrorWithCompletionHandler:(void (^)(KtKotlinUnit * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("throwError(completionHandler:)"))); +- (void)throwErrorWithCompletionHandler:(void (^)(NSError * _Nullable))completionHandler __attribute__((swift_name("throwError(completionHandler:)"))); @end; __attribute__((objc_subclassing_restricted)) diff --git a/kotlin-native/backend.native/tests/objcexport/throwableAsError.swift b/kotlin-native/backend.native/tests/objcexport/throwableAsError.swift index 3536b611d41..eaff9ebbe78 100644 --- a/kotlin-native/backend.native/tests/objcexport/throwableAsError.swift +++ b/kotlin-native/backend.native/tests/objcexport/throwableAsError.swift @@ -38,9 +38,15 @@ private class ThrowsThrowableAsErrorSuspendImpl : ThrowsThrowableAsErrorSuspend self.throwable = throwable } +#if LEGACY_SUSPEND_UNIT_FUNCTION_EXPORT func throwError(completionHandler: @escaping (KotlinUnit?, Error?) -> Void) { completionHandler(nil, throwable.asError()) } +#else + func throwError(completionHandler: @escaping (Error?) -> Void) { + completionHandler(throwable.asError()) + } +#endif } class ThrowableAsErrorTests : SimpleTestProvider { diff --git a/kotlin-native/runtime/src/main/cpp/ObjCExportCoroutines.mm b/kotlin-native/runtime/src/main/cpp/ObjCExportCoroutines.mm index 66bfdc12683..f93abc9bcf8 100644 --- a/kotlin-native/runtime/src/main/cpp/ObjCExportCoroutines.mm +++ b/kotlin-native/runtime/src/main/cpp/ObjCExportCoroutines.mm @@ -48,12 +48,21 @@ extern "C" OBJ_GETTER(Kotlin_ObjCExport_createContinuationArgument, id completio RETURN_RESULT_OF(Kotlin_ObjCExport_createContinuationArgumentImpl, completionHolder, exceptionTypes); } +extern "C" OBJ_GETTER(Kotlin_ObjCExport_createUnitContinuationArgument, id completion, const TypeInfo** exceptionTypes) { + void (^typedCompletion)(NSError * _Nullable) = completion; + Completion twoArgumentCompletion = ^(_Nullable id result, NSError* _Nullable error) { + // typedCompletion will be retained by the containing block when the latter is copied + // from stack to heap via objc_retainBlock. + typedCompletion(error); + }; + + RETURN_RESULT_OF(Kotlin_ObjCExport_createContinuationArgument, twoArgumentCompletion, exceptionTypes); +} + extern "C" void Kotlin_ObjCExport_resumeContinuationSuccess(KRef continuation, KRef result); extern "C" void Kotlin_ObjCExport_resumeContinuationFailure(KRef continuation, KRef exception); -extern "C" void Kotlin_ObjCExport_resumeContinuation(KRef continuation, id result, id error) { - ObjHolder holder; - +extern "C" void Kotlin_ObjCExport_resumeContinuation(KRef continuation, KRef result, id error) { if (error != nullptr) { if (result != nullptr) { [NSException raise:NSGenericException @@ -61,11 +70,12 @@ extern "C" void Kotlin_ObjCExport_resumeContinuation(KRef continuation, id resul result, error]; } + ObjHolder holder; + KRef exception = Kotlin_ObjCExport_NSErrorAsException(error, holder.slot()); Kotlin_ObjCExport_resumeContinuationFailure(continuation, exception); } else { - KRef kotlinResult = Kotlin_ObjCExport_refFromObjC(result, holder.slot()); - Kotlin_ObjCExport_resumeContinuationSuccess(continuation, kotlinResult); + Kotlin_ObjCExport_resumeContinuationSuccess(continuation, result); } } diff --git a/kotlin-native/runtime/src/mm/cpp/CallsChecker.cpp b/kotlin-native/runtime/src/mm/cpp/CallsChecker.cpp index 740de889ca5..3ac425d077d 100644 --- a/kotlin-native/runtime/src/mm/cpp/CallsChecker.cpp +++ b/kotlin-native/runtime/src/mm/cpp/CallsChecker.cpp @@ -185,6 +185,7 @@ extern "C" const char* Kotlin_callsCheckerGoodFunctionNames[] = { "CFStringCreateCopy", "CFStringGetCharacters", "CFStringGetLength", + "_Block_object_assign", "class_addIvar", "class_addMethod", "class_addProtocol",