Implementation and tests for KT-5840 and newly created KT-7204. Now a safe call provides not-null receiver state *inside* argument list. It works also for ?. chains. #KT-5840 Fixed.

On the other hand, argument states do not propagate to successor statements for a safe call. #KT-7204 Fixed. A few additional comments.
This commit is contained in:
Mikhail Glukhikh
2015-03-24 17:03:01 +03:00
parent 79739b7090
commit d92ccad35d
53 changed files with 566 additions and 63 deletions
@@ -0,0 +1,8 @@
fun foo(x: String): String? = x
fun calc(x: String?): Int {
// Smart cast because of x!! in receiver
foo(x!!)?.subSequence(0, <!DEBUG_INFO_SMARTCAST!>x<!>.length())?.length()
// Smart cast because of x!! in receiver
return <!DEBUG_INFO_SMARTCAST!>x<!>.length()
}