From 0a126a173e8683ac8b0c699e83730cf639fb762d Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Sat, 15 Apr 2023 19:05:52 +0200 Subject: [PATCH] K2: reproduce KT-58002 --- ...LightTreeBlackBoxCodegenTestGenerated.java | 6 +++++ .../FirPsiBlackBoxCodegenTestGenerated.java | 6 +++++ .../box/fir/enumEntryInTypeJavaAnnotation.kt | 27 +++++++++++++++++++ .../IrBlackBoxCodegenTestGenerated.java | 6 +++++ ...kBoxCodegenWithIrInlinerTestGenerated.java | 6 +++++ 5 files changed, 51 insertions(+) create mode 100644 compiler/testData/codegen/box/fir/enumEntryInTypeJavaAnnotation.kt diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java index 1abe25c80aa..3fdf5148a40 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java @@ -18379,6 +18379,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/fir/emptyIntersectionWarning.kt"); } + @Test + @TestMetadata("enumEntryInTypeJavaAnnotation.kt") + public void testEnumEntryInTypeJavaAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/fir/enumEntryInTypeJavaAnnotation.kt"); + } + @Test @TestMetadata("ExtensionAlias.kt") public void testExtensionAlias() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java index 2433363e74a..cb11a05d23e 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java @@ -18379,6 +18379,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/fir/emptyIntersectionWarning.kt"); } + @Test + @TestMetadata("enumEntryInTypeJavaAnnotation.kt") + public void testEnumEntryInTypeJavaAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/fir/enumEntryInTypeJavaAnnotation.kt"); + } + @Test @TestMetadata("ExtensionAlias.kt") public void testExtensionAlias() throws Exception { diff --git a/compiler/testData/codegen/box/fir/enumEntryInTypeJavaAnnotation.kt b/compiler/testData/codegen/box/fir/enumEntryInTypeJavaAnnotation.kt new file mode 100644 index 00000000000..f6d777f1ac4 --- /dev/null +++ b/compiler/testData/codegen/box/fir/enumEntryInTypeJavaAnnotation.kt @@ -0,0 +1,27 @@ +// ISSUE: KT-58002 + +// TARGET_BACKEND: JVM_IR +// IGNORE_BACKEND_K2: JVM_IR + +// FILE: NLS.java +import java.lang.annotation.*; + +@Target(ElementType.TYPE_USE) +public @interface NLS { + enum Capitalization { NotSpecified, Specified } + Capitalization capitalization() default Capitalization.NotSpecified; +} + +// FILE: BaseInspection.java + +public class BaseInspection { + @NLS(capitalization = NLS.Capitalization.Specified) + public static String fetchProbableBugs() { + return "OK"; + } +} + +// FILE: main.kt + +fun getGroupDisplayName() = BaseInspection.fetchProbableBugs() +fun box(): String = getGroupDisplayName() diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 1d2a12abe08..99fbd8b3daf 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -18379,6 +18379,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/fir/emptyIntersectionWarning.kt"); } + @Test + @TestMetadata("enumEntryInTypeJavaAnnotation.kt") + public void testEnumEntryInTypeJavaAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/fir/enumEntryInTypeJavaAnnotation.kt"); + } + @Test @TestMetadata("ExtensionAlias.kt") public void testExtensionAlias() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java index a96d2ac0338..718054c2281 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java @@ -18379,6 +18379,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/fir/emptyIntersectionWarning.kt"); } + @Test + @TestMetadata("enumEntryInTypeJavaAnnotation.kt") + public void testEnumEntryInTypeJavaAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/fir/enumEntryInTypeJavaAnnotation.kt"); + } + @Test @TestMetadata("ExtensionAlias.kt") public void testExtensionAlias() throws Exception {