FIR: Refine inference constraints when type variable in flexible position

That issue might be fixed via changing
TypeVariableMarker.shouldBeFlexible at ConeConstraintSystemUtilContext
but this and some other tricks have been added because of incorrect
handling of constraints where type variable has a flexible bound

^KT-51168 Fixed
This commit is contained in:
Denis.Zharkov
2022-04-12 16:30:55 +03:00
committed by teamcity
parent 853b7ec078
commit f70ae2df3a
54 changed files with 411 additions and 154 deletions
@@ -18164,6 +18164,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
runTest("compiler/testData/diagnostics/tests/j+k/flexibleNothing.kt");
}
@Test
@TestMetadata("flexibleTypeVariablePosition.kt")
public void testFlexibleTypeVariablePosition() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/flexibleTypeVariablePosition.kt");
}
@Test
@TestMetadata("genericConstructorWithMultipleBounds.kt")
public void testGenericConstructorWithMultipleBounds() throws Exception {
@@ -19187,6 +19193,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
runTest("compiler/testData/diagnostics/tests/j+k/types/typeParameter.kt");
}
@Test
@TestMetadata("upperBoundsCheckAgainstSelfTypeInJava.kt")
public void testUpperBoundsCheckAgainstSelfTypeInJava() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/types/upperBoundsCheckAgainstSelfTypeInJava.kt");
}
@Test
@TestMetadata("varargOverride.kt")
public void testVarargOverride() throws Exception {
@@ -23110,6 +23122,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
runTest("compiler/testData/diagnostics/tests/platformTypes/samConstructor.kt");
}
@Test
@TestMetadata("starProjectionToFlexibleVariable.kt")
public void testStarProjectionToFlexibleVariable() throws Exception {
runTest("compiler/testData/diagnostics/tests/platformTypes/starProjectionToFlexibleVariable.kt");
}
@Test
@TestMetadata("supertypeTypeArguments.kt")
public void testSupertypeTypeArguments() throws Exception {
@@ -37928,6 +37946,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/java"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("assertThatOnMap.kt")
public void testAssertThatOnMap() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/java/assertThatOnMap.kt");
}
@Test
@TestMetadata("checkEnhancedUpperBounds.kt")
public void testCheckEnhancedUpperBounds() throws Exception {