Add tests for obsolete issues
(Test for KT-37331 is added to multiplatform/defaultArguments/suspend.kt.) #KT-30080 #KT-33641 #KT-36237 #KT-36952 #KT-37331 #KT-38920 #KT-39256 #KT-42415 #KT-44636 #KT-45704 #KT-47084 #KT-47894
This commit is contained in:
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
// IGNORE_BACKEND: JVM
|
||||
// WITH_STDLIB
|
||||
// WITH_COROUTINES
|
||||
// DONT_RUN_GENERATED_CODE: JS
|
||||
|
||||
import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
var iterations = 0
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var result = ""
|
||||
|
||||
tailrec suspend fun theLoop(value: Int, string: String) {
|
||||
if (value == 2) return
|
||||
result += string
|
||||
if (++iterations > 2) error("Fail: too many iterations")
|
||||
theLoop(value + 1, "b")
|
||||
}
|
||||
|
||||
builder {
|
||||
theLoop(0, "a")
|
||||
}
|
||||
|
||||
return if (result == "ab") "OK" else "Fail $result"
|
||||
}
|
||||
Reference in New Issue
Block a user