diff --git a/kotlinx-coroutines-core/common/src/flow/Migration.kt b/kotlinx-coroutines-core/common/src/flow/Migration.kt index 57749523d4..6278081a5d 100644 --- a/kotlinx-coroutines-core/common/src/flow/Migration.kt +++ b/kotlinx-coroutines-core/common/src/flow/Migration.kt @@ -344,13 +344,13 @@ public fun Flow.concatWith(value: T): Flow = noImpl() /** * Flow analogue of `concatWith` is [onCompletion]. - * Use `onCompletion { emitAll(other) }`. + * Use `onCompletion { if (it == null) emitAll(other) }`. * @suppress */ @Deprecated( level = DeprecationLevel.ERROR, - message = "Flow analogue of 'concatWith' is 'onCompletion'. Use 'onCompletion { emitAll(other) }'", - replaceWith = ReplaceWith("onCompletion { emitAll(other) }") + message = "Flow analogue of 'concatWith' is 'onCompletion'. Use 'onCompletion { if (it == null) emitAll(other) }'", + replaceWith = ReplaceWith("onCompletion { if (it == null) emitAll(other) }") ) public fun Flow.concatWith(other: Flow): Flow = noImpl() @@ -404,7 +404,7 @@ public fun Flow.combineLatest( * @suppress */ @Deprecated( - level = DeprecationLevel.WARNING, // since 1.3.0, error in 1.4.0 + level = DeprecationLevel.ERROR, // since 1.3.0, error in 1.5.0 message = "Use 'onStart { delay(timeMillis) }'", replaceWith = ReplaceWith("onStart { delay(timeMillis) }") ) @@ -416,7 +416,7 @@ public fun Flow.delayFlow(timeMillis: Long): Flow = onStart { delay(ti * @suppress */ @Deprecated( - level = DeprecationLevel.WARNING, // since 1.3.0, error in 1.4.0 + level = DeprecationLevel.ERROR, // since 1.3.0, error in 1.5.0 message = "Use 'onEach { delay(timeMillis) }'", replaceWith = ReplaceWith("onEach { delay(timeMillis) }") ) @@ -430,7 +430,7 @@ public fun Flow.delayEach(timeMillis: Long): Flow = onEach { delay(tim public fun Flow.switchMap(transform: suspend (value: T) -> Flow): Flow = flatMapLatest(transform) @Deprecated( - level = DeprecationLevel.WARNING, // Since 1.3.8, was experimental when deprecated + level = DeprecationLevel.ERROR, // Warning since 1.3.8, was experimental when deprecated, ERROR since 1.5.0 message = "'scanReduce' was renamed to 'runningReduce' to be consistent with Kotlin standard library", replaceWith = ReplaceWith("runningReduce(operation)") )