ObjCExport: deprecate exporting data class componentN methods to Obj-C
The Objective-C methods for Kotlin data class componentN methods shouldn't have been generated in the first place -- the corresponding Kotlin methods are required to make the destructuring work in Kotlin, and don't help in Objective-C or Swift. Calling them manually from Objective-C or Swift doesn't make much sense. So now we deprecate this, in order to remove these methods from Objective-C header completely later. ^KT-42641 ^KT-49516 Fixed
This commit is contained in:
committed by
Space
parent
4636f71076
commit
ad72545647
+19
-2
@@ -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<String> {
|
||||
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) {
|
||||
|
||||
@@ -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
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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<T> *)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<T> *)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_")));
|
||||
|
||||
@@ -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<T> *)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<T> *)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_")));
|
||||
|
||||
@@ -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_")));
|
||||
|
||||
Reference in New Issue
Block a user