Indirect tests for tail call diagnostics removed

This commit is contained in:
Andrey Breslav
2013-11-26 21:21:36 +04:00
parent 94500bd968
commit 0316e6cb8d
20 changed files with 80 additions and 451 deletions
@@ -1,17 +1,15 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
tailRecursive fun withWhen(counter : Int, d : Any, x : Any) : Int =
tailRecursive fun withWhen(counter : Int, d : Any) : Int =
if (counter == 0) {
0
}
else if (counter == 5) {
withWhen(counter - 1, 999, "tail")
withWhen(counter - 1, 999)
}
else
when (d) {
is String -> withWhen(counter - 1, "is String", "tail")
is Number -> withWhen(counter, "is Number", "tail")
is String -> withWhen(counter - 1, "is String")
is Number -> withWhen(counter, "is Number")
else -> throw IllegalStateException()
}
fun box() : String = if (withWhen(100000, "test", "test") == 0) "OK" else "FAIL"
fun box() : String = if (withWhen(100000, "test") == 0) "OK" else "FAIL"