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
@@ -14,7 +14,7 @@ fun bar(arg: Long?): Long {
return i<!UNSAFE_CALL!>--<!> <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>+<!> i
}
if (i++ == 7L) {
return i++ <!NONE_APPLICABLE!>+<!> i
return i++ <!UNSAFE_OPERATOR_CALL!>+<!> <!TYPE_MISMATCH!>i<!>
}
return 0L
}