Files
kotlin-fork/native/native.tests/testData/codegen/variables/var4.kt
T
2024-03-15 01:28:01 +00:00

27 lines
374 B
Kotlin
Vendored

import kotlin.test.*
fun box(): String {
var x = Error()
for (i in 0..1) {
val c = Error()
if (i == 0) x = c
}
// x refcount is 1.
try {
try {
throw x
} finally {
x = Error()
}
} catch (e: Error) {
e.use()
}
return "OK"
}
private fun Any?.use() {
var x = this
}