Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileLiteral.kt
T
2022-06-10 09:42:02 +03:00

12 lines
268 B
Kotlin
Vendored

// FIR_IDENTICAL
fun x(): Boolean { return true }
public fun foo(p: String?): Int {
// Exotic variant with unused literal
do { ->
p!!.length
} while (!x())
// Literal is not called so p.length is unsafe
return p<!UNSAFE_CALL!>.<!>length
}