Files
kotlin-fork/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/labeledThisReferences.kt
T
Svyatoslav Kuzmich a3e2d2804c [Wasm] Update testData after adding K2 and new test infra support.
- Actualize muted K2 tests
- Actualize muted K1 tests with module systems because legacy Wasm test
  infra had no respect for "// MODULE: ..." test directives
2023-06-25 10:20:40 +02:00

30 lines
574 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class B {
inner class C {
tailrec fun h(counter : Int) {
if (counter > 0) {
this@C.h(counter - 1)
}
}
<!NO_TAIL_CALLS_FOUND!>tailrec<!> fun h2(x : Any) {
this@B.h2("no recursion") // keep vigilance
}
}
fun makeC() : C = C()
fun h2(x : Any) {
}
}
fun box() : String {
B().makeC().h(1000000)
B().makeC().h2(0)
return "OK"
}