K2: Support inference case with a mix of smart-cast and expected type

The idea is that we should not fix (i.e. choose any of the fork branches)
on the stage of candidate processing before completion, but it's enough
just to check that current state can be converged to success.

And when completion starts, and we add expected type to the system,
we've got more information to choose the correct fork branch.

NB: The old `processForkConstraints` is being called just
at the beginning of the completion phase.

^KT-43296 In Progress
This commit is contained in:
Denis.Zharkov
2022-11-01 19:21:16 +01:00
committed by Space Team
parent 77e197d46a
commit 715a73c8fb
9 changed files with 118 additions and 6 deletions
@@ -14276,6 +14276,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
runTest("compiler/testData/diagnostics/tests/inference/smartCastFork.kt");
}
@Test
@TestMetadata("smartCastForkForExpectType.kt")
public void testSmartCastForkForExpectType() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/smartCastForkForExpectType.kt");
}
@Test
@TestMetadata("specialCallsWithCallableReferences.kt")
public void testSpecialCallsWithCallableReferences() throws Exception {