Add tests for issues fixed in JVM IR and other obsolete issues
#KT-6007 #KT-16445 #KT-17753 #KT-22488 #KT-23881 #KT-24135 #KT-26360 #KT-27427 #KT-27449 #KT-27830 #KT-28042 #KT-29595 #KT-30708 #KT-32793
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// CHECK_STATE_MACHINE
|
||||
// FILE: inline.kt
|
||||
|
||||
import helpers.*
|
||||
|
||||
interface SuspendRunnable {
|
||||
suspend fun run(): String
|
||||
}
|
||||
|
||||
inline fun inlineMe(crossinline c1: suspend (String) -> String) =
|
||||
object : SuspendRunnable {
|
||||
override suspend fun run(): String {
|
||||
return c1(
|
||||
return try { "OK" } catch (e: Exception) { e.message!! }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline fun inlineMe2(crossinline c2: suspend (String) -> String) =
|
||||
inlineMe(c2)
|
||||
|
||||
// FILE: box.kt
|
||||
|
||||
import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(CheckStateMachineContinuation)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val r = inlineMe2 {
|
||||
StateMachineChecker.suspendHere()
|
||||
it
|
||||
}
|
||||
|
||||
var res = "FAIL"
|
||||
|
||||
builder {
|
||||
res = r.run()
|
||||
}
|
||||
StateMachineChecker.check(numberOfSuspensions = 0)
|
||||
return res
|
||||
}
|
||||
Reference in New Issue
Block a user