Skip to content

Commit f7f14b3

Browse files
qwwdfsadpablobaxter
authored andcommitted
More precise SharedFlow lint message (Kotlin#2830)
1 parent 1dfd6de commit f7f14b3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

kotlinx-coroutines-core/common/src/flow/operators/Lint.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ public val FlowCollector<*>.coroutineContext: CoroutineContext
8383
get() = noImpl()
8484

8585
@Deprecated(
86-
message = "SharedFlow never completes, so this operator has no effect.",
86+
message = "SharedFlow never completes, so this operator typically has not effect, it can only " +
87+
"catch exceptions from 'onSubscribe' operator",
8788
level = DeprecationLevel.WARNING,
8889
replaceWith = ReplaceWith("this")
8990
)

kotlinx-coroutines-core/common/test/flow/sharing/SharedFlowTest.kt

+1
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ class SharedFlowTest : TestBase() {
602602
}
603603

604604
@Test
605+
@Suppress("DEPRECATION") // 'catch'
605606
fun onSubscriptionThrows() = runTest {
606607
expect(1)
607608
val sh = MutableSharedFlow<String>(1)

0 commit comments

Comments
 (0)