From 776c4ba6ca7f3db383c176f72bc996265dd10893 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 25 Dec 2020 10:04:21 +0300 Subject: [PATCH] Add test for KT-25489 (to reproduce, turn UL classes OFF) --- .../ir/FirBlackBoxCodegenTestGenerated.java | 5 +++ .../codegen/box/annotations/kt25489.kt | 36 +++++++++++++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 5 +++ .../LightAnalysisModeTestGenerated.java | 5 +++ .../ir/IrBlackBoxCodegenTestGenerated.java | 5 +++ 5 files changed, 56 insertions(+) create mode 100644 compiler/testData/codegen/box/annotations/kt25489.kt diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java index 138f7b8f9c3..9a6d7da568f 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java @@ -147,6 +147,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/annotations/kt10136.kt"); } + @TestMetadata("kt25489.kt") + public void testKt25489() throws Exception { + runTest("compiler/testData/codegen/box/annotations/kt25489.kt"); + } + @TestMetadata("mustBeDocumented.kt") public void testMustBeDocumented() throws Exception { runTest("compiler/testData/codegen/box/annotations/mustBeDocumented.kt"); diff --git a/compiler/testData/codegen/box/annotations/kt25489.kt b/compiler/testData/codegen/box/annotations/kt25489.kt new file mode 100644 index 00000000000..179ea9ab0c2 --- /dev/null +++ b/compiler/testData/codegen/box/annotations/kt25489.kt @@ -0,0 +1,36 @@ +// FILE: JavaImpl.java + +public class JavaImpl implements KotlinInterface { + private final String id; + + JavaImpl(String id) { + this.id = id; + } + + @Override + public String id() { + return id; + } +} + +// FILE: JavaAnnotation.java + +public @interface JavaAnnotation { + public Class as() default Void.class; +} + +// FILE: kt25489.kt +// TARGET_BACKEND: JVM +// Note: if you wish to reproduce KT-25489, turn UL classes OFF + +@JavaAnnotation(`as` = JavaImpl::class) +interface KotlinInterface : Identity + +interface Identity { + fun id(): String +} + +fun box(): String { + val impl = JavaImpl("OK") + return impl.id() +} \ No newline at end of file diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index a68669bd890..8fc5bc4412c 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -147,6 +147,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/annotations/kt10136.kt"); } + @TestMetadata("kt25489.kt") + public void testKt25489() throws Exception { + runTest("compiler/testData/codegen/box/annotations/kt25489.kt"); + } + @TestMetadata("mustBeDocumented.kt") public void testMustBeDocumented() throws Exception { runTest("compiler/testData/codegen/box/annotations/mustBeDocumented.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index cbf4b3e73cd..5d60c37dcac 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -147,6 +147,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/annotations/kt10136.kt"); } + @TestMetadata("kt25489.kt") + public void testKt25489() throws Exception { + runTest("compiler/testData/codegen/box/annotations/kt25489.kt"); + } + @TestMetadata("mustBeDocumented.kt") public void testMustBeDocumented() throws Exception { runTest("compiler/testData/codegen/box/annotations/mustBeDocumented.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index d0e04e385ac..ff9198733fd 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -147,6 +147,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/annotations/kt10136.kt"); } + @TestMetadata("kt25489.kt") + public void testKt25489() throws Exception { + runTest("compiler/testData/codegen/box/annotations/kt25489.kt"); + } + @TestMetadata("mustBeDocumented.kt") public void testMustBeDocumented() throws Exception { runTest("compiler/testData/codegen/box/annotations/mustBeDocumented.kt");