K2: Apply constraints from forks at UNTIL_FIRST_LAMBDA completion phase

Otherwise, OVERLOAD_RESOLUTION_AMBIGUITY is reported for the calls to
the functions annotated as @OverloadResolutionByLambdaReturnType

^KT-43296 In Progress
This commit is contained in:
Denis.Zharkov
2022-11-02 13:07:09 +01:00
committed by Space Team
parent 10d63cc52a
commit b73acd7a3a
10 changed files with 259 additions and 1 deletions
@@ -13946,6 +13946,18 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
runTest("compiler/testData/diagnostics/tests/inference/inferInFunctionLiteralsWithReturn.kt");
}
@Test
@TestMetadata("inferenceForkRegression.kt")
public void testInferenceForkRegression() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/inferenceForkRegression.kt");
}
@Test
@TestMetadata("inferenceForkRegressionSimple.kt")
public void testInferenceForkRegressionSimple() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/inferenceForkRegressionSimple.kt");
}
@Test
@TestMetadata("intersectionTypeMultipleBoundsAsReceiver.kt")
public void testIntersectionTypeMultipleBoundsAsReceiver() throws Exception {
@@ -15972,6 +15984,22 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/inference/forks")
@TestDataPath("$PROJECT_ROOT")
public class Forks {
@Test
public void testAllFilesPresentInForks() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/inference/forks"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("overloadResolutionByLambdaReturnTypeAndExpectedType.kt")
public void testOverloadResolutionByLambdaReturnTypeAndExpectedType() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/forks/overloadResolutionByLambdaReturnTypeAndExpectedType.kt");
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/inference/nestedCalls")
@TestDataPath("$PROJECT_ROOT")