mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 15:53:55 +00:00
Variable can now be "exactly initialized", "may be initialized" and "not initialized". A set of relevant tests. Some fixed tests.
12 lines
183 B
Kotlin
Vendored
12 lines
183 B
Kotlin
Vendored
// !DIAGNOSTICS: -UNUSED_VALUE
|
|
|
|
fun foo(): Int {
|
|
val i: Int
|
|
var j = 0
|
|
while (true) {
|
|
<!VAL_REASSIGNMENT!>i<!> = ++j
|
|
if (j > 5) break
|
|
}
|
|
return i
|
|
}
|