diff --git a/kotlinx-coroutines-core/common/src/CloseableCoroutineDispatcher.kt b/kotlinx-coroutines-core/common/src/CloseableCoroutineDispatcher.kt index 239eabc4a5..2813423675 100644 --- a/kotlinx-coroutines-core/common/src/CloseableCoroutineDispatcher.kt +++ b/kotlinx-coroutines-core/common/src/CloseableCoroutineDispatcher.kt @@ -7,9 +7,7 @@ package kotlinx.coroutines * Examples of closeable dispatchers are dispatchers backed by `java.lang.Executor` and * by `kotlin.native.Worker`. */ -@OptIn(ExperimentalSubclassOptIn::class) @ExperimentalCoroutinesApi -@SubclassOptInRequired(ExperimentalForInheritanceCoroutinesApi::class) public expect abstract class CloseableCoroutineDispatcher() : CoroutineDispatcher, AutoCloseable { /** diff --git a/kotlinx-coroutines-core/common/src/flow/Builders.kt b/kotlinx-coroutines-core/common/src/flow/Builders.kt index e8ed33d54f..d56666f37f 100644 --- a/kotlinx-coroutines-core/common/src/flow/Builders.kt +++ b/kotlinx-coroutines-core/common/src/flow/Builders.kt @@ -137,7 +137,6 @@ public fun flowOf(value: T): Flow = flow { */ public fun emptyFlow(): Flow = EmptyFlow -@OptIn(ExperimentalForInheritanceCoroutinesApi::class) private object EmptyFlow : Flow { override suspend fun collect(collector: FlowCollector) = Unit } diff --git a/kotlinx-coroutines-core/common/src/flow/Flow.kt b/kotlinx-coroutines-core/common/src/flow/Flow.kt index ac19822af6..0491c487af 100644 --- a/kotlinx-coroutines-core/common/src/flow/Flow.kt +++ b/kotlinx-coroutines-core/common/src/flow/Flow.kt @@ -174,7 +174,6 @@ import kotlin.coroutines.* * of the developer mistakes related to concurrency, inconsistent flow dispatchers, and cancellation. */ @OptIn(ExperimentalSubclassOptIn::class) -@SubclassOptInRequired(ExperimentalForInheritanceCoroutinesApi::class) public interface Flow { /** @@ -220,7 +219,6 @@ public interface Flow { * ``` */ @ExperimentalCoroutinesApi -@OptIn(ExperimentalForInheritanceCoroutinesApi::class) public abstract class AbstractFlow : Flow, CancellableFlow { public final override suspend fun collect(collector: FlowCollector) { diff --git a/kotlinx-coroutines-core/common/src/flow/internal/ChannelFlow.kt b/kotlinx-coroutines-core/common/src/flow/internal/ChannelFlow.kt index 2215cfe8f0..e00c1fdd61 100644 --- a/kotlinx-coroutines-core/common/src/flow/internal/ChannelFlow.kt +++ b/kotlinx-coroutines-core/common/src/flow/internal/ChannelFlow.kt @@ -16,7 +16,6 @@ internal fun Flow.asChannelFlow(): ChannelFlow = * * @suppress **This an internal API and should not be used from general code.** */ -@OptIn(ExperimentalForInheritanceCoroutinesApi::class) @InternalCoroutinesApi public interface FusibleFlow : Flow { /** diff --git a/kotlinx-coroutines-core/common/src/flow/internal/SafeCollector.common.kt b/kotlinx-coroutines-core/common/src/flow/internal/SafeCollector.common.kt index 368ca69fb8..4e82ca65a7 100644 --- a/kotlinx-coroutines-core/common/src/flow/internal/SafeCollector.common.kt +++ b/kotlinx-coroutines-core/common/src/flow/internal/SafeCollector.common.kt @@ -100,7 +100,6 @@ internal tailrec fun Job?.transitiveCoroutineParent(collectJob: Job?): Job? { * An analogue of the [flow] builder that does not check the context of execution of the resulting flow. * Used in our own operators where we trust the context of invocations. */ -@OptIn(ExperimentalForInheritanceCoroutinesApi::class) @PublishedApi internal inline fun unsafeFlow(@BuilderInference crossinline block: suspend FlowCollector.() -> Unit): Flow { return object : Flow { diff --git a/kotlinx-coroutines-core/common/src/flow/operators/Context.kt b/kotlinx-coroutines-core/common/src/flow/operators/Context.kt index 9adb057f51..99e2134132 100644 --- a/kotlinx-coroutines-core/common/src/flow/operators/Context.kt +++ b/kotlinx-coroutines-core/common/src/flow/operators/Context.kt @@ -259,7 +259,6 @@ public fun Flow.cancellable(): Flow = /** * Internal marker for flows that are [cancellable]. */ -@OptIn(ExperimentalForInheritanceCoroutinesApi::class) internal interface CancellableFlow : Flow /** diff --git a/kotlinx-coroutines-core/common/src/flow/operators/Distinct.kt b/kotlinx-coroutines-core/common/src/flow/operators/Distinct.kt index 36d40e020f..de95b45e71 100644 --- a/kotlinx-coroutines-core/common/src/flow/operators/Distinct.kt +++ b/kotlinx-coroutines-core/common/src/flow/operators/Distinct.kt @@ -59,7 +59,6 @@ private fun Flow.distinctUntilChangedBy( else -> DistinctFlowImpl(this, keySelector, areEquivalent) } -@OptIn(ExperimentalForInheritanceCoroutinesApi::class) private class DistinctFlowImpl( private val upstream: Flow, @JvmField val keySelector: (T) -> Any?, diff --git a/kotlinx-coroutines-core/jsAndWasmShared/src/CloseableCoroutineDispatcher.kt b/kotlinx-coroutines-core/jsAndWasmShared/src/CloseableCoroutineDispatcher.kt index 0474877396..3ea73ad7a1 100644 --- a/kotlinx-coroutines-core/jsAndWasmShared/src/CloseableCoroutineDispatcher.kt +++ b/kotlinx-coroutines-core/jsAndWasmShared/src/CloseableCoroutineDispatcher.kt @@ -1,7 +1,5 @@ package kotlinx.coroutines -@OptIn(ExperimentalSubclassOptIn::class) -@SubclassOptInRequired(ExperimentalForInheritanceCoroutinesApi::class) public actual abstract class CloseableCoroutineDispatcher actual constructor() : CoroutineDispatcher(), AutoCloseable { public actual abstract override fun close() } diff --git a/kotlinx-coroutines-core/jvm/src/Executors.kt b/kotlinx-coroutines-core/jvm/src/Executors.kt index 3bdd454d02..b886a285a5 100644 --- a/kotlinx-coroutines-core/jvm/src/Executors.kt +++ b/kotlinx-coroutines-core/jvm/src/Executors.kt @@ -15,7 +15,6 @@ import kotlin.AutoCloseable * asynchronous API that requires an instance of the [Executor]. */ @OptIn(ExperimentalSubclassOptIn::class) -@SubclassOptInRequired(ExperimentalForInheritanceCoroutinesApi::class) public abstract class ExecutorCoroutineDispatcher : CoroutineDispatcher(), Closeable, AutoCloseable { /** @suppress */ @ExperimentalStdlibApi diff --git a/kotlinx-coroutines-core/native/src/CloseableCoroutineDispatcher.kt b/kotlinx-coroutines-core/native/src/CloseableCoroutineDispatcher.kt index 0474877396..11ef089b36 100644 --- a/kotlinx-coroutines-core/native/src/CloseableCoroutineDispatcher.kt +++ b/kotlinx-coroutines-core/native/src/CloseableCoroutineDispatcher.kt @@ -1,7 +1,6 @@ package kotlinx.coroutines @OptIn(ExperimentalSubclassOptIn::class) -@SubclassOptInRequired(ExperimentalForInheritanceCoroutinesApi::class) public actual abstract class CloseableCoroutineDispatcher actual constructor() : CoroutineDispatcher(), AutoCloseable { public actual abstract override fun close() }