@@ -19,7 +19,6 @@ import kotlinx.coroutines.internal.*
19
19
* See [issue #254](https://github.com/Kotlin/kotlinx.coroutines/issues/254).
20
20
*/
21
21
@ObsoleteCoroutinesApi
22
- @Suppress(" CONFLICTING_OVERLOADS" )
23
22
public fun <T > MaybeSource<T>.openSubscription (): ReceiveChannel <T > {
24
23
val channel = SubscriptionChannel <T >()
25
24
subscribe(channel)
@@ -34,36 +33,33 @@ public fun <T> MaybeSource<T>.openSubscription(): ReceiveChannel<T> {
34
33
* See [issue #254](https://github.com/Kotlin/kotlinx.coroutines/issues/254).
35
34
*/
36
35
@ObsoleteCoroutinesApi
37
- @Suppress(" CONFLICTING_OVERLOADS" )
38
36
public fun <T > ObservableSource<T>.openSubscription (): ReceiveChannel <T > {
39
37
val channel = SubscriptionChannel <T >()
40
38
subscribe(channel)
41
39
return channel
42
40
}
43
41
44
42
// Will be promoted to error in 1.3.0, removed in 1.4.0
45
- @Deprecated(message = " Use collect instead" , level = DeprecationLevel .WARNING , replaceWith = ReplaceWith (" this.collect(action)" ))
43
+ @Deprecated(message = " Use collect instead" , level = DeprecationLevel .ERROR , replaceWith = ReplaceWith (" this.collect(action)" ))
46
44
public suspend inline fun <T > MaybeSource<T>.consumeEach (action : (T ) -> Unit ) =
47
45
openSubscription().consumeEach(action)
48
46
49
47
// Will be promoted to error in 1.3.0, removed in 1.4.0
50
- @Deprecated(message = " Use collect instead" , level = DeprecationLevel .WARNING , replaceWith = ReplaceWith (" this.collect(action)" ))
48
+ @Deprecated(message = " Use collect instead" , level = DeprecationLevel .ERROR , replaceWith = ReplaceWith (" this.collect(action)" ))
51
49
public suspend inline fun <T > ObservableSource<T>.consumeEach (action : (T ) -> Unit ) =
52
50
openSubscription().consumeEach(action)
53
51
54
52
/* *
55
53
* Subscribes to this [MaybeSource] and performs the specified action for each received element.
56
54
* Cancels subscription if any exception happens during collect.
57
55
*/
58
- @ExperimentalCoroutinesApi // Since 1.2.1, tentatively till 1.3.0
59
56
public suspend inline fun <T > MaybeSource<T>.collect (action : (T ) -> Unit ) =
60
57
openSubscription().consumeEach(action)
61
58
62
59
/* *
63
60
* Subscribes to this [ObservableSource] and performs the specified action for each received element.
64
61
* Cancels subscription if any exception happens during collect.
65
62
*/
66
- @ExperimentalCoroutinesApi // Since 1.2.1, tentatively till 1.3.0
67
63
public suspend inline fun <T > ObservableSource<T>.collect (action : (T ) -> Unit ) =
68
64
openSubscription().consumeEach(action)
69
65
0 commit comments