From dd1d229297425a819d4b7870ab5410e10fb46804 Mon Sep 17 00:00:00 2001 From: SvyatoslavScherbina Date: Mon, 29 Apr 2019 16:55:34 +0300 Subject: [PATCH] Fix #2926 (#2927) --- .../kotlin/backend/konan/objcexport/ObjCExportCodeSpec.kt | 2 +- backend.native/tests/framework/values/values.swift | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportCodeSpec.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportCodeSpec.kt index 18c5d957fcf..376bc9e7c3e 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportCodeSpec.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportCodeSpec.kt @@ -63,7 +63,7 @@ internal fun ObjCExportedInterface.createCodeSpec(symbolTable: SymbolTable): Obj } } - if (descriptor.kind == ClassKind.ENUM_ENTRY) { + if (descriptor.kind == ClassKind.ENUM_CLASS) { descriptor.enumEntries.mapTo(methods) { ObjCGetterForKotlinEnumEntry(symbolTable.referenceEnumEntry(it)) } diff --git a/backend.native/tests/framework/values/values.swift b/backend.native/tests/framework/values/values.swift index 2086a41a57f..8d158b35c92 100644 --- a/backend.native/tests/framework/values/values.swift +++ b/backend.native/tests/framework/values/values.swift @@ -381,6 +381,7 @@ func testClassInstances() throws { } func testEnum() throws { + try assertEquals(actual: ValuesKt.passEnum(), expected: Enumeration.answer) try assertEquals(actual: ValuesKt.passEnum().enumValue, expected: 42) try assertEquals(actual: ValuesKt.passEnum().name, expected: "ANSWER") ValuesKt.receiveEnum(e: 1)