From ae6aef3a638eccd1567834d3b2813f9734423f46 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 19 Jan 2024 09:28:04 +0100 Subject: [PATCH] K2: reproduce KT-65111 --- ...LFirBlackBoxCodegenBasedTestGenerated.java | 6 +++ ...rsedBlackBoxCodegenBasedTestGenerated.java | 6 +++ ...LightTreeBlackBoxCodegenTestGenerated.java | 6 +++ ...hIrFakeOverrideGeneratorTestGenerated.java | 6 +++ .../FirPsiBlackBoxCodegenTestGenerated.java | 6 +++ .../codegen/box/fir/kotlinJavaKotlin.kt | 39 +++++++++++++++++++ .../JvmAbiConsistencyTestBoxGenerated.java | 6 +++ .../IrBlackBoxCodegenTestGenerated.java | 6 +++ ...kBoxCodegenWithIrInlinerTestGenerated.java | 6 +++ .../LightAnalysisModeTestGenerated.java | 5 +++ 10 files changed, 92 insertions(+) create mode 100644 compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java index 6ef6953e290..cd83bfa6e9e 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java @@ -20078,6 +20078,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo runTest("compiler/testData/codegen/box/fir/KotlinDocumentationProvider.kt"); } + @Test + @TestMetadata("kotlinJavaKotlin.kt") + public void testKotlinJavaKotlin() throws Exception { + runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt"); + } + @Test @TestMetadata("kt61856.kt") public void testKt61856() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java index 3e80aad1d26..04dc3aaaaf3 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java @@ -20078,6 +20078,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi runTest("compiler/testData/codegen/box/fir/KotlinDocumentationProvider.kt"); } + @Test + @TestMetadata("kotlinJavaKotlin.kt") + public void testKotlinJavaKotlin() throws Exception { + runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt"); + } + @Test @TestMetadata("kt61856.kt") public void testKt61856() throws Exception { 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 75a95e3cfcd..6625edd159f 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 @@ -19787,6 +19787,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/fir/KotlinDocumentationProvider.kt"); } + @Test + @TestMetadata("kotlinJavaKotlin.kt") + public void testKotlinJavaKotlin() throws Exception { + runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt"); + } + @Test @TestMetadata("kt61856.kt") public void testKt61856() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java index d54fed451c4..550dc2fe38d 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java @@ -19787,6 +19787,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated runTest("compiler/testData/codegen/box/fir/KotlinDocumentationProvider.kt"); } + @Test + @TestMetadata("kotlinJavaKotlin.kt") + public void testKotlinJavaKotlin() throws Exception { + runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt"); + } + @Test @TestMetadata("kt61856.kt") public void testKt61856() 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 6945db63eec..a937b8f689f 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 @@ -19787,6 +19787,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/fir/KotlinDocumentationProvider.kt"); } + @Test + @TestMetadata("kotlinJavaKotlin.kt") + public void testKotlinJavaKotlin() throws Exception { + runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt"); + } + @Test @TestMetadata("kt61856.kt") public void testKt61856() throws Exception { diff --git a/compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt b/compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt new file mode 100644 index 00000000000..e97fe515cea --- /dev/null +++ b/compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt @@ -0,0 +1,39 @@ +// TARGET_BACKEND: JVM_IR +// IGNORE_BACKEND_K2: JVM_IR +// ISSUE: KT-65111 + +// FILE: plugin/Plugin.java + +package plugin; + +import entities.*; + +public class Plugin { + public CommonFields getCommonFields() { + return new CommonFields("OK"); + } +} + +// FILE: entities/CommonFields.kt + +package entities + +data class CommonFields(val screenShots: String) + +// FILE: test/foo.kt + +package test + +import plugin.Plugin + +fun foo(plugin: Plugin): String? { + return plugin.commonFields?.screenShots +} + +// FILE: example/test.kt + +import test.foo +import plugin.Plugin + +fun box(): String = + foo(Plugin())!! diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java index 05fd7585724..97a72dbf765 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java @@ -19787,6 +19787,12 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency runTest("compiler/testData/codegen/box/fir/KotlinDocumentationProvider.kt"); } + @Test + @TestMetadata("kotlinJavaKotlin.kt") + public void testKotlinJavaKotlin() throws Exception { + runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt"); + } + @Test @TestMetadata("kt61856.kt") public void testKt61856() throws Exception { 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 22c99b9f527..86662cbb7f2 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 @@ -19787,6 +19787,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/fir/KotlinDocumentationProvider.kt"); } + @Test + @TestMetadata("kotlinJavaKotlin.kt") + public void testKotlinJavaKotlin() throws Exception { + runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt"); + } + @Test @TestMetadata("kt61856.kt") public void testKt61856() 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 ab901c995e8..050fecae51f 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 @@ -19787,6 +19787,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/fir/KotlinDocumentationProvider.kt"); } + @Test + @TestMetadata("kotlinJavaKotlin.kt") + public void testKotlinJavaKotlin() throws Exception { + runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt"); + } + @Test @TestMetadata("kt61856.kt") public void testKt61856() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index d7ce6bad193..65e2169d744 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -16529,6 +16529,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/fir/KotlinDocumentationProvider.kt"); } + @TestMetadata("kotlinJavaKotlin.kt") + public void testKotlinJavaKotlin() throws Exception { + runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt"); + } + @TestMetadata("kt61856.kt") public void testKt61856() throws Exception { runTest("compiler/testData/codegen/box/fir/kt61856.kt");