Files
kotlin-fork/compiler/testData/diagnostics/tests/reassignment/dowhile.kt
T
Mikhail Glukhikh 285d5d06c7 More precise value reassignment analysis. #KT-7418 Fixed. #KT-6902 Fixed.
Variable can now be "exactly initialized", "may be initialized" and "not initialized".
A set of relevant tests. Some fixed tests.
2015-09-02 12:07:18 +03:00

10 lines
160 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_VALUE
fun foo(): Int {
val i: Int
var j = 0
do {
<!VAL_REASSIGNMENT!>i<!> = ++j
} while (j < 5)
return i
}