[NI] Discriminate Nothing? result type from nullability constraints

Nullability constraints should not be chosen when proper
argument constraints for variables in contravariant position present.

^KT-32106 Fixed
^KT-33166 Fixed
This commit is contained in:
Pavel Kirpichenkov
2019-12-24 14:51:39 +03:00
parent a1ad680edb
commit 7ee71450bc
23 changed files with 154 additions and 35 deletions
@@ -10611,6 +10611,16 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
public void testNontrivialCallExpression() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/nestedCalls/nontrivialCallExpression.kt");
}
@TestMetadata("preferArgumentToNullability.kt")
public void testPreferArgumentToNullability() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/nestedCalls/preferArgumentToNullability.kt");
}
@TestMetadata("preferNothingToBound.kt")
public void testPreferNothingToBound() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/nestedCalls/preferNothingToBound.kt");
}
}
@TestMetadata("compiler/testData/diagnostics/tests/inference/nothingType")
@@ -10606,6 +10606,16 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
public void testNontrivialCallExpression() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/nestedCalls/nontrivialCallExpression.kt");
}
@TestMetadata("preferArgumentToNullability.kt")
public void testPreferArgumentToNullability() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/nestedCalls/preferArgumentToNullability.kt");
}
@TestMetadata("preferNothingToBound.kt")
public void testPreferNothingToBound() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/nestedCalls/preferNothingToBound.kt");
}
}
@TestMetadata("compiler/testData/diagnostics/tests/inference/nothingType")