diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/when/MappingClassesForWhenByEnumCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/when/MappingClassesForWhenByEnumCodegen.java index f2296af82be..a18f0cf957a 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/when/MappingClassesForWhenByEnumCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/when/MappingClassesForWhenByEnumCodegen.java @@ -47,7 +47,7 @@ public class MappingClassesForWhenByEnumCodegen { cb.defineClass( srcFile, V1_6, - ACC_FINAL | ACC_SYNTHETIC, + ACC_FINAL | ACC_SYNTHETIC | ACC_PUBLIC, mappingsClass.getInternalName(), null, OBJECT_TYPE.getInternalName(), diff --git a/compiler/testData/codegen/boxInline/anonymousObject/kt6552.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/kt6552.1.kt new file mode 100644 index 00000000000..458af7c5039 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/kt6552.1.kt @@ -0,0 +1,5 @@ +import test.* + +fun box(): String { + return switch(X.A) + switch(X.B) +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/kt6552.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/kt6552.2.kt new file mode 100644 index 00000000000..c52dbf817a1 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/kt6552.2.kt @@ -0,0 +1,8 @@ +package test + +public enum class X { A, B } + +public inline fun switch(x: X): String = when (x) { + X.A -> "O" + X.B -> "K" +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java index 305c4799b70..4e4114dd683 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java @@ -115,6 +115,12 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo doTestMultiFileWithInlineCheck(fileName); } + @TestMetadata("kt6552.1.kt") + public void testKt6552() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/kt6552.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + @TestMetadata("kt8133.1.kt") public void testKt8133() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/kt8133.1.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java index 51e0c71557b..a949205b8a0 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -115,6 +115,12 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi doBoxTestWithInlineCheck(fileName); } + @TestMetadata("kt6552.1.kt") + public void testKt6552() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/kt6552.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + @TestMetadata("kt8133.1.kt") public void testKt8133() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/kt8133.1.kt");