Skip to content

Commit bbf198b

Browse files
committed
Fix StackTraceRecoveryTest.testCancellableContinuation for 1.3.60
Compiler now properly optimizes tail calls to suspendCancellableCoroutine so we need to make sure it is not a tail call for this test
1 parent ef27ac3 commit bbf198b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

kotlinx-coroutines-core/jvm/test/exceptions/StackTraceRecoveryTest.kt

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
/*
2-
* Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
package kotlinx.coroutines.exceptions
66

77
import kotlinx.coroutines.*
88
import kotlinx.coroutines.channels.*
99
import kotlinx.coroutines.intrinsics.*
10-
import kotlinx.coroutines.selects.*
11-
import org.junit.*
1210
import org.junit.Test
13-
import org.junit.rules.*
1411
import java.util.concurrent.*
1512
import kotlin.concurrent.*
1613
import kotlin.coroutines.*
@@ -265,5 +262,6 @@ class StackTraceRecoveryTest : TestBase() {
265262
suspendCancellableCoroutine<Unit> { cont ->
266263
channel.offer(Callback(cont))
267264
}
265+
yield() // nop to make sure it is not a tail call
268266
}
269267
}

0 commit comments

Comments
 (0)