[FIR] Don't approximate captured types

This fixes some type argument mismatch errors caused by a captured type
being approximated and then captured again.
Some places need to be adapted to work with captured types that
previously only worked with approximated types.

#KT-62959 Fixed
This commit is contained in:
Kirill Rakhman
2023-12-20 11:10:25 +01:00
committed by Space Team
parent b6d7f35ebf
commit 251827c9aa
58 changed files with 506 additions and 86 deletions
@@ -17917,6 +17917,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/inference/capturedTypes/capturingFromArgumentOfFlexibleType.kt");
}
@Test
@TestMetadata("capturingOfDnn.kt")
public void testCapturingOfDnn() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/capturedTypes/capturingOfDnn.kt");
}
@Test
@TestMetadata("differentCapturedTypes.kt")
public void testDifferentCapturedTypes() throws Exception {
@@ -33742,6 +33748,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/sealed/DoubleInner.kt");
}
@Test
@TestMetadata("ExhaustiveOnCaptured.kt")
public void testExhaustiveOnCaptured() throws Exception {
runTest("compiler/testData/diagnostics/tests/sealed/ExhaustiveOnCaptured.kt");
}
@Test
@TestMetadata("ExhaustiveOnRoot.kt")
public void testExhaustiveOnRoot() throws Exception {
@@ -3525,6 +3525,12 @@ public class DiagnosticCompilerTestFirTestdataTestGenerated extends AbstractDiag
runTest("compiler/fir/analysis-tests/testData/resolve/inference/nullableIntegerLiteralType.kt");
}
@Test
@TestMetadata("onlyInputTypesCapturedTypeWithRecursiveBounds.kt")
public void testOnlyInputTypesCapturedTypeWithRecursiveBounds() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/inference/onlyInputTypesCapturedTypeWithRecursiveBounds.kt");
}
@Test
@TestMetadata("overloadResolutionByLambdaArgumentType.kt")
public void testOverloadResolutionByLambdaArgumentType() throws Exception {
@@ -17917,6 +17917,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/inference/capturedTypes/capturingFromArgumentOfFlexibleType.kt");
}
@Test
@TestMetadata("capturingOfDnn.kt")
public void testCapturingOfDnn() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/capturedTypes/capturingOfDnn.kt");
}
@Test
@TestMetadata("differentCapturedTypes.kt")
public void testDifferentCapturedTypes() throws Exception {
@@ -33742,6 +33748,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/sealed/DoubleInner.kt");
}
@Test
@TestMetadata("ExhaustiveOnCaptured.kt")
public void testExhaustiveOnCaptured() throws Exception {
runTest("compiler/testData/diagnostics/tests/sealed/ExhaustiveOnCaptured.kt");
}
@Test
@TestMetadata("ExhaustiveOnRoot.kt")
public void testExhaustiveOnRoot() throws Exception {
@@ -3525,6 +3525,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFirTestDataTestGenerated
runTest("compiler/fir/analysis-tests/testData/resolve/inference/nullableIntegerLiteralType.kt");
}
@Test
@TestMetadata("onlyInputTypesCapturedTypeWithRecursiveBounds.kt")
public void testOnlyInputTypesCapturedTypeWithRecursiveBounds() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/inference/onlyInputTypesCapturedTypeWithRecursiveBounds.kt");
}
@Test
@TestMetadata("overloadResolutionByLambdaArgumentType.kt")
public void testOverloadResolutionByLambdaArgumentType() throws Exception {