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
@@ -1,6 +1,5 @@
fun calc(x: List<String>?): Int {
// x should be non-null in arguments list, despite of a chain
x?.subList(0, 1)<!UNSAFE_CALL!>.<!>get(<!DEBUG_INFO_SMARTCAST!>x<!>.size)
// But not here!
// x is not-null only inside subList
x?.subList(0, <!DEBUG_INFO_SMARTCAST!>x<!>.size - 1)<!UNSAFE_CALL!>.<!>get(x<!UNSAFE_CALL!>.<!>size)
return x!!.size
}