More accurate safe call handling in GenericCandidateResolver / CallExpressionResolver

(real receiver nullability is taken into account)
This commit is contained in:
Mikhail Glukhikh
2016-02-12 13:21:10 +03:00
committed by Mikhail Glukhikh
parent 17593e4ef6
commit 0f7284f83a
3 changed files with 11 additions and 10 deletions
@@ -26,6 +26,10 @@ fun foo(l: A<String>?) {
// No errors should be here
foo(l?.bar()) checkType { _<String?>() }
foo(l?.gav()) checkType { _<String?>() }
if (l != null) {
foo(l<!UNNECESSARY_SAFE_CALL!>?.<!>bar()) checkType { _<String>() }
foo(l<!UNNECESSARY_SAFE_CALL!>?.<!>gav()) checkType { _<String>() }
}
}
fun fooNotNull(l: A<String>) {