Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/notIsNullOrEmpty.kt
T
2020-03-19 09:51:01 +03:00

15 lines
296 B
Kotlin
Vendored

fun test_1(s: String?) {
when {
!s.isNullOrEmpty() -> s.length // Should be OK
}
}
fun test_2(s: String?) {
// contracts related
if (s.isNullOrEmpty()) {
s.<!INAPPLICABLE_CANDIDATE!>length<!> // Should be bad
} else {
s.length // Should be OK
}
}