[ObjCExport] K1 header generator test setup: Use native compiler/native builtIns and production namer configuration
To keep the tests closer to 'real life'/'production.' KT-65670
This commit is contained in:
committed by
Space Team
parent
ee2aa6d67f
commit
152aa24c53
+11
-13
@@ -11,7 +11,6 @@ import org.jetbrains.kotlin.backend.konan.UnitSuspendFunctionObjCExport
|
||||
import org.jetbrains.kotlin.backend.konan.objcexport.*
|
||||
import org.jetbrains.kotlin.builtins.DefaultBuiltIns
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
|
||||
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
||||
import org.junit.jupiter.api.extension.AfterEachCallback
|
||||
import org.junit.jupiter.api.extension.ExtensionContext
|
||||
import org.junit.jupiter.api.extension.ParameterContext
|
||||
@@ -57,28 +56,27 @@ private class Fe10HeaderGeneratorImpl(private val disposable: Disposable) : Head
|
||||
private fun createObjCExportHeaderGenerator(
|
||||
disposable: Disposable, root: File, configuration: HeaderGenerator.Configuration,
|
||||
): ObjCExportHeaderGenerator {
|
||||
val environment: KotlinCoreEnvironment = createKotlinCoreEnvironment(disposable)
|
||||
|
||||
val kotlinFiles = root.walkTopDown().filter { it.isFile }.filter { it.extension == "kt" }.toList()
|
||||
val moduleDescriptors = setOf(createModuleDescriptor(environment, kotlinFiles))
|
||||
|
||||
val mapper = ObjCExportMapper(
|
||||
unitSuspendFunctionExport = UnitSuspendFunctionObjCExport.DEFAULT
|
||||
)
|
||||
|
||||
val namer = ObjCExportNamerImpl(
|
||||
mapper = mapper,
|
||||
moduleDescriptors = moduleDescriptors,
|
||||
builtIns = DefaultBuiltIns.Instance,
|
||||
local = false,
|
||||
mapper = mapper,
|
||||
problemCollector = ObjCExportProblemCollector.SILENT,
|
||||
configuration = object : ObjCExportNamer.Configuration {
|
||||
override val topLevelNamePrefix: String get() = configuration.frameworkName
|
||||
override fun getAdditionalPrefix(module: ModuleDescriptor): String? = null
|
||||
override val objcGenerics: Boolean = true
|
||||
}
|
||||
topLevelNamePrefix = configuration.frameworkName,
|
||||
local = false,
|
||||
objcGenerics = true,
|
||||
)
|
||||
|
||||
val environment: KotlinCoreEnvironment = createKotlinCoreEnvironment(disposable)
|
||||
|
||||
val kotlinFiles = root.walkTopDown().filter { it.isFile }.filter { it.extension == "kt" }.toList()
|
||||
|
||||
return ObjCExportHeaderGeneratorImpl(
|
||||
moduleDescriptors = listOf(createModuleDescriptor(environment, kotlinFiles)),
|
||||
moduleDescriptors = moduleDescriptors.toList(),
|
||||
mapper = mapper,
|
||||
namer = namer,
|
||||
problemCollector = ObjCExportProblemCollector.SILENT,
|
||||
|
||||
+44
-61
@@ -6,31 +6,28 @@
|
||||
package org.jetbrains.kotlin.backend.konan.testUtils
|
||||
|
||||
import com.intellij.openapi.Disposable
|
||||
import org.jetbrains.kotlin.analyzer.ModuleInfo
|
||||
import org.jetbrains.kotlin.analyzer.common.CommonDependenciesContainer
|
||||
import org.jetbrains.kotlin.analyzer.common.CommonResolverForModuleFactory
|
||||
import org.jetbrains.kotlin.backend.common.serialization.metadata.DynamicTypeDeserializer
|
||||
import org.jetbrains.kotlin.builtins.DefaultBuiltIns
|
||||
import org.jetbrains.kotlin.builtins.konan.KonanBuiltIns
|
||||
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
|
||||
import org.jetbrains.kotlin.cli.common.arguments.K2NativeCompilerArguments
|
||||
import org.jetbrains.kotlin.cli.common.createFlexiblePhaseConfig
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.NoScopeRecordCliBindingTrace
|
||||
import org.jetbrains.kotlin.config.*
|
||||
import org.jetbrains.kotlin.context.ProjectContext
|
||||
import org.jetbrains.kotlin.context.withModule
|
||||
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.PackageFragmentProvider
|
||||
import org.jetbrains.kotlin.descriptors.impl.ModuleDependenciesImpl
|
||||
import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl
|
||||
import org.jetbrains.kotlin.library.metadata.CurrentKlibModuleOrigin
|
||||
import org.jetbrains.kotlin.library.metadata.KlibMetadataFactories
|
||||
import org.jetbrains.kotlin.library.metadata.KlibModuleOrigin
|
||||
import org.jetbrains.kotlin.library.resolveSingleFileKlib
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.platform.CommonPlatforms
|
||||
import org.jetbrains.kotlin.platform.TargetPlatform
|
||||
import org.jetbrains.kotlin.native.FakeTopDownAnalyzerFacadeForNative
|
||||
import org.jetbrains.kotlin.platform.konan.NativePlatforms
|
||||
import org.jetbrains.kotlin.psi.KtPsiFactory
|
||||
import org.jetbrains.kotlin.resolve.CompilerEnvironment
|
||||
import org.jetbrains.kotlin.resolve.PlatformDependentAnalyzerServices
|
||||
import org.jetbrains.kotlin.resolve.konan.platform.NativePlatformAnalyzerServices
|
||||
import org.jetbrains.kotlin.storage.LockBasedStorageManager
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil
|
||||
@@ -58,19 +55,44 @@ fun createModuleDescriptor(
|
||||
val psiFactory = KtPsiFactory(environment.project)
|
||||
val kotlinPsiFiles = kotlinFiles.map { file -> psiFactory.createFile(file.name, KtTestUtil.doLoadFile(file)) }
|
||||
|
||||
val analysisResult = CommonResolverForModuleFactory.analyzeFiles(
|
||||
files = kotlinPsiFiles,
|
||||
moduleName = Name.special("<test_module>"),
|
||||
dependOnBuiltIns = true,
|
||||
languageVersionSettings = environment.configuration.languageVersionSettings,
|
||||
targetPlatform = CommonPlatforms.defaultCommonPlatform,
|
||||
targetEnvironment = CompilerEnvironment,
|
||||
dependenciesContainer = DependenciesContainerImpl,
|
||||
) { content ->
|
||||
environment.createPackagePartProvider(content.moduleContentScope)
|
||||
}
|
||||
val klibFactory = KlibMetadataFactories(::KonanBuiltIns, DynamicTypeDeserializer)
|
||||
|
||||
return analysisResult.moduleDescriptor
|
||||
val stdlibModuleDescriptor = klibFactory.DefaultDeserializedDescriptorFactory.createDescriptorAndNewBuiltIns(
|
||||
library = resolveSingleFileKlib(org.jetbrains.kotlin.konan.file.File(kotlinNativeStdlibPath)),
|
||||
languageVersionSettings = createLanguageVersionSettings(),
|
||||
storageManager = LockBasedStorageManager.NO_LOCKS,
|
||||
packageAccessHandler = null
|
||||
).also { it.setDependencies(it) }
|
||||
|
||||
val moduleDescriptor = ModuleDescriptorImpl(
|
||||
moduleName = Name.special("<test_module>"),
|
||||
storageManager = LockBasedStorageManager.NO_LOCKS,
|
||||
builtIns = KonanBuiltIns(LockBasedStorageManager.NO_LOCKS).apply {
|
||||
builtInsModule = stdlibModuleDescriptor.builtIns.builtInsModule
|
||||
},
|
||||
platform = NativePlatforms.unspecifiedNativePlatform,
|
||||
capabilities = mapOf(
|
||||
KlibModuleOrigin.CAPABILITY to CurrentKlibModuleOrigin,
|
||||
)
|
||||
)
|
||||
|
||||
moduleDescriptor.setDependencies(
|
||||
ModuleDependenciesImpl(
|
||||
allDependencies = listOf(moduleDescriptor, stdlibModuleDescriptor),
|
||||
modulesWhoseInternalsAreVisible = emptySet(),
|
||||
directExpectedByDependencies = emptyList(),
|
||||
allExpectedByDependencies = emptySet()
|
||||
)
|
||||
)
|
||||
|
||||
val projectContext = ProjectContext(environment.project, "test project context")
|
||||
|
||||
return FakeTopDownAnalyzerFacadeForNative.analyzeFilesWithGivenTrace(
|
||||
files = kotlinPsiFiles,
|
||||
trace = NoScopeRecordCliBindingTrace(),
|
||||
languageVersionSettings = createLanguageVersionSettings(),
|
||||
moduleContext = projectContext.withModule(moduleDescriptor)
|
||||
).moduleDescriptor
|
||||
}
|
||||
|
||||
fun createKotlinCoreEnvironment(
|
||||
@@ -94,42 +116,3 @@ private fun createLanguageVersionSettings() = LanguageVersionSettingsImpl(
|
||||
languageVersion = LanguageVersion.LATEST_STABLE,
|
||||
apiVersion = ApiVersion.LATEST_STABLE
|
||||
)
|
||||
|
||||
private object DependenciesContainerImpl : CommonDependenciesContainer {
|
||||
override val moduleInfos: List<ModuleInfo> get() = listOf(DefaultBuiltInsModuleInfo, KotlinNativeStdlibModuleInfo)
|
||||
override val friendModuleInfos: List<ModuleInfo> get() = emptyList()
|
||||
override val refinesModuleInfos: List<ModuleInfo> get() = emptyList()
|
||||
override fun registerDependencyForAllModules(moduleInfo: ModuleInfo, descriptorForModule: ModuleDescriptorImpl) = Unit
|
||||
override fun packageFragmentProviderForModuleInfo(moduleInfo: ModuleInfo): PackageFragmentProvider? = null
|
||||
|
||||
private val klibFactory = KlibMetadataFactories(::KonanBuiltIns, DynamicTypeDeserializer)
|
||||
|
||||
private val stdlibModuleDescriptor = klibFactory.DefaultDeserializedDescriptorFactory.createDescriptor(
|
||||
library = resolveSingleFileKlib(org.jetbrains.kotlin.konan.file.File(kotlinNativeStdlibPath)),
|
||||
languageVersionSettings = createLanguageVersionSettings(),
|
||||
builtIns = DefaultBuiltIns.Instance,
|
||||
storageManager = LockBasedStorageManager.NO_LOCKS,
|
||||
packageAccessHandler = null
|
||||
).also { it.setDependencies(it) }
|
||||
|
||||
override fun moduleDescriptorForModuleInfo(moduleInfo: ModuleInfo): ModuleDescriptor {
|
||||
if (moduleInfo == DefaultBuiltInsModuleInfo) return DefaultBuiltIns.Instance.builtInsModule
|
||||
if (moduleInfo == KotlinNativeStdlibModuleInfo) return stdlibModuleDescriptor
|
||||
error("Unknown module info $moduleInfo")
|
||||
}
|
||||
}
|
||||
|
||||
private object DefaultBuiltInsModuleInfo : ModuleInfo {
|
||||
override val name get() = DefaultBuiltIns.Instance.builtInsModule.name
|
||||
override fun dependencies() = listOf(this)
|
||||
override fun dependencyOnBuiltIns() = ModuleInfo.DependencyOnBuiltIns.LAST
|
||||
override val platform get() = NativePlatforms.unspecifiedNativePlatform
|
||||
override val analyzerServices get() = NativePlatformAnalyzerServices
|
||||
}
|
||||
|
||||
private object KotlinNativeStdlibModuleInfo : ModuleInfo {
|
||||
override val analyzerServices: PlatformDependentAnalyzerServices = NativePlatformAnalyzerServices
|
||||
override val name: Name = Name.special("<stdlib>")
|
||||
override val platform: TargetPlatform = NativePlatforms.unspecifiedNativePlatform
|
||||
override fun dependencies(): List<ModuleInfo> = listOf(this)
|
||||
}
|
||||
+1
-1
@@ -88,7 +88,7 @@ class ObjCExportTypeTranslationTest(
|
||||
""".trimIndent()
|
||||
)
|
||||
|
||||
assertEquals("Unit * -> void", header.renderTypesOfSymbol("foo"))
|
||||
assertEquals("KotlinUnit * -> void", header.renderTypesOfSymbol("foo"))
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
@class Array<T>;
|
||||
@class KotlinArray<T>;
|
||||
|
||||
@protocol Iterator;
|
||||
@protocol KotlinIterator;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
#pragma clang diagnostic push
|
||||
@@ -24,21 +24,21 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface FooKt : Base
|
||||
@property (class, readonly) Array<Int *> *a __attribute__((swift_name("a")));
|
||||
@property (class, readonly) KotlinArray<Int *> *a __attribute__((swift_name("a")));
|
||||
@end
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface Array<T> : Base
|
||||
@interface KotlinArray<T> : Base
|
||||
+ (instancetype)arrayWithSize:(int32_t)size init:(T _Nullable (^)(Int *))init __attribute__((swift_name("init(size:init:)")));
|
||||
+ (instancetype)alloc __attribute__((unavailable));
|
||||
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
|
||||
- (T _Nullable)getIndex:(int32_t)index __attribute__((swift_name("get(index:)")));
|
||||
- (id<Iterator>)iterator __attribute__((swift_name("iterator()")));
|
||||
- (id<KotlinIterator>)iterator __attribute__((swift_name("iterator()")));
|
||||
- (void)setIndex:(int32_t)index value:(T _Nullable)value __attribute__((swift_name("set(index:value:)")));
|
||||
@property (readonly) int32_t size __attribute__((swift_name("size")));
|
||||
@end
|
||||
|
||||
@protocol Iterator
|
||||
@protocol KotlinIterator
|
||||
@required
|
||||
- (BOOL)hasNext __attribute__((swift_name("hasNext()")));
|
||||
- (id _Nullable)next __attribute__((swift_name("next()")));
|
||||
|
||||
Vendored
+3
-3
@@ -6,7 +6,7 @@
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
@protocol Iterator;
|
||||
@protocol KotlinIterator;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
#pragma clang diagnostic push
|
||||
@@ -20,14 +20,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
#define _Nullable_result _Nullable
|
||||
#endif
|
||||
|
||||
@protocol Iterator
|
||||
@protocol KotlinIterator
|
||||
@required
|
||||
- (BOOL)hasNext __attribute__((swift_name("hasNext()")));
|
||||
- (id _Nullable)next __attribute__((swift_name("next()")));
|
||||
@end
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface Foo : Base <Iterator>
|
||||
@interface Foo : Base <KotlinIterator>
|
||||
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
|
||||
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
|
||||
- (BOOL)hasNext __attribute__((swift_name("hasNext()")));
|
||||
|
||||
+3
-3
@@ -6,7 +6,7 @@
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
@protocol Iterator;
|
||||
@protocol KotlinIterator;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
#pragma clang diagnostic push
|
||||
@@ -22,10 +22,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface FooKt : Base
|
||||
@property (class, readonly) id<Iterator> a __attribute__((swift_name("a")));
|
||||
@property (class, readonly) id<KotlinIterator> a __attribute__((swift_name("a")));
|
||||
@end
|
||||
|
||||
@protocol Iterator
|
||||
@protocol KotlinIterator
|
||||
@required
|
||||
- (BOOL)hasNext __attribute__((swift_name("hasNext()")));
|
||||
- (id _Nullable)next __attribute__((swift_name("next()")));
|
||||
|
||||
+48
-48
@@ -6,9 +6,9 @@
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
@class StringBuilder, CharArray, CharIterator;
|
||||
@class KotlinStringBuilder, KotlinCharArray, KotlinCharIterator;
|
||||
|
||||
@protocol CharSequence, Appendable, Iterator;
|
||||
@protocol KotlinCharSequence, KotlinAppendable, KotlinIterator;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
#pragma clang diagnostic push
|
||||
@@ -24,68 +24,68 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface FooKt : Base
|
||||
@property (class, readonly) StringBuilder *a __attribute__((swift_name("a")));
|
||||
@property (class, readonly) KotlinStringBuilder *a __attribute__((swift_name("a")));
|
||||
@end
|
||||
|
||||
@protocol CharSequence
|
||||
@protocol KotlinCharSequence
|
||||
@required
|
||||
- (unichar)getIndex:(int32_t)index __attribute__((swift_name("get(index:)")));
|
||||
- (id)subSequenceStartIndex:(int32_t)startIndex endIndex:(int32_t)endIndex __attribute__((swift_name("subSequence(startIndex:endIndex:)")));
|
||||
@property (readonly) int32_t length __attribute__((swift_name("length")));
|
||||
@end
|
||||
|
||||
@protocol Appendable
|
||||
@protocol KotlinAppendable
|
||||
@required
|
||||
- (id<Appendable>)appendValue:(unichar)value __attribute__((swift_name("append(value:)")));
|
||||
- (id<Appendable>)appendValue_:(id _Nullable)value __attribute__((swift_name("append(value_:)")));
|
||||
- (id<Appendable>)appendValue:(id _Nullable)value startIndex:(int32_t)startIndex endIndex:(int32_t)endIndex __attribute__((swift_name("append(value:startIndex:endIndex:)")));
|
||||
- (id<KotlinAppendable>)appendValue:(unichar)value __attribute__((swift_name("append(value:)")));
|
||||
- (id<KotlinAppendable>)appendValue_:(id _Nullable)value __attribute__((swift_name("append(value_:)")));
|
||||
- (id<KotlinAppendable>)appendValue:(id _Nullable)value startIndex:(int32_t)startIndex endIndex:(int32_t)endIndex __attribute__((swift_name("append(value:startIndex:endIndex:)")));
|
||||
@end
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface StringBuilder : Base <CharSequence, Appendable>
|
||||
@interface KotlinStringBuilder : Base <KotlinCharSequence, KotlinAppendable>
|
||||
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
|
||||
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
|
||||
- (instancetype)initWithContent:(id)content __attribute__((swift_name("init(content:)"))) __attribute__((objc_designated_initializer));
|
||||
- (instancetype)initWithCapacity:(int32_t)capacity __attribute__((swift_name("init(capacity:)"))) __attribute__((objc_designated_initializer));
|
||||
- (instancetype)initWithContent_:(NSString *)content __attribute__((swift_name("init(content_:)"))) __attribute__((objc_designated_initializer));
|
||||
- (StringBuilder *)appendValue__:(id _Nullable)value __attribute__((swift_name("append(value__:)")));
|
||||
- (StringBuilder *)appendValue___:(BOOL)value __attribute__((swift_name("append(value___:)")));
|
||||
- (StringBuilder *)appendValue____:(int8_t)value __attribute__((swift_name("append(value____:)")));
|
||||
- (StringBuilder *)appendValue:(unichar)value __attribute__((swift_name("append(value:)")));
|
||||
- (StringBuilder *)appendValue_____:(CharArray *)value __attribute__((swift_name("append(value_____:)")));
|
||||
- (StringBuilder *)appendValue_:(id _Nullable)value __attribute__((swift_name("append(value_:)")));
|
||||
- (StringBuilder *)appendValue______:(double)value __attribute__((swift_name("append(value______:)")));
|
||||
- (StringBuilder *)appendValue_______:(float)value __attribute__((swift_name("append(value_______:)")));
|
||||
- (StringBuilder *)appendValue________:(int32_t)value __attribute__((swift_name("append(value________:)")));
|
||||
- (StringBuilder *)appendValue_________:(int64_t)value __attribute__((swift_name("append(value_________:)")));
|
||||
- (StringBuilder *)appendValue__________:(int16_t)value __attribute__((swift_name("append(value__________:)")));
|
||||
- (StringBuilder *)appendValue___________:(NSString * _Nullable)value __attribute__((swift_name("append(value___________:)")));
|
||||
- (StringBuilder *)appendValue:(id _Nullable)value startIndex:(int32_t)startIndex endIndex:(int32_t)endIndex __attribute__((swift_name("append(value:startIndex:endIndex:)")));
|
||||
- (KotlinStringBuilder *)appendValue__:(id _Nullable)value __attribute__((swift_name("append(value__:)")));
|
||||
- (KotlinStringBuilder *)appendValue___:(BOOL)value __attribute__((swift_name("append(value___:)")));
|
||||
- (KotlinStringBuilder *)appendValue____:(int8_t)value __attribute__((swift_name("append(value____:)")));
|
||||
- (KotlinStringBuilder *)appendValue:(unichar)value __attribute__((swift_name("append(value:)")));
|
||||
- (KotlinStringBuilder *)appendValue_____:(KotlinCharArray *)value __attribute__((swift_name("append(value_____:)")));
|
||||
- (KotlinStringBuilder *)appendValue_:(id _Nullable)value __attribute__((swift_name("append(value_:)")));
|
||||
- (KotlinStringBuilder *)appendValue______:(double)value __attribute__((swift_name("append(value______:)")));
|
||||
- (KotlinStringBuilder *)appendValue_______:(float)value __attribute__((swift_name("append(value_______:)")));
|
||||
- (KotlinStringBuilder *)appendValue________:(int32_t)value __attribute__((swift_name("append(value________:)")));
|
||||
- (KotlinStringBuilder *)appendValue_________:(int64_t)value __attribute__((swift_name("append(value_________:)")));
|
||||
- (KotlinStringBuilder *)appendValue__________:(int16_t)value __attribute__((swift_name("append(value__________:)")));
|
||||
- (KotlinStringBuilder *)appendValue___________:(NSString * _Nullable)value __attribute__((swift_name("append(value___________:)")));
|
||||
- (KotlinStringBuilder *)appendValue:(id _Nullable)value startIndex:(int32_t)startIndex endIndex:(int32_t)endIndex __attribute__((swift_name("append(value:startIndex:endIndex:)")));
|
||||
|
||||
/**
|
||||
* @note annotations
|
||||
* kotlin.SinceKotlin(version="1.4")
|
||||
*/
|
||||
- (StringBuilder *)appendRangeValue:(CharArray *)value startIndex:(int32_t)startIndex endIndex:(int32_t)endIndex __attribute__((swift_name("appendRange(value:startIndex:endIndex:)")));
|
||||
- (KotlinStringBuilder *)appendRangeValue:(KotlinCharArray *)value startIndex:(int32_t)startIndex endIndex:(int32_t)endIndex __attribute__((swift_name("appendRange(value:startIndex:endIndex:)")));
|
||||
|
||||
/**
|
||||
* @note annotations
|
||||
* kotlin.SinceKotlin(version="1.4")
|
||||
*/
|
||||
- (StringBuilder *)appendRangeValue:(id)value startIndex:(int32_t)startIndex endIndex_:(int32_t)endIndex __attribute__((swift_name("appendRange(value:startIndex:endIndex_:)")));
|
||||
- (KotlinStringBuilder *)appendRangeValue:(id)value startIndex:(int32_t)startIndex endIndex_:(int32_t)endIndex __attribute__((swift_name("appendRange(value:startIndex:endIndex_:)")));
|
||||
- (int32_t)capacity __attribute__((swift_name("capacity()")));
|
||||
|
||||
/**
|
||||
* @note annotations
|
||||
* kotlin.SinceKotlin(version="1.4")
|
||||
*/
|
||||
- (StringBuilder *)deleteAtIndex:(int32_t)index __attribute__((swift_name("deleteAt(index:)")));
|
||||
- (KotlinStringBuilder *)deleteAtIndex:(int32_t)index __attribute__((swift_name("deleteAt(index:)")));
|
||||
|
||||
/**
|
||||
* @note annotations
|
||||
* kotlin.SinceKotlin(version="1.4")
|
||||
*/
|
||||
- (StringBuilder *)deleteRangeStartIndex:(int32_t)startIndex endIndex:(int32_t)endIndex __attribute__((swift_name("deleteRange(startIndex:endIndex:)")));
|
||||
- (KotlinStringBuilder *)deleteRangeStartIndex:(int32_t)startIndex endIndex:(int32_t)endIndex __attribute__((swift_name("deleteRange(startIndex:endIndex:)")));
|
||||
- (void)ensureCapacityMinimumCapacity:(int32_t)minimumCapacity __attribute__((swift_name("ensureCapacity(minimumCapacity:)")));
|
||||
- (unichar)getIndex:(int32_t)index __attribute__((swift_name("get(index:)")));
|
||||
|
||||
@@ -100,30 +100,30 @@ __attribute__((objc_subclassing_restricted))
|
||||
* kotlin.SinceKotlin(version="1.4")
|
||||
*/
|
||||
- (int32_t)indexOfString:(NSString *)string startIndex:(int32_t)startIndex __attribute__((swift_name("indexOf(string:startIndex:)")));
|
||||
- (StringBuilder *)insertIndex:(int32_t)index value:(id _Nullable)value __attribute__((swift_name("insert(index:value:)")));
|
||||
- (StringBuilder *)insertIndex:(int32_t)index value_:(BOOL)value __attribute__((swift_name("insert(index:value_:)")));
|
||||
- (StringBuilder *)insertIndex:(int32_t)index value__:(int8_t)value __attribute__((swift_name("insert(index:value__:)")));
|
||||
- (StringBuilder *)insertIndex:(int32_t)index value___:(unichar)value __attribute__((swift_name("insert(index:value___:)")));
|
||||
- (StringBuilder *)insertIndex:(int32_t)index value____:(CharArray *)value __attribute__((swift_name("insert(index:value____:)")));
|
||||
- (StringBuilder *)insertIndex:(int32_t)index value_____:(id _Nullable)value __attribute__((swift_name("insert(index:value_____:)")));
|
||||
- (StringBuilder *)insertIndex:(int32_t)index value______:(double)value __attribute__((swift_name("insert(index:value______:)")));
|
||||
- (StringBuilder *)insertIndex:(int32_t)index value_______:(float)value __attribute__((swift_name("insert(index:value_______:)")));
|
||||
- (StringBuilder *)insertIndex:(int32_t)index value________:(int32_t)value __attribute__((swift_name("insert(index:value________:)")));
|
||||
- (StringBuilder *)insertIndex:(int32_t)index value_________:(int64_t)value __attribute__((swift_name("insert(index:value_________:)")));
|
||||
- (StringBuilder *)insertIndex:(int32_t)index value__________:(int16_t)value __attribute__((swift_name("insert(index:value__________:)")));
|
||||
- (StringBuilder *)insertIndex:(int32_t)index value___________:(NSString * _Nullable)value __attribute__((swift_name("insert(index:value___________:)")));
|
||||
- (KotlinStringBuilder *)insertIndex:(int32_t)index value:(id _Nullable)value __attribute__((swift_name("insert(index:value:)")));
|
||||
- (KotlinStringBuilder *)insertIndex:(int32_t)index value_:(BOOL)value __attribute__((swift_name("insert(index:value_:)")));
|
||||
- (KotlinStringBuilder *)insertIndex:(int32_t)index value__:(int8_t)value __attribute__((swift_name("insert(index:value__:)")));
|
||||
- (KotlinStringBuilder *)insertIndex:(int32_t)index value___:(unichar)value __attribute__((swift_name("insert(index:value___:)")));
|
||||
- (KotlinStringBuilder *)insertIndex:(int32_t)index value____:(KotlinCharArray *)value __attribute__((swift_name("insert(index:value____:)")));
|
||||
- (KotlinStringBuilder *)insertIndex:(int32_t)index value_____:(id _Nullable)value __attribute__((swift_name("insert(index:value_____:)")));
|
||||
- (KotlinStringBuilder *)insertIndex:(int32_t)index value______:(double)value __attribute__((swift_name("insert(index:value______:)")));
|
||||
- (KotlinStringBuilder *)insertIndex:(int32_t)index value_______:(float)value __attribute__((swift_name("insert(index:value_______:)")));
|
||||
- (KotlinStringBuilder *)insertIndex:(int32_t)index value________:(int32_t)value __attribute__((swift_name("insert(index:value________:)")));
|
||||
- (KotlinStringBuilder *)insertIndex:(int32_t)index value_________:(int64_t)value __attribute__((swift_name("insert(index:value_________:)")));
|
||||
- (KotlinStringBuilder *)insertIndex:(int32_t)index value__________:(int16_t)value __attribute__((swift_name("insert(index:value__________:)")));
|
||||
- (KotlinStringBuilder *)insertIndex:(int32_t)index value___________:(NSString * _Nullable)value __attribute__((swift_name("insert(index:value___________:)")));
|
||||
|
||||
/**
|
||||
* @note annotations
|
||||
* kotlin.SinceKotlin(version="1.4")
|
||||
*/
|
||||
- (StringBuilder *)insertRangeIndex:(int32_t)index value:(CharArray *)value startIndex:(int32_t)startIndex endIndex:(int32_t)endIndex __attribute__((swift_name("insertRange(index:value:startIndex:endIndex:)")));
|
||||
- (KotlinStringBuilder *)insertRangeIndex:(int32_t)index value:(KotlinCharArray *)value startIndex:(int32_t)startIndex endIndex:(int32_t)endIndex __attribute__((swift_name("insertRange(index:value:startIndex:endIndex:)")));
|
||||
|
||||
/**
|
||||
* @note annotations
|
||||
* kotlin.SinceKotlin(version="1.4")
|
||||
*/
|
||||
- (StringBuilder *)insertRangeIndex:(int32_t)index value:(id)value startIndex:(int32_t)startIndex endIndex_:(int32_t)endIndex __attribute__((swift_name("insertRange(index:value:startIndex:endIndex_:)")));
|
||||
- (KotlinStringBuilder *)insertRangeIndex:(int32_t)index value:(id)value startIndex:(int32_t)startIndex endIndex_:(int32_t)endIndex __attribute__((swift_name("insertRange(index:value:startIndex:endIndex_:)")));
|
||||
|
||||
/**
|
||||
* @note annotations
|
||||
@@ -136,7 +136,7 @@ __attribute__((objc_subclassing_restricted))
|
||||
* kotlin.SinceKotlin(version="1.4")
|
||||
*/
|
||||
- (int32_t)lastIndexOfString:(NSString *)string startIndex:(int32_t)startIndex __attribute__((swift_name("lastIndexOf(string:startIndex:)")));
|
||||
- (StringBuilder *)reverse __attribute__((swift_name("reverse()")));
|
||||
- (KotlinStringBuilder *)reverse __attribute__((swift_name("reverse()")));
|
||||
- (void)setIndex:(int32_t)index value:(unichar)value __attribute__((swift_name("set(index:value:)")));
|
||||
- (void)setLengthNewLength:(int32_t)newLength __attribute__((swift_name("setLength(newLength:)")));
|
||||
|
||||
@@ -144,7 +144,7 @@ __attribute__((objc_subclassing_restricted))
|
||||
* @note annotations
|
||||
* kotlin.SinceKotlin(version="1.4")
|
||||
*/
|
||||
- (StringBuilder *)setRangeStartIndex:(int32_t)startIndex endIndex:(int32_t)endIndex value:(NSString *)value __attribute__((swift_name("setRange(startIndex:endIndex:value:)")));
|
||||
- (KotlinStringBuilder *)setRangeStartIndex:(int32_t)startIndex endIndex:(int32_t)endIndex value:(NSString *)value __attribute__((swift_name("setRange(startIndex:endIndex:value:)")));
|
||||
- (id)subSequenceStartIndex:(int32_t)startIndex endIndex:(int32_t)endIndex __attribute__((swift_name("subSequence(startIndex:endIndex:)")));
|
||||
|
||||
/**
|
||||
@@ -158,31 +158,31 @@ __attribute__((objc_subclassing_restricted))
|
||||
* @note annotations
|
||||
* kotlin.SinceKotlin(version="1.4")
|
||||
*/
|
||||
- (void)toCharArrayDestination:(CharArray *)destination destinationOffset:(int32_t)destinationOffset startIndex:(int32_t)startIndex endIndex:(int32_t)endIndex __attribute__((swift_name("toCharArray(destination:destinationOffset:startIndex:endIndex:)")));
|
||||
- (void)toCharArrayDestination:(KotlinCharArray *)destination destinationOffset:(int32_t)destinationOffset startIndex:(int32_t)startIndex endIndex:(int32_t)endIndex __attribute__((swift_name("toCharArray(destination:destinationOffset:startIndex:endIndex:)")));
|
||||
- (NSString *)description __attribute__((swift_name("description()")));
|
||||
- (void)trimToSize __attribute__((swift_name("trimToSize()")));
|
||||
@property (readonly) int32_t length __attribute__((swift_name("length")));
|
||||
@end
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface CharArray : Base
|
||||
@interface KotlinCharArray : Base
|
||||
+ (instancetype)arrayWithSize:(int32_t)size __attribute__((swift_name("init(size:)")));
|
||||
+ (instancetype)arrayWithSize:(int32_t)size init:(id _Nullable (^)(id _Nullable))init __attribute__((swift_name("init(size:init:)")));
|
||||
+ (instancetype)arrayWithSize:(int32_t)size init:(id (^)(Int *))init __attribute__((swift_name("init(size:init:)")));
|
||||
+ (instancetype)alloc __attribute__((unavailable));
|
||||
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
|
||||
- (unichar)getIndex:(int32_t)index __attribute__((swift_name("get(index:)")));
|
||||
- (CharIterator *)iterator __attribute__((swift_name("iterator()")));
|
||||
- (KotlinCharIterator *)iterator __attribute__((swift_name("iterator()")));
|
||||
- (void)setIndex:(int32_t)index value:(unichar)value __attribute__((swift_name("set(index:value:)")));
|
||||
@property (readonly) int32_t size __attribute__((swift_name("size")));
|
||||
@end
|
||||
|
||||
@protocol Iterator
|
||||
@protocol KotlinIterator
|
||||
@required
|
||||
- (BOOL)hasNext __attribute__((swift_name("hasNext()")));
|
||||
- (id _Nullable)next __attribute__((swift_name("next()")));
|
||||
@end
|
||||
|
||||
@interface CharIterator : Base <Iterator>
|
||||
@interface KotlinCharIterator : Base <KotlinIterator>
|
||||
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
|
||||
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
|
||||
- (id)next __attribute__((swift_name("next()")));
|
||||
|
||||
Vendored
+3
-2
@@ -1,3 +1,4 @@
|
||||
@class LongIterator, DoubleIterator, IntIterator;
|
||||
@class KotlinLongIterator, KotlinDoubleIterator, KotlinIntIterator;
|
||||
|
||||
@protocol KotlinIterator;
|
||||
|
||||
@protocol Iterator;
|
||||
|
||||
+5
-5
@@ -6,9 +6,9 @@
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
@class IntIterator;
|
||||
@class KotlinIntIterator;
|
||||
|
||||
@protocol Iterator;
|
||||
@protocol KotlinIterator;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
#pragma clang diagnostic push
|
||||
@@ -26,16 +26,16 @@ __attribute__((objc_subclassing_restricted))
|
||||
@interface Foo : Base
|
||||
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
|
||||
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
|
||||
- (IntIterator *)foo __attribute__((swift_name("foo()")));
|
||||
- (KotlinIntIterator *)foo __attribute__((swift_name("foo()")));
|
||||
@end
|
||||
|
||||
@protocol Iterator
|
||||
@protocol KotlinIterator
|
||||
@required
|
||||
- (BOOL)hasNext __attribute__((swift_name("hasNext()")));
|
||||
- (id _Nullable)next __attribute__((swift_name("next()")));
|
||||
@end
|
||||
|
||||
@interface IntIterator : Base <Iterator>
|
||||
@interface KotlinIntIterator : Base <KotlinIterator>
|
||||
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
|
||||
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
|
||||
- (Int *)next __attribute__((swift_name("next()")));
|
||||
|
||||
+1
-1
@@ -27,4 +27,4 @@ __attribute__((swift_name("FooInSwift")))
|
||||
|
||||
#pragma pop_macro("_Nullable_result")
|
||||
#pragma clang diagnostic pop
|
||||
NS_ASSUME_NONNULL_END
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
+35
-8
@@ -6,7 +6,9 @@
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
@class Throwable;
|
||||
@class KotlinThrowable, KotlinArray<T>;
|
||||
|
||||
@protocol KotlinIterator;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
#pragma clang diagnostic push
|
||||
@@ -20,24 +22,32 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
#define _Nullable_result _Nullable
|
||||
#endif
|
||||
|
||||
@interface Throwable : Base
|
||||
@interface KotlinThrowable : Base
|
||||
- (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));
|
||||
- (instancetype)initWithCause:(Throwable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer));
|
||||
- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(Throwable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer));
|
||||
@property (readonly) Throwable * _Nullable cause __attribute__((swift_name("cause")));
|
||||
- (instancetype)initWithCause:(KotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer));
|
||||
- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(KotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer));
|
||||
|
||||
/**
|
||||
* @note annotations
|
||||
* kotlin.experimental.ExperimentalNativeApi
|
||||
*/
|
||||
- (KotlinArray<NSString *> *)getStackTrace __attribute__((swift_name("getStackTrace()")));
|
||||
- (void)printStackTrace __attribute__((swift_name("printStackTrace()")));
|
||||
- (NSString *)description __attribute__((swift_name("description()")));
|
||||
@property (readonly) KotlinThrowable * _Nullable cause __attribute__((swift_name("cause")));
|
||||
@property (readonly) NSString * _Nullable message __attribute__((swift_name("message")));
|
||||
- (NSError *)asError __attribute__((swift_name("asError()")));
|
||||
@end
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface MyError : Throwable
|
||||
@interface MyError : KotlinThrowable
|
||||
- (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:(Throwable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable));
|
||||
- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(Throwable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable));
|
||||
- (instancetype)initWithCause:(KotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable));
|
||||
- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(KotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable));
|
||||
@end
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@@ -60,6 +70,23 @@ __attribute__((objc_subclassing_restricted))
|
||||
+ (NSString * _Nullable)someStringAndReturnError:(NSError * _Nullable * _Nullable)error __attribute__((swift_name("someString()")));
|
||||
@end
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface KotlinArray<T> : Base
|
||||
+ (instancetype)arrayWithSize:(int32_t)size init:(T _Nullable (^)(Int *))init __attribute__((swift_name("init(size:init:)")));
|
||||
+ (instancetype)alloc __attribute__((unavailable));
|
||||
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
|
||||
- (T _Nullable)getIndex:(int32_t)index __attribute__((swift_name("get(index:)")));
|
||||
- (id<KotlinIterator>)iterator __attribute__((swift_name("iterator()")));
|
||||
- (void)setIndex:(int32_t)index value:(T _Nullable)value __attribute__((swift_name("set(index:value:)")));
|
||||
@property (readonly) int32_t size __attribute__((swift_name("size")));
|
||||
@end
|
||||
|
||||
@protocol KotlinIterator
|
||||
@required
|
||||
- (BOOL)hasNext __attribute__((swift_name("hasNext()")));
|
||||
- (id _Nullable)next __attribute__((swift_name("next()")));
|
||||
@end
|
||||
|
||||
#pragma pop_macro("_Nullable_result")
|
||||
#pragma clang diagnostic pop
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
+1
-1
@@ -75,4 +75,4 @@ __attribute__((objc_subclassing_restricted))
|
||||
|
||||
#pragma pop_macro("_Nullable_result")
|
||||
#pragma clang diagnostic pop
|
||||
NS_ASSUME_NONNULL_END
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
+12
-17
@@ -6,9 +6,9 @@
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
@class EnumCompanion, Enum<E>, Foo, Array<T>;
|
||||
@class KotlinEnumCompanion, KotlinEnum<E>, Foo, KotlinArray<T>;
|
||||
|
||||
@protocol Comparable, Iterator;
|
||||
@protocol KotlinComparable, KotlinIterator;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
#pragma clang diagnostic push
|
||||
@@ -22,19 +22,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
#define _Nullable_result _Nullable
|
||||
#endif
|
||||
|
||||
@protocol Comparable
|
||||
@protocol KotlinComparable
|
||||
@required
|
||||
- (int32_t)compareToOther:(id _Nullable)other __attribute__((swift_name("compareTo(other:)")));
|
||||
@end
|
||||
|
||||
@interface Enum<E> : Base <Comparable>
|
||||
@interface KotlinEnum<E> : Base <KotlinComparable>
|
||||
- (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal __attribute__((swift_name("init(name:ordinal:)"))) __attribute__((objc_designated_initializer));
|
||||
@property (class, readonly, getter=companion) EnumCompanion *companion __attribute__((swift_name("companion")));
|
||||
|
||||
/**
|
||||
* @note This method has protected visibility in Kotlin source and is intended only for use by subclasses.
|
||||
*/
|
||||
- (id)clone __attribute__((swift_name("clone()")));
|
||||
@property (class, readonly, getter=companion) KotlinEnumCompanion *companion __attribute__((swift_name("companion")));
|
||||
- (int32_t)compareToOther:(E)other __attribute__((swift_name("compareTo(other:)")));
|
||||
- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)")));
|
||||
- (NSUInteger)hash __attribute__((swift_name("hash()")));
|
||||
@@ -44,37 +39,37 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@end
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface Foo : Enum<Foo *>
|
||||
@interface Foo : KotlinEnum<Foo *>
|
||||
+ (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) Foo *a __attribute__((swift_name("a")));
|
||||
@property (class, readonly) Foo *b __attribute__((swift_name("b")));
|
||||
@property (class, readonly) Foo *c __attribute__((swift_name("c")));
|
||||
+ (Array<Foo *> *)values __attribute__((swift_name("values()")));
|
||||
+ (KotlinArray<Foo *> *)values __attribute__((swift_name("values()")));
|
||||
@property (class, readonly) NSArray<Foo *> *entries __attribute__((swift_name("entries")));
|
||||
@end
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface EnumCompanion : Base
|
||||
@interface KotlinEnumCompanion : Base
|
||||
+ (instancetype)alloc __attribute__((unavailable));
|
||||
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
|
||||
+ (instancetype)companion __attribute__((swift_name("init()")));
|
||||
@property (class, readonly, getter=shared) EnumCompanion *shared __attribute__((swift_name("shared")));
|
||||
@property (class, readonly, getter=shared) KotlinEnumCompanion *shared __attribute__((swift_name("shared")));
|
||||
@end
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface Array<T> : Base
|
||||
@interface KotlinArray<T> : Base
|
||||
+ (instancetype)arrayWithSize:(int32_t)size init:(T _Nullable (^)(Int *))init __attribute__((swift_name("init(size:init:)")));
|
||||
+ (instancetype)alloc __attribute__((unavailable));
|
||||
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
|
||||
- (T _Nullable)getIndex:(int32_t)index __attribute__((swift_name("get(index:)")));
|
||||
- (id<Iterator>)iterator __attribute__((swift_name("iterator()")));
|
||||
- (id<KotlinIterator>)iterator __attribute__((swift_name("iterator()")));
|
||||
- (void)setIndex:(int32_t)index value:(T _Nullable)value __attribute__((swift_name("set(index:value:)")));
|
||||
@property (readonly) int32_t size __attribute__((swift_name("size")));
|
||||
@end
|
||||
|
||||
@protocol Iterator
|
||||
@protocol KotlinIterator
|
||||
@required
|
||||
- (BOOL)hasNext __attribute__((swift_name("hasNext()")));
|
||||
- (id _Nullable)next __attribute__((swift_name("next()")));
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
@class Array<T>;
|
||||
@class KotlinArray<T>;
|
||||
|
||||
@protocol Iterator;
|
||||
@protocol KotlinIterator;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
#pragma clang diagnostic push
|
||||
@@ -24,21 +24,21 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface FooKt : Base
|
||||
+ (void)fooArgs:(Array<NSString *> *)args __attribute__((swift_name("foo(args:)")));
|
||||
+ (void)fooArgs:(KotlinArray<NSString *> *)args __attribute__((swift_name("foo(args:)")));
|
||||
@end
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface Array<T> : Base
|
||||
@interface KotlinArray<T> : Base
|
||||
+ (instancetype)arrayWithSize:(int32_t)size init:(T _Nullable (^)(Int *))init __attribute__((swift_name("init(size:init:)")));
|
||||
+ (instancetype)alloc __attribute__((unavailable));
|
||||
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
|
||||
- (T _Nullable)getIndex:(int32_t)index __attribute__((swift_name("get(index:)")));
|
||||
- (id<Iterator>)iterator __attribute__((swift_name("iterator()")));
|
||||
- (id<KotlinIterator>)iterator __attribute__((swift_name("iterator()")));
|
||||
- (void)setIndex:(int32_t)index value:(T _Nullable)value __attribute__((swift_name("set(index:value:)")));
|
||||
@property (readonly) int32_t size __attribute__((swift_name("size")));
|
||||
@end
|
||||
|
||||
@protocol Iterator
|
||||
@protocol KotlinIterator
|
||||
@required
|
||||
- (BOOL)hasNext __attribute__((swift_name("hasNext()")));
|
||||
- (id _Nullable)next __attribute__((swift_name("next()")));
|
||||
|
||||
Reference in New Issue
Block a user