diff --git a/kotlinx-coroutines-core/common/src/flow/Migration.kt b/kotlinx-coroutines-core/common/src/flow/Migration.kt index bdc205e082..fc34f85b4c 100644 --- a/kotlinx-coroutines-core/common/src/flow/Migration.kt +++ b/kotlinx-coroutines-core/common/src/flow/Migration.kt @@ -22,7 +22,7 @@ import kotlin.jvm.* * Deprecated functions also are moved here when they renamed. The difference is that they have * a body with their implementation while pure stubs have [noImpl]. */ -private fun noImpl(): Nothing = +internal fun noImpl(): Nothing = throw UnsupportedOperationException("Not implemented, should not be called") /** diff --git a/kotlinx-coroutines-core/common/src/flow/operators/StateFlowFusion.kt b/kotlinx-coroutines-core/common/src/flow/operators/Lint.kt similarity index 79% rename from kotlinx-coroutines-core/common/src/flow/operators/StateFlowFusion.kt rename to kotlinx-coroutines-core/common/src/flow/operators/Lint.kt index d1b56bd50c..23bc1f84cb 100644 --- a/kotlinx-coroutines-core/common/src/flow/operators/StateFlowFusion.kt +++ b/kotlinx-coroutines-core/common/src/flow/operators/Lint.kt @@ -2,13 +2,9 @@ * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ -@file:JvmMultifileClass -@file:JvmName("FlowKt") - package kotlinx.coroutines.flow import kotlin.coroutines.* -import kotlin.jvm.* /** * Returns this. @@ -16,11 +12,11 @@ import kotlin.jvm.* * See [StateFlow] documentation on Operator Fusion. */ @Deprecated( - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, message = "Applying flowOn operator to StateFlow has no effect. See StateFlow documentation on Operator Fusion.", replaceWith = ReplaceWith("this") ) -public fun StateFlow.flowOn(context: CoroutineContext): Flow = this +public fun StateFlow.flowOn(context: CoroutineContext): Flow = noImpl() /** * Returns this. @@ -28,11 +24,11 @@ public fun StateFlow.flowOn(context: CoroutineContext): Flow = this * See [StateFlow] documentation on Operator Fusion. */ @Deprecated( - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, message = "Applying conflate operator to StateFlow has no effect. See StateFlow documentation on Operator Fusion.", replaceWith = ReplaceWith("this") ) -public fun StateFlow.conflate(): Flow = this +public fun StateFlow.conflate(): Flow = noImpl() /** * Returns this. @@ -40,8 +36,8 @@ public fun StateFlow.conflate(): Flow = this * See [StateFlow] documentation on Operator Fusion. */ @Deprecated( - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, message = "Applying distinctUntilChanged operator to StateFlow has no effect. See StateFlow documentation on Operator Fusion.", replaceWith = ReplaceWith("this") ) -public fun StateFlow.distinctUntilChanged(): Flow = this +public fun StateFlow.distinctUntilChanged(): Flow = noImpl()