diff --git a/kotlinx-coroutines-core/common/src/flow/operators/Lint.kt b/kotlinx-coroutines-core/common/src/flow/operators/Lint.kt index 858c885c1e..83f83e1e15 100644 --- a/kotlinx-coroutines-core/common/src/flow/operators/Lint.kt +++ b/kotlinx-coroutines-core/common/src/flow/operators/Lint.kt @@ -83,7 +83,8 @@ public val FlowCollector<*>.coroutineContext: CoroutineContext get() = noImpl() @Deprecated( - message = "SharedFlow never completes, so this operator has no effect.", + message = "SharedFlow never completes, so this operator typically has not effect, it can only " + + "catch exceptions from 'onSubscribe' operator", level = DeprecationLevel.WARNING, replaceWith = ReplaceWith("this") ) diff --git a/kotlinx-coroutines-core/common/test/flow/sharing/SharedFlowTest.kt b/kotlinx-coroutines-core/common/test/flow/sharing/SharedFlowTest.kt index 4314739e34..6e18b38f55 100644 --- a/kotlinx-coroutines-core/common/test/flow/sharing/SharedFlowTest.kt +++ b/kotlinx-coroutines-core/common/test/flow/sharing/SharedFlowTest.kt @@ -602,6 +602,7 @@ class SharedFlowTest : TestBase() { } @Test + @Suppress("DEPRECATION") // 'catch' fun onSubscriptionThrows() = runTest { expect(1) val sh = MutableSharedFlow(1)