[Tests] Add test for #KT-65712

This commit is contained in:
Kirill Rakhman
2024-02-09 16:08:33 +01:00
committed by Space Team
parent 9391ff8179
commit 91e4837c95
7 changed files with 52 additions and 0 deletions
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -0,0 +1,11 @@
// ISSUE: KT-65712
fun test(a: BodySpec<List<*>, *>) {
a.value<<!UPPER_BOUND_VIOLATED!>BodySpec<List<*>, *><!>>()
a.value<<!UPPER_BOUND_VIOLATED!>BodySpec<*, *><!>>()
a.value<<!UPPER_BOUND_VIOLATED!>BodySpec<Int, *><!>>()
}
interface BodySpec<B, S : BodySpec<B, S>> {
fun <T : S> value(): T
}
@@ -0,0 +1,11 @@
// ISSUE: KT-65712
fun test(a: BodySpec<List<*>, *>) {
a.value<BodySpec<List<*>, *>>()
a.value<BodySpec<*, *>>()
a.value<BodySpec<Int, *>>()
}
interface BodySpec<B, S : BodySpec<B, S>> {
fun <T : S> value(): T
}
@@ -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 {