Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileLiteral.fir.kt
T
2020-06-19 15:53:00 +03:00

10 lines
232 B
Kotlin
Vendored

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.length
}