Files
kotlin/compiler/testData/codegen/box/controlStructures/kt8148_continue.kt
Ilya Matveev a5e4e0284e Mute some box tests for native backend
This patch mutes the following test categories:
   * Tests with java dependencies (System class,
     java stdlib, jvm-oriented annotations etc).
   * Coroutines tests.
   * Reflection tests.
   * Tests with an inheritance from the standard
     collections.
2017-03-10 19:59:37 +03:00

38 lines
738 B
Kotlin
Vendored

// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
class A(var value: String)
fun box(): String {
val a = A("start")
try {
test(a)
} catch(e: java.lang.RuntimeException) {
}
if (a.value != "start, try, finally1, finally2") return "fail: ${a.value}"
return "OK"
}
fun test(a: A) : String {
while (a.value == "start") {
try {
try {
a.value += ", try"
continue
}
finally {
a.value += ", finally1"
}
}
finally {
a.value += ", finally2"
throw RuntimeException("fail")
}
}
return "fail"
}