blob: f07ba8d0f7c0a8c4e1647d40841203774d3e2852 [file]
// ISSUE: KT-25747
fun test1() {
val nullableString: String? = ""
val savedSmartCastResult = nullableString != null
if (savedSmartCastResult) {
nullableString.length
}
}
fun test2() {
var nullableAny: Any? = ""
val savedSmartCastResult = nullableAny is String
nullableAny = 10
if (savedSmartCastResult) {
nullableAny.<!UNRESOLVED_REFERENCE!>length<!>
}
}
class A {
val a: String? = ""
}
fun test3(a: A){
val savedSmartCastResult = a.a != null
if(savedSmartCastResult) {
a.a.length
}
}
fun test4() {
val nullableAny: Any? = ""
val savedSmartCastResult = (nullableAny!= null && nullableAny is String?)
if(savedSmartCastResult) {
nullableAny.length
}
}