Skip to content

Commit 4c24659

Browse files
authored
Update Migration.kt (#4105)
Replacing "SharingStared" with correct "SharingStarted". Fixing wrong order of parameters in replaceWith of cache() method.
1 parent 87244f9 commit 4c24659

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

kotlinx-coroutines-core/common/src/flow/Migration.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ public fun <T> Flow<T>.scanReduce(operation: suspend (accumulator: T, value: T)
443443
level = DeprecationLevel.ERROR,
444444
message = "Flow analogue of 'publish()' is 'shareIn'. \n" +
445445
"publish().connect() is the default strategy (no extra call is needed), \n" +
446-
"publish().autoConnect() translates to 'started = SharingStared.Lazily' argument, \n" +
447-
"publish().refCount() translates to 'started = SharingStared.WhileSubscribed()' argument.",
446+
"publish().autoConnect() translates to 'started = SharingStarted.Lazily' argument, \n" +
447+
"publish().refCount() translates to 'started = SharingStarted.WhileSubscribed()' argument.",
448448
replaceWith = ReplaceWith("this.shareIn(scope, 0)")
449449
)
450450
public fun <T> Flow<T>.publish(): Flow<T> = noImpl()
@@ -454,8 +454,8 @@ public fun <T> Flow<T>.publish(): Flow<T> = noImpl()
454454
level = DeprecationLevel.ERROR,
455455
message = "Flow analogue of 'publish(bufferSize)' is 'buffer' followed by 'shareIn'. \n" +
456456
"publish().connect() is the default strategy (no extra call is needed), \n" +
457-
"publish().autoConnect() translates to 'started = SharingStared.Lazily' argument, \n" +
458-
"publish().refCount() translates to 'started = SharingStared.WhileSubscribed()' argument.",
457+
"publish().autoConnect() translates to 'started = SharingStarted.Lazily' argument, \n" +
458+
"publish().refCount() translates to 'started = SharingStarted.WhileSubscribed()' argument.",
459459
replaceWith = ReplaceWith("this.buffer(bufferSize).shareIn(scope, 0)")
460460
)
461461
public fun <T> Flow<T>.publish(bufferSize: Int): Flow<T> = noImpl()
@@ -465,8 +465,8 @@ public fun <T> Flow<T>.publish(bufferSize: Int): Flow<T> = noImpl()
465465
level = DeprecationLevel.ERROR,
466466
message = "Flow analogue of 'replay()' is 'shareIn' with unlimited replay. \n" +
467467
"replay().connect() is the default strategy (no extra call is needed), \n" +
468-
"replay().autoConnect() translates to 'started = SharingStared.Lazily' argument, \n" +
469-
"replay().refCount() translates to 'started = SharingStared.WhileSubscribed()' argument.",
468+
"replay().autoConnect() translates to 'started = SharingStarted.Lazily' argument, \n" +
469+
"replay().refCount() translates to 'started = SharingStarted.WhileSubscribed()' argument.",
470470
replaceWith = ReplaceWith("this.shareIn(scope, Int.MAX_VALUE)")
471471
)
472472
public fun <T> Flow<T>.replay(): Flow<T> = noImpl()
@@ -476,16 +476,16 @@ public fun <T> Flow<T>.replay(): Flow<T> = noImpl()
476476
level = DeprecationLevel.ERROR,
477477
message = "Flow analogue of 'replay(bufferSize)' is 'shareIn' with the specified replay parameter. \n" +
478478
"replay().connect() is the default strategy (no extra call is needed), \n" +
479-
"replay().autoConnect() translates to 'started = SharingStared.Lazily' argument, \n" +
480-
"replay().refCount() translates to 'started = SharingStared.WhileSubscribed()' argument.",
479+
"replay().autoConnect() translates to 'started = SharingStarted.Lazily' argument, \n" +
480+
"replay().refCount() translates to 'started = SharingStarted.WhileSubscribed()' argument.",
481481
replaceWith = ReplaceWith("this.shareIn(scope, bufferSize)")
482482
)
483483
public fun <T> Flow<T>.replay(bufferSize: Int): Flow<T> = noImpl()
484484

485485
/** @suppress */
486486
@Deprecated(
487487
level = DeprecationLevel.ERROR,
488-
message = "Flow analogue of 'cache()' is 'shareIn' with unlimited replay and 'started = SharingStared.Lazily' argument'",
489-
replaceWith = ReplaceWith("this.shareIn(scope, Int.MAX_VALUE, started = SharingStared.Lazily)")
488+
message = "Flow analogue of 'cache()' is 'shareIn' with unlimited replay and 'started = SharingStarted.Lazily' argument'",
489+
replaceWith = ReplaceWith("this.shareIn(scope, started = SharingStarted.Lazily, replay = Int.MAX_VALUE)")
490490
)
491491
public fun <T> Flow<T>.cache(): Flow<T> = noImpl()

0 commit comments

Comments
 (0)