Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileLiteral.kt
T
2015-10-14 20:39:35 +03:00

10 lines
280 B
Kotlin
Vendored

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