Receiver of a safe call is not null inside the call also for extension functions + a pair of tests #KT-9033 Fixed

This commit is contained in:
Mikhail Glukhikh
2015-09-09 17:43:42 +03:00
parent 22229af930
commit 1667f18d7c
8 changed files with 43 additions and 2 deletions
@@ -0,0 +1,6 @@
fun String.bar(s: String) = s
fun foo(s: String?) {
s?.bar(<!DEBUG_INFO_SMARTCAST!>s<!>)
s?.charAt(<!DEBUG_INFO_SMARTCAST!>s<!>.length())
}
@@ -0,0 +1,4 @@
package
public fun foo(/*0*/ s: kotlin.String?): kotlin.Unit
public fun kotlin.String.bar(/*0*/ s: kotlin.String): kotlin.String
@@ -0,0 +1,7 @@
// Based on KT-9033
fun f(s: String) = s
fun foo(s: String?) {
s?.let { f(<!DEBUG_INFO_SMARTCAST!>s<!>) }
s?.let { f(it) }
}
@@ -0,0 +1,4 @@
package
public fun f(/*0*/ s: kotlin.String): kotlin.String
public fun foo(/*0*/ s: kotlin.String?): kotlin.Unit