[K/N] Fix KT-58839
Do not export extensions of classes that are hidden from the generated Objective-C API. Merge-request: KT-MR-10330 Merged-by: Sergey Bogolepov <sergey.bogolepov@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
c0ce37a271
commit
89be94f123
@@ -756,6 +756,7 @@ __attribute__((swift_name("WrapperOverUnavailable")))
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
__attribute__((swift_name("HiddenfromobjcKt")))
|
||||
@interface KtHiddenfromobjcKt : KtBase
|
||||
+ (id)doSomethingMeaningless:(NSString *)receiver another:(id)another __attribute__((swift_name("doSomethingMeaningless(_:another:)")));
|
||||
+ (id)useOfUnavailableClassParam:(id)param __attribute__((swift_name("useOfUnavailableClass(param:)")));
|
||||
+ (id _Nullable)useOfNullableUnavailableClassParam:(id _Nullable)param __attribute__((swift_name("useOfNullableUnavailableClass(param:)")));
|
||||
+ (id)produceUnavailable __attribute__((swift_name("produceUnavailable()")));
|
||||
|
||||
@@ -756,6 +756,7 @@ __attribute__((swift_name("WrapperOverUnavailable")))
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
__attribute__((swift_name("HiddenfromobjcKt")))
|
||||
@interface KtHiddenfromobjcKt : KtBase
|
||||
+ (id)doSomethingMeaningless:(NSString *)receiver another:(id)another __attribute__((swift_name("doSomethingMeaningless(_:another:)")));
|
||||
+ (id)useOfUnavailableClassParam:(id)param __attribute__((swift_name("useOfUnavailableClass(param:)")));
|
||||
+ (id _Nullable)useOfNullableUnavailableClassParam:(id _Nullable)param __attribute__((swift_name("useOfNullableUnavailableClass(param:)")));
|
||||
+ (id)produceUnavailable __attribute__((swift_name("produceUnavailable()")));
|
||||
|
||||
@@ -756,6 +756,7 @@ __attribute__((swift_name("WrapperOverUnavailable")))
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
__attribute__((swift_name("HiddenfromobjcKt")))
|
||||
@interface KtHiddenfromobjcKt : KtBase
|
||||
+ (id)doSomethingMeaningless:(NSString *)receiver another:(id)another __attribute__((swift_name("doSomethingMeaningless(_:another:)")));
|
||||
+ (id)useOfUnavailableClassParam:(id)param __attribute__((swift_name("useOfUnavailableClass(param:)")));
|
||||
+ (id _Nullable)useOfNullableUnavailableClassParam:(id _Nullable)param __attribute__((swift_name("useOfNullableUnavailableClass(param:)")));
|
||||
+ (id)produceUnavailable __attribute__((swift_name("produceUnavailable()")));
|
||||
|
||||
@@ -11,6 +11,15 @@ import kotlin.experimental.ExperimentalObjCRefinement
|
||||
@HiddenFromObjC
|
||||
data class ClassNotAvailableInSwift(val param: String)
|
||||
|
||||
// KT-58839
|
||||
fun ClassNotAvailableInSwift.doSomethingMeaningless(another: ClassNotAvailableInSwift): ClassNotAvailableInSwift {
|
||||
return ClassNotAvailableInSwift(this.param + another.param)
|
||||
}
|
||||
|
||||
fun String.doSomethingMeaningless(another: ClassNotAvailableInSwift): ClassNotAvailableInSwift {
|
||||
return ClassNotAvailableInSwift(this + another.param)
|
||||
}
|
||||
|
||||
// Check that inner and nested classes are hidden if enclosing class is hidden
|
||||
@OptIn(ExperimentalObjCRefinement::class)
|
||||
@HiddenFromObjC
|
||||
|
||||
Reference in New Issue
Block a user