Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/safecalls/argument.kt
T
2015-10-07 08:46:34 +03:00

7 lines
262 B
Kotlin
Vendored

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
}