Improve diagnostic on overload resolution ambiguity

Report type mismatch on argument when a nullable argument is passed to non-null parameter.

 Note that this affects only functions with simple types without generics

 #KT-2007 Fixed
 #KT-9282 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2017-06-20 17:18:53 +03:00
parent 16de991b07
commit 7a9e1b2b1d
11 changed files with 82 additions and 11 deletions
@@ -14011,6 +14011,18 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("nullableArgumentToNonNullParameterPlatform.kt")
public void testNullableArgumentToNonNullParameterPlatform() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterPlatform.kt");
doTest(fileName);
}
@TestMetadata("nullableArgumentToNonNullParameterSimple.kt")
public void testNullableArgumentToNonNullParameterSimple() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterSimple.kt");
doTest(fileName);
}
@TestMetadata("redundantNullable.kt")
public void testRedundantNullable() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/nullableTypes/redundantNullable.kt");