Fix missing forward declarations in framework (#3088)
This commit is contained in:
committed by
GitHub
parent
838b4455d9
commit
1c3afb4a54
+2
-2
@@ -1096,11 +1096,11 @@ abstract class ObjCExportHeaderGenerator internal constructor(
|
||||
}
|
||||
|
||||
internal fun referenceClass(objCName: String, descriptor: ClassDescriptor? = null) {
|
||||
if (objcGenerics || descriptor !in generatedClasses) classForwardDeclarations += objCName
|
||||
classForwardDeclarations += objCName
|
||||
}
|
||||
|
||||
internal fun referenceProtocol(objCName: String, descriptor: ClassDescriptor? = null) {
|
||||
if (descriptor !in generatedClasses) protocolForwardDeclarations += objCName
|
||||
protocolForwardDeclarations += objCName
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -542,6 +542,30 @@ __attribute__((swift_name("TestKClassI")))
|
||||
@required
|
||||
@end;
|
||||
|
||||
__attribute__((swift_name("ForwardI2")))
|
||||
@protocol ValuesForwardI2 <ValuesForwardI1>
|
||||
@required
|
||||
@end;
|
||||
|
||||
__attribute__((swift_name("ForwardI1")))
|
||||
@protocol ValuesForwardI1
|
||||
@required
|
||||
- (id<ValuesForwardI2>)getForwardI2 __attribute__((swift_name("getForwardI2()")));
|
||||
@end;
|
||||
|
||||
__attribute__((swift_name("ForwardC2")))
|
||||
@interface ValuesForwardC2 : ValuesForwardC1
|
||||
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
|
||||
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
|
||||
@end;
|
||||
|
||||
__attribute__((swift_name("ForwardC1")))
|
||||
@interface ValuesForwardC1 : KotlinBase
|
||||
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
|
||||
+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
|
||||
- (ValuesForwardC2 *)getForwardC2 __attribute__((swift_name("getForwardC2()")));
|
||||
@end;
|
||||
|
||||
@interface ValuesEnumeration (ValuesKt)
|
||||
- (ValuesEnumeration *)getAnswer __attribute__((swift_name("getAnswer()")));
|
||||
@end;
|
||||
|
||||
@@ -438,3 +438,14 @@ class TestKClass {
|
||||
|
||||
interface I
|
||||
}
|
||||
|
||||
// https://kotlinlang.slack.com/archives/C3SGXARS6/p1560954372179300
|
||||
interface ForwardI2 : ForwardI1
|
||||
interface ForwardI1 {
|
||||
fun getForwardI2(): ForwardI2
|
||||
}
|
||||
|
||||
abstract class ForwardC2 : ForwardC1()
|
||||
abstract class ForwardC1 {
|
||||
abstract fun getForwardC2(): ForwardC2
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user