d92ccad35d
On the other hand, argument states do not propagate to successor statements for a safe call. #KT-7204 Fixed. A few additional comments.
7 lines
267 B
Kotlin
7 lines
267 B
Kotlin
fun calc(x: List<String>?): Int {
|
|
// After KT-5840 fix !! assertion should become unnecessary here
|
|
x?.get(x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.size() - 1)
|
|
// x?. or x!! above should not provide smart cast here
|
|
return x<!UNSAFE_CALL!>.<!>size()
|
|
}
|