From 91e4837c954eeeb2056993b0158ada1732d25c51 Mon Sep 17 00:00:00 2001 From: Kirill Rakhman Date: Fri, 9 Feb 2024 16:08:33 +0100 Subject: [PATCH] [Tests] Add test for #KT-65712 --- ...agnosticCompilerTestFE10TestdataTestGenerated.java | 6 ++++++ ...edDiagnosticCompilerFE10TestDataTestGenerated.java | 6 ++++++ ...rLightTreeOldFrontendDiagnosticsTestGenerated.java | 6 ++++++ .../FirPsiOldFrontendDiagnosticsTestGenerated.java | 6 ++++++ .../inference/capturedTypes/capturedUpperBound.fir.kt | 11 +++++++++++ .../inference/capturedTypes/capturedUpperBound.kt | 11 +++++++++++ .../kotlin/test/runners/DiagnosticTestGenerated.java | 6 ++++++ 7 files changed, 52 insertions(+) create mode 100644 compiler/testData/diagnostics/tests/inference/capturedTypes/capturedUpperBound.fir.kt create mode 100644 compiler/testData/diagnostics/tests/inference/capturedTypes/capturedUpperBound.kt diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java index a5899973393..03f898d6fcf 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java @@ -18047,6 +18047,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypesSubstitutionIntoAbbreviation.kt"); } + @Test + @TestMetadata("capturedUpperBound.kt") + public void testCapturedUpperBound() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/capturedTypes/capturedUpperBound.kt"); + } + @Test @TestMetadata("capturingFromArgumentOfFlexibleType.kt") public void testCapturingFromArgumentOfFlexibleType() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java index ec4b65a34e3..31c39c8b45c 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java @@ -18047,6 +18047,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypesSubstitutionIntoAbbreviation.kt"); } + @Test + @TestMetadata("capturedUpperBound.kt") + public void testCapturedUpperBound() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/capturedTypes/capturedUpperBound.kt"); + } + @Test @TestMetadata("capturingFromArgumentOfFlexibleType.kt") public void testCapturingFromArgumentOfFlexibleType() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java index 72b101b2fd6..0ce0247bb0d 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java @@ -18041,6 +18041,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypesSubstitutionIntoAbbreviation.kt"); } + @Test + @TestMetadata("capturedUpperBound.kt") + public void testCapturedUpperBound() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/capturedTypes/capturedUpperBound.kt"); + } + @Test @TestMetadata("capturingFromArgumentOfFlexibleType.kt") public void testCapturingFromArgumentOfFlexibleType() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java index 1b3ba192545..73114a7a106 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java @@ -18047,6 +18047,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypesSubstitutionIntoAbbreviation.kt"); } + @Test + @TestMetadata("capturedUpperBound.kt") + public void testCapturedUpperBound() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/capturedTypes/capturedUpperBound.kt"); + } + @Test @TestMetadata("capturingFromArgumentOfFlexibleType.kt") public void testCapturingFromArgumentOfFlexibleType() throws Exception { diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedUpperBound.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedUpperBound.fir.kt new file mode 100644 index 00000000000..dddb6e4c05a --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedUpperBound.fir.kt @@ -0,0 +1,11 @@ +// ISSUE: KT-65712 + +fun test(a: BodySpec, *>) { + a.value<BodySpec, *>>() + a.value<BodySpec<*, *>>() + a.value<BodySpec>() +} + +interface BodySpec> { + fun value(): T +} diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedUpperBound.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedUpperBound.kt new file mode 100644 index 00000000000..5af9a873ffc --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedUpperBound.kt @@ -0,0 +1,11 @@ +// ISSUE: KT-65712 + +fun test(a: BodySpec, *>) { + a.value, *>>() + a.value>() + a.value>() +} + +interface BodySpec> { + fun value(): T +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index 31f5573bbd4..6b6487d8e6e 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -18047,6 +18047,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypesSubstitutionIntoAbbreviation.kt"); } + @Test + @TestMetadata("capturedUpperBound.kt") + public void testCapturedUpperBound() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/capturedTypes/capturedUpperBound.kt"); + } + @Test @TestMetadata("capturingFromArgumentOfFlexibleType.kt") public void testCapturingFromArgumentOfFlexibleType() throws Exception {