[NI] Introduce flag to change constraint system for overload resolution
This commit doesn't change behaviour of any inference algorithm, it introduces opportunity to switch constraint system that is used for overload resolution and fix problematic cases by changing one enum entry. Due to fundamental changes, there are cases where a new inference algorithm reports overload resolution ambiguity errors (#KT-31670, #KT-31758), which is correct from its point of view. However, this is a breaking change and to really make it, we should be very confident and have enough motivation for it, therefore, we don't change behavior now in order to collect more examples (if there are any). And if we find a lot of erroneous examples, we'll be able to change the behavior quite simply
This commit is contained in:
@@ -17912,6 +17912,26 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt10640.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt31670.kt")
|
||||
public void testKt31670() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31670.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt31670_compat.kt")
|
||||
public void testKt31670_compat() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31670_compat.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt31758.kt")
|
||||
public void testKt31758() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31758.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt31758_compat.kt")
|
||||
public void testKt31758_compat() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31758_compat.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("numberOfDefaults.kt")
|
||||
public void testNumberOfDefaults() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/numberOfDefaults.kt");
|
||||
@@ -17922,6 +17942,16 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/originalExamples.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("overloadResolutionOnNullableContravariantParameter.kt")
|
||||
public void testOverloadResolutionOnNullableContravariantParameter() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/overloadResolutionOnNullableContravariantParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("overloadResolutionOnNullableContravariantParameter_compat.kt")
|
||||
public void testOverloadResolutionOnNullableContravariantParameter_compat() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/overloadResolutionOnNullableContravariantParameter_compat.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("varargWithMoreSpecificSignature.kt")
|
||||
public void testVarargWithMoreSpecificSignature() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargWithMoreSpecificSignature.kt");
|
||||
|
||||
Reference in New Issue
Block a user