Skip to content

Commit 927ebb6

Browse files
committed
Backwards compatibility test
1 parent cba891c commit 927ebb6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

kotlinx-coroutines-core/common/src/selects/Select.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ import kotlin.native.concurrent.*
5050
* Use [yield] or [CoroutineScope.isActive] to periodically check for cancellation in tight loops if needed.
5151
*/
5252
public suspend inline fun <R> select(crossinline builder: SelectBuilder<R>.() -> Unit): R {
53+
contract {
54+
callsInPlace(builder, InvocationKind.EXACTLY_ONCE)
55+
}
5356
return selectOld(builder)
54-
// contract {
55-
// callsInPlace(builder, InvocationKind.EXACTLY_ONCE)
56-
// }
5757
// return SelectImplementation<R>(coroutineContext).run {
5858
// builder(this)
5959
// // TAIL-CALL OPTIMIZATION: the only

kotlinx-coroutines-core/common/src/selects/SelectUnbiased.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ import kotlin.coroutines.*
1919
* See [select] function description for all the other details.
2020
*/
2121
public suspend inline fun <R> selectUnbiased(crossinline builder: SelectBuilder<R>.() -> Unit): R {
22+
contract {
23+
callsInPlace(builder, InvocationKind.EXACTLY_ONCE)
24+
}
2225
return selectUnbiasedOld(builder)
23-
// contract {
24-
// callsInPlace(builder, InvocationKind.EXACTLY_ONCE)
25-
// }
2626
// return UnbiasedSelectImplementation<R>(coroutineContext).run {
2727
// builder(this)
2828
// doSelect()

0 commit comments

Comments
 (0)