[ObjCExport] Fix property setter
KT-64953: Required part for enum translation
This commit is contained in:
committed by
Space Team
parent
576851e514
commit
8f2fc3d1e2
+29
@@ -0,0 +1,29 @@
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSError.h>
|
||||
#import <Foundation/NSObject.h>
|
||||
#import <Foundation/NSSet.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunknown-warning-option"
|
||||
#pragma clang diagnostic ignored "-Wincompatible-property-type"
|
||||
#pragma clang diagnostic ignored "-Wnullability"
|
||||
|
||||
#pragma push_macro("_Nullable_result")
|
||||
#if !__has_feature(nullability_nullable_result)
|
||||
#undef _Nullable_result
|
||||
#define _Nullable_result _Nullable
|
||||
#endif
|
||||
|
||||
__attribute__((objc_subclassing_restricted))
|
||||
@interface FooKt : Base
|
||||
@property (class, readonly) int32_t objcValName __attribute__((swift_name("swiftValName")));
|
||||
@property (class) int32_t objcVaRName __attribute__((swift_name("swiftVaRName")));
|
||||
@end
|
||||
|
||||
#pragma pop_macro("_Nullable_result")
|
||||
#pragma clang diagnostic pop
|
||||
NS_ASSUME_NONNULL_END
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
@file:OptIn(ExperimentalObjCName::class)
|
||||
|
||||
import kotlin.experimental.ExperimentalObjCName
|
||||
|
||||
@kotlin.native.ObjCName("objcValName", "swiftValName")
|
||||
val valProperty = 42
|
||||
|
||||
@kotlin.native.ObjCName("objcVaRName", "swiftVaRName")
|
||||
var varProperty = 42
|
||||
Reference in New Issue
Block a user