Skip to content

Commit 9cf092c

Browse files
Add literals with objcname annotations to the NSEnum test and disable the test for aa temporarily
1 parent 5c581f0 commit 9cf092c

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

native/objcexport-header-generator/test/org/jetbrains/kotlin/backend/konan/tests/ObjCExportHeaderGeneratorTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class ObjCExportHeaderGeneratorTest(private val generator: HeaderGenerator) {
5454
}
5555

5656
@Test
57+
@TodoAnalysisApi
5758
fun `test - enumClassWithObjCEnum`() {
5859
doTest(headersTestDataDir.resolve("enumClassWithObjCEnum"))
5960
}

native/objcexport-header-generator/testData/headers/enumClassWithObjCEnum/!enumClassWithObjCEnum.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ NS_ASSUME_NONNULL_BEGIN
3939
@end
4040

4141
typedef NS_ENUM(int32_t, FooNSEnum) {
42-
FooNSEnumAlpha NS_SWIFT_NAME(alpha) = 0,
43-
FooNSEnumTheCopy NS_SWIFT_NAME(theCopy) = 1,
44-
FooNSEnumBarFoo NS_SWIFT_NAME(barFoo) = 2,
42+
FooNSEnumAlphaBeta NS_SWIFT_NAME(alphaBeta) = 0,
43+
FooNSEnumAlpha NS_SWIFT_NAME(alpha) = 1,
44+
FooNSEnumTheCopy NS_SWIFT_NAME(theCopy) = 2,
45+
FooNSEnumFooBarObjC NS_SWIFT_NAME(fooBarObjC) = 3,
46+
FooNSEnumBarFooObjC NS_SWIFT_NAME(barFooSwift) = 4,
4547
} NS_SWIFT_NAME(FooNSEnum);
4648

4749

@@ -51,9 +53,11 @@ __attribute__((objc_subclassing_restricted))
5153
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
5254
- (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal __attribute__((swift_name("init(name:ordinal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable));
5355
@property (readonly) FooNSEnum nsEnum;
56+
@property (class, readonly) Foo *alphaBeta __attribute__((swift_name("alphaBeta")));
5457
@property (class, readonly) Foo *alpha __attribute__((swift_name("alpha")));
5558
@property (class, readonly) Foo *theCopy __attribute__((swift_name("theCopy")));
56-
@property (class, readonly) Foo *barFoo __attribute__((swift_name("barFoo")));
59+
@property (class, readonly) Foo *fooBarObjC __attribute__((swift_name("fooBarObjC")));
60+
@property (class, readonly) Foo *barFooObjC __attribute__((swift_name("barFooSwift")));
5761
+ (KotlinArray<Foo *> *)values __attribute__((swift_name("values()")));
5862
@property (class, readonly) NSArray<Foo *> *entries __attribute__((swift_name("entries")));
5963
@end

native/objcexport-header-generator/testData/headers/enumClassWithObjCEnum/Foo.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@ import kotlin.experimental.ExperimentalObjCName
77

88
@ObjCEnum
99
enum class Foo {
10-
ALPHA, COPY, BAR_FOO
10+
ALPHA_BETA,
11+
ALPHA,
12+
COPY,
13+
@ObjCName("fooBarObjC") BAR_FOO,
14+
@ObjCName(name = "barFooObjC", swiftName = "barFooSwift") BAR_FOO,
1115
}

0 commit comments

Comments
 (0)