Call chains: receiver data flow info is dropped for extensions with nullable receiver #KT-10056 Fixed

This commit is contained in:
Mikhail Glukhikh
2015-11-18 14:41:48 +03:00
parent 97cdaba8b0
commit 8788d8e2d5
11 changed files with 198 additions and 5 deletions
@@ -0,0 +1,13 @@
class Foo(val bar: String?)
public inline fun <T, R> T.let(f: (T) -> R): R = f(this)
fun test(foo: Foo?) {
foo!!.bar.let {
// Correct
<!DEBUG_INFO_SMARTCAST!>foo<!>.bar?.length
// Unnecessary
foo<!UNNECESSARY_SAFE_CALL!>?.<!>bar?.length
}
<!DEBUG_INFO_SMARTCAST!>foo<!>.bar?.length
}