Files
kotlin-fork/idea/testData/inspectionsLocal/liftOut/ifToAssignment/cascadeIf.kt
T
Mikhail Glukhikh 2d1abda9a1 Convert "lift return / assignment" intentions into a single inspection
Also includes minor test fix, related to KT-14900
2017-07-07 18:15:14 +03:00

18 lines
412 B
Kotlin
Vendored

// WITH_RUNTIME
fun test(x: Any) {
var res: String
<caret>if (x is String)
when {
x.length > 3 -> res = "long string"
else -> res = "short string"
}
else if (x is Int)
when {
x > 999 || x < -99 -> res = "long int"
else -> res = "short int"
}
else if (x is Long)
TODO()
else
res = "I don't know"
}