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 9403a5fcd47..8d24d2b06d8 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 @@ -13750,6 +13750,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/generics/anonymousObjectSupertypeWithTypeParameterFromFunction.kt"); } + @Test + @TestMetadata("approximationOfBoundedProjection.kt") + public void testApproximationOfBoundedProjection() throws Exception { + runTest("compiler/testData/diagnostics/tests/generics/approximationOfBoundedProjection.kt"); + } + @Test @TestMetadata("approximationOfInProjection.kt") public void testApproximationOfInProjection() 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 6e136cdc595..fb17d5e3708 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 @@ -13750,6 +13750,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/generics/anonymousObjectSupertypeWithTypeParameterFromFunction.kt"); } + @Test + @TestMetadata("approximationOfBoundedProjection.kt") + public void testApproximationOfBoundedProjection() throws Exception { + runTest("compiler/testData/diagnostics/tests/generics/approximationOfBoundedProjection.kt"); + } + @Test @TestMetadata("approximationOfInProjection.kt") public void testApproximationOfInProjection() 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 318d2292de9..72f0c5ff1da 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 @@ -13744,6 +13744,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/generics/anonymousObjectSupertypeWithTypeParameterFromFunction.kt"); } + @Test + @TestMetadata("approximationOfBoundedProjection.kt") + public void testApproximationOfBoundedProjection() throws Exception { + runTest("compiler/testData/diagnostics/tests/generics/approximationOfBoundedProjection.kt"); + } + @Test @TestMetadata("approximationOfInProjection.kt") public void testApproximationOfInProjection() 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 28307ecbfa2..ffb173cca57 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 @@ -13750,6 +13750,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/generics/anonymousObjectSupertypeWithTypeParameterFromFunction.kt"); } + @Test + @TestMetadata("approximationOfBoundedProjection.kt") + public void testApproximationOfBoundedProjection() throws Exception { + runTest("compiler/testData/diagnostics/tests/generics/approximationOfBoundedProjection.kt"); + } + @Test @TestMetadata("approximationOfInProjection.kt") public void testApproximationOfInProjection() throws Exception { diff --git a/compiler/testData/diagnostics/tests/generics/approximationOfBoundedProjection.fir.kt b/compiler/testData/diagnostics/tests/generics/approximationOfBoundedProjection.fir.kt new file mode 100644 index 00000000000..bac68c0eb43 --- /dev/null +++ b/compiler/testData/diagnostics/tests/generics/approximationOfBoundedProjection.fir.kt @@ -0,0 +1,15 @@ +// ISSUE: KT-21463 + +interface BoxWrapper> { + val box: B +} + +interface Box { + val item: T +} + +fun getBoxWrapper(): BoxWrapper = null!! + +class Element + +val box: Box = getBoxWrapper().box diff --git a/compiler/testData/diagnostics/tests/generics/approximationOfBoundedProjection.kt b/compiler/testData/diagnostics/tests/generics/approximationOfBoundedProjection.kt new file mode 100644 index 00000000000..8484f1f5eba --- /dev/null +++ b/compiler/testData/diagnostics/tests/generics/approximationOfBoundedProjection.kt @@ -0,0 +1,15 @@ +// ISSUE: KT-21463 + +interface BoxWrapper> { + val box: B +} + +interface Box { + val item: T +} + +fun getBoxWrapper(): BoxWrapper = null!! + +class Element + +val box: Box = getBoxWrapper().box 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 1dd3069fbbe..47839b947be 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 @@ -13750,6 +13750,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/generics/anonymousObjectSupertypeWithTypeParameterFromFunction.kt"); } + @Test + @TestMetadata("approximationOfBoundedProjection.kt") + public void testApproximationOfBoundedProjection() throws Exception { + runTest("compiler/testData/diagnostics/tests/generics/approximationOfBoundedProjection.kt"); + } + @Test @TestMetadata("approximationOfInProjection.kt") public void testApproximationOfInProjection() throws Exception {