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 f4e75acb19a..813aef48985 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 @@ -12,6 +12,7 @@ import org.jetbrains.kotlin.builtins.* import org.jetbrains.kotlin.builtins.KotlinBuiltIns.isAny import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.name.ClassId +import org.jetbrains.kotlin.resolve.DataClassResolver import org.jetbrains.kotlin.resolve.constants.ArrayValue import org.jetbrains.kotlin.resolve.constants.KClassValue import org.jetbrains.kotlin.resolve.deprecation.DeprecationInfo @@ -708,7 +709,7 @@ internal class ObjCExportTranslatorImpl( if (unavailable) { attributes += "unavailable" } else { - attributes.addIfNotNull(mapper.getDeprecation(method)?.toDeprecationAttribute()) + attributes.addIfNotNull(getDeprecationAttribute(method)) } val comment = buildComment(method, baseMethodBridge) @@ -716,6 +717,20 @@ internal class ObjCExportTranslatorImpl( return ObjCMethod(method, isInstanceMethod, returnType, selectorParts, parameters, attributes, comment) } + private fun getDeprecationAttribute(method: FunctionDescriptor): String? { + mapper.getDeprecation(method)?.toDeprecationAttribute()?.let { return it } + + if (method.kind == CallableMemberDescriptor.Kind.SYNTHESIZED) { + val parent = method.containingDeclaration + if (parent is ClassDescriptor && parent.isData && DataClassResolver.isComponentLike(method.name)) { + // componentN methods of data classes. + return renderDeprecationAttribute("deprecated", "use corresponding property instead") + } + } + + return null + } + private fun splitSelector(selector: String): List { return if (!selector.endsWith(":")) { listOf(selector) @@ -1353,9 +1368,11 @@ private fun DeprecationInfo.toDeprecationAttribute(): String { val message = this.message.orEmpty() - return "$attribute(${quoteAsCStringLiteral(message)})" + return renderDeprecationAttribute(attribute, message) } +private fun renderDeprecationAttribute(attribute: String, message: String) = "$attribute(${quoteAsCStringLiteral(message)})" + private fun quoteAsCStringLiteral(str: String): String = buildString { append('"') for (c in str) { diff --git a/kotlin-native/backend.native/tests/objcexport/dataClassComponentMethods.kt b/kotlin-native/backend.native/tests/objcexport/dataClassComponentMethods.kt new file mode 100644 index 00000000000..cfbca34da1e --- /dev/null +++ b/kotlin-native/backend.native/tests/objcexport/dataClassComponentMethods.kt @@ -0,0 +1,16 @@ +/* + * Copyright 2010-2022 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +package dataClassComponentMethods + +data class DataClassWithComponentMethods(val x: Int, val y: Int) + +class RegularClassWithComponentMethods { + fun component1() = 3 + fun component3() = 4 +} + +fun component1() = 5 +fun component4() = 6 diff --git a/kotlin-native/backend.native/tests/objcexport/dataClassComponentMethods.swift b/kotlin-native/backend.native/tests/objcexport/dataClassComponentMethods.swift new file mode 100644 index 00000000000..b510e3e526a --- /dev/null +++ b/kotlin-native/backend.native/tests/objcexport/dataClassComponentMethods.swift @@ -0,0 +1,34 @@ +/* + * Copyright 2010-2022 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +import Kt + +private func testComponentMethodsAreStillAccessible() throws { + let d = DataClassWithComponentMethods(x: 1, y: 2) + try assertEquals(actual: d.component1(), expected: 1) + try assertEquals(actual: d.component2(), expected: 2) +} + +// Absence of deprecation attributes is checked by comparing "lazy header". +private func testRegularComponentMethodsAreAccessible() throws { + let r = RegularClassWithComponentMethods() + try assertEquals(actual: r.component1(), expected: 3) + try assertEquals(actual: r.component3(), expected: 4) +} + +private func testTopLevelComponentMethodsAreAccessible() throws { + try assertEquals(actual: DataClassComponentMethodsKt.component1(), expected: 5) + try assertEquals(actual: DataClassComponentMethodsKt.component4(), expected: 6) +} + +class DataClassComponentMethodsTests : SimpleTestProvider { + override init() { + super.init() + + test("testComponentMethodsAreStillAccessible", testComponentMethodsAreStillAccessible) + test("testRegularComponentMethodsAreAccessible", testRegularComponentMethodsAreAccessible) + test("testTopLevelComponentMethodsAreAccessible", testTopLevelComponentMethodsAreAccessible) + } +} \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/objcexport/expectedLazy.h b/kotlin-native/backend.native/tests/objcexport/expectedLazy.h index e1e3f56bb68..7114b0e0212 100644 --- a/kotlin-native/backend.native/tests/objcexport/expectedLazy.h +++ b/kotlin-native/backend.native/tests/objcexport/expectedLazy.h @@ -385,6 +385,36 @@ __attribute__((swift_name("CoroutinesKt"))) + (void)gc __attribute__((swift_name("gc()"))); @end; +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("DataClassWithComponentMethods"))) +@interface KtDataClassWithComponentMethods : KtBase +- (instancetype)initWithX:(int32_t)x y:(int32_t)y __attribute__((swift_name("init(x:y:)"))) __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()"))) __attribute__((deprecated("use corresponding property instead"))); +- (int32_t)component2 __attribute__((swift_name("component2()"))) __attribute__((deprecated("use corresponding property instead"))); +- (KtDataClassWithComponentMethods *)doCopyX:(int32_t)x y:(int32_t)y __attribute__((swift_name("doCopy(x:y:)"))); +@property (readonly) int32_t x __attribute__((swift_name("x"))); +@property (readonly) int32_t y __attribute__((swift_name("y"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("RegularClassWithComponentMethods"))) +@interface KtRegularClassWithComponentMethods : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (int32_t)component1 __attribute__((swift_name("component1()"))); +- (int32_t)component3 __attribute__((swift_name("component3()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("DataClassComponentMethodsKt"))) +@interface KtDataClassComponentMethodsKt : KtBase ++ (int32_t)component1 __attribute__((swift_name("component1()"))); ++ (int32_t)component4 __attribute__((swift_name("component4()"))); +@end; + __attribute__((swift_name("DeallocRetainBase"))) @interface KtDeallocRetainBase : KtBase - (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); @@ -1215,7 +1245,7 @@ __attribute__((swift_name("Person.User"))) - (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()"))); +- (int32_t)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); - (KtPersonUser *)doCopyId:(int32_t)id __attribute__((swift_name("doCopy(id:)"))); @property (readonly) int32_t id __attribute__((swift_name("id"))); @end; @@ -1235,7 +1265,7 @@ __attribute__((swift_name("Person.WorkerEmployee"))) - (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()"))); +- (int32_t)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); - (KtPersonWorkerEmployee *)doCopyId:(int32_t)id __attribute__((swift_name("doCopy(id:)"))); @property (readonly) int32_t id __attribute__((swift_name("id"))); @end; @@ -1249,7 +1279,7 @@ __attribute__((swift_name("Person.WorkerContractor"))) - (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()"))); +- (int32_t)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); - (KtPersonWorkerContractor *)doCopyId:(int32_t)id __attribute__((swift_name("doCopy(id:)"))); @property (readonly) int32_t id __attribute__((swift_name("id"))); @end; @@ -1402,9 +1432,9 @@ __attribute__((swift_name("TripleVals"))) - (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()"))); +- (T _Nullable)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); +- (T _Nullable)component2 __attribute__((swift_name("component2()"))) __attribute__((deprecated("use corresponding property instead"))); +- (T _Nullable)component3 __attribute__((swift_name("component3()"))) __attribute__((deprecated("use corresponding property instead"))); - (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"))); @@ -1418,9 +1448,9 @@ __attribute__((swift_name("TripleVars"))) - (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()"))); +- (T _Nullable)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); +- (T _Nullable)component2 __attribute__((swift_name("component2()"))) __attribute__((deprecated("use corresponding property instead"))); +- (T _Nullable)component3 __attribute__((swift_name("component3()"))) __attribute__((deprecated("use corresponding property instead"))); - (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"))); @@ -1829,9 +1859,9 @@ __attribute__((swift_name("CKeywords"))) - (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()"))); +- (float)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); +- (int32_t)component2 __attribute__((swift_name("component2()"))) __attribute__((deprecated("use corresponding property instead"))); +- (BOOL)component3 __attribute__((swift_name("component3()"))) __attribute__((deprecated("use corresponding property instead"))); - (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_"))); diff --git a/kotlin-native/backend.native/tests/objcexport/expectedLazyLegacySuspendUnit.h b/kotlin-native/backend.native/tests/objcexport/expectedLazyLegacySuspendUnit.h index 90a99a286e4..8aa6658cbaa 100644 --- a/kotlin-native/backend.native/tests/objcexport/expectedLazyLegacySuspendUnit.h +++ b/kotlin-native/backend.native/tests/objcexport/expectedLazyLegacySuspendUnit.h @@ -385,6 +385,36 @@ __attribute__((swift_name("CoroutinesKt"))) + (void)gc __attribute__((swift_name("gc()"))); @end; +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("DataClassWithComponentMethods"))) +@interface KtDataClassWithComponentMethods : KtBase +- (instancetype)initWithX:(int32_t)x y:(int32_t)y __attribute__((swift_name("init(x:y:)"))) __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()"))) __attribute__((deprecated("use corresponding property instead"))); +- (int32_t)component2 __attribute__((swift_name("component2()"))) __attribute__((deprecated("use corresponding property instead"))); +- (KtDataClassWithComponentMethods *)doCopyX:(int32_t)x y:(int32_t)y __attribute__((swift_name("doCopy(x:y:)"))); +@property (readonly) int32_t x __attribute__((swift_name("x"))); +@property (readonly) int32_t y __attribute__((swift_name("y"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("RegularClassWithComponentMethods"))) +@interface KtRegularClassWithComponentMethods : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (int32_t)component1 __attribute__((swift_name("component1()"))); +- (int32_t)component3 __attribute__((swift_name("component3()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("DataClassComponentMethodsKt"))) +@interface KtDataClassComponentMethodsKt : KtBase ++ (int32_t)component1 __attribute__((swift_name("component1()"))); ++ (int32_t)component4 __attribute__((swift_name("component4()"))); +@end; + __attribute__((swift_name("DeallocRetainBase"))) @interface KtDeallocRetainBase : KtBase - (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); @@ -1157,7 +1187,7 @@ __attribute__((swift_name("Person.User"))) - (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()"))); +- (int32_t)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); - (KtPersonUser *)doCopyId:(int32_t)id __attribute__((swift_name("doCopy(id:)"))); @property (readonly) int32_t id __attribute__((swift_name("id"))); @end; @@ -1177,7 +1207,7 @@ __attribute__((swift_name("Person.WorkerEmployee"))) - (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()"))); +- (int32_t)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); - (KtPersonWorkerEmployee *)doCopyId:(int32_t)id __attribute__((swift_name("doCopy(id:)"))); @property (readonly) int32_t id __attribute__((swift_name("id"))); @end; @@ -1191,7 +1221,7 @@ __attribute__((swift_name("Person.WorkerContractor"))) - (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()"))); +- (int32_t)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); - (KtPersonWorkerContractor *)doCopyId:(int32_t)id __attribute__((swift_name("doCopy(id:)"))); @property (readonly) int32_t id __attribute__((swift_name("id"))); @end; @@ -1344,9 +1374,9 @@ __attribute__((swift_name("TripleVals"))) - (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()"))); +- (T _Nullable)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); +- (T _Nullable)component2 __attribute__((swift_name("component2()"))) __attribute__((deprecated("use corresponding property instead"))); +- (T _Nullable)component3 __attribute__((swift_name("component3()"))) __attribute__((deprecated("use corresponding property instead"))); - (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"))); @@ -1360,9 +1390,9 @@ __attribute__((swift_name("TripleVars"))) - (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()"))); +- (T _Nullable)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); +- (T _Nullable)component2 __attribute__((swift_name("component2()"))) __attribute__((deprecated("use corresponding property instead"))); +- (T _Nullable)component3 __attribute__((swift_name("component3()"))) __attribute__((deprecated("use corresponding property instead"))); - (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"))); @@ -1771,9 +1801,9 @@ __attribute__((swift_name("CKeywords"))) - (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()"))); +- (float)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); +- (int32_t)component2 __attribute__((swift_name("component2()"))) __attribute__((deprecated("use corresponding property instead"))); +- (BOOL)component3 __attribute__((swift_name("component3()"))) __attribute__((deprecated("use corresponding property instead"))); - (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_"))); diff --git a/kotlin-native/backend.native/tests/objcexport/expectedLazyNoGenerics.h b/kotlin-native/backend.native/tests/objcexport/expectedLazyNoGenerics.h index 90d2f89c7e1..fe88b5eb339 100644 --- a/kotlin-native/backend.native/tests/objcexport/expectedLazyNoGenerics.h +++ b/kotlin-native/backend.native/tests/objcexport/expectedLazyNoGenerics.h @@ -385,6 +385,36 @@ __attribute__((swift_name("CoroutinesKt"))) + (void)gc __attribute__((swift_name("gc()"))); @end; +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("DataClassWithComponentMethods"))) +@interface KtDataClassWithComponentMethods : KtBase +- (instancetype)initWithX:(int32_t)x y:(int32_t)y __attribute__((swift_name("init(x:y:)"))) __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()"))) __attribute__((deprecated("use corresponding property instead"))); +- (int32_t)component2 __attribute__((swift_name("component2()"))) __attribute__((deprecated("use corresponding property instead"))); +- (KtDataClassWithComponentMethods *)doCopyX:(int32_t)x y:(int32_t)y __attribute__((swift_name("doCopy(x:y:)"))); +@property (readonly) int32_t x __attribute__((swift_name("x"))); +@property (readonly) int32_t y __attribute__((swift_name("y"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("RegularClassWithComponentMethods"))) +@interface KtRegularClassWithComponentMethods : KtBase +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (int32_t)component1 __attribute__((swift_name("component1()"))); +- (int32_t)component3 __attribute__((swift_name("component3()"))); +@end; + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("DataClassComponentMethodsKt"))) +@interface KtDataClassComponentMethodsKt : KtBase ++ (int32_t)component1 __attribute__((swift_name("component1()"))); ++ (int32_t)component4 __attribute__((swift_name("component4()"))); +@end; + __attribute__((swift_name("DeallocRetainBase"))) @interface KtDeallocRetainBase : KtBase - (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); @@ -1157,7 +1187,7 @@ __attribute__((swift_name("Person.User"))) - (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()"))); +- (int32_t)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); - (KtPersonUser *)doCopyId:(int32_t)id __attribute__((swift_name("doCopy(id:)"))); @property (readonly) int32_t id __attribute__((swift_name("id"))); @end; @@ -1177,7 +1207,7 @@ __attribute__((swift_name("Person.WorkerEmployee"))) - (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()"))); +- (int32_t)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); - (KtPersonWorkerEmployee *)doCopyId:(int32_t)id __attribute__((swift_name("doCopy(id:)"))); @property (readonly) int32_t id __attribute__((swift_name("id"))); @end; @@ -1191,7 +1221,7 @@ __attribute__((swift_name("Person.WorkerContractor"))) - (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()"))); +- (int32_t)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); - (KtPersonWorkerContractor *)doCopyId:(int32_t)id __attribute__((swift_name("doCopy(id:)"))); @property (readonly) int32_t id __attribute__((swift_name("id"))); @end; @@ -1344,9 +1374,9 @@ __attribute__((swift_name("TripleVals"))) - (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)"))); - (NSUInteger)hash __attribute__((swift_name("hash()"))); - (NSString *)description __attribute__((swift_name("description()"))); -- (id _Nullable)component1 __attribute__((swift_name("component1()"))); -- (id _Nullable)component2 __attribute__((swift_name("component2()"))); -- (id _Nullable)component3 __attribute__((swift_name("component3()"))); +- (id _Nullable)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); +- (id _Nullable)component2 __attribute__((swift_name("component2()"))) __attribute__((deprecated("use corresponding property instead"))); +- (id _Nullable)component3 __attribute__((swift_name("component3()"))) __attribute__((deprecated("use corresponding property instead"))); - (KtTripleVals *)doCopyFirst:(id _Nullable)first second:(id _Nullable)second third:(id _Nullable)third __attribute__((swift_name("doCopy(first:second:third:)"))); @property (readonly) id _Nullable first __attribute__((swift_name("first"))); @property (readonly) id _Nullable second __attribute__((swift_name("second"))); @@ -1360,9 +1390,9 @@ __attribute__((swift_name("TripleVars"))) - (NSString *)description __attribute__((swift_name("description()"))); - (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)"))); - (NSUInteger)hash __attribute__((swift_name("hash()"))); -- (id _Nullable)component1 __attribute__((swift_name("component1()"))); -- (id _Nullable)component2 __attribute__((swift_name("component2()"))); -- (id _Nullable)component3 __attribute__((swift_name("component3()"))); +- (id _Nullable)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); +- (id _Nullable)component2 __attribute__((swift_name("component2()"))) __attribute__((deprecated("use corresponding property instead"))); +- (id _Nullable)component3 __attribute__((swift_name("component3()"))) __attribute__((deprecated("use corresponding property instead"))); - (KtTripleVars *)doCopyFirst:(id _Nullable)first second:(id _Nullable)second third:(id _Nullable)third __attribute__((swift_name("doCopy(first:second:third:)"))); @property id _Nullable first __attribute__((swift_name("first"))); @property id _Nullable second __attribute__((swift_name("second"))); @@ -1771,9 +1801,9 @@ __attribute__((swift_name("CKeywords"))) - (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()"))); +- (float)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); +- (int32_t)component2 __attribute__((swift_name("component2()"))) __attribute__((deprecated("use corresponding property instead"))); +- (BOOL)component3 __attribute__((swift_name("component3()"))) __attribute__((deprecated("use corresponding property instead"))); - (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_")));