Skip to content

Commit

Permalink
remove @ExperimentalCoroutinesApi opt-in from no-longer-experimenta…
Browse files Browse the repository at this point in the history
…l code (#4070)

`TestScope` and `TestDispatcher` used to be experimental in Coroutines,
but it is not any more
Kotlin/kotlinx.coroutines#3622

Leaving the annotation on `testCoroutineScheduler` leads to unnecessary
`@OptIn`s in user's projects.
  • Loading branch information
aSemy committed Jun 8, 2024
1 parent 51c1c0e commit f963211
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package io.kotest.core.coroutines
import io.kotest.common.KotestInternal
import io.kotest.core.test.TestScope
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.ExperimentalCoroutinesApi

@ExperimentalCoroutinesApi
@OptIn(KotestInternal::class)
val TestScope.backgroundScope: CoroutineScope
get() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ import kotlinx.coroutines.test.TestDispatcher
import kotlin.coroutines.CoroutineContext

@ExperimentalStdlibApi
@ExperimentalCoroutinesApi
val TestScope.testCoroutineScheduler: TestCoroutineScheduler
get() = coroutineContext.testCoroutineScheduler

@ExperimentalStdlibApi
@ExperimentalCoroutinesApi
val CoroutineContext.testCoroutineScheduler: TestCoroutineScheduler
get() = when (val dispatcher = this[CoroutineDispatcher]) {
is TestDispatcher -> dispatcher.scheduler
Expand Down

0 comments on commit f963211

Please sign in to comment.