Skip to content

Commit 88234c6

Browse files
qwwdfsadrecheej
authored andcommitted
Lint settings for 1.4 (Kotlin#2038)
The latest part of Kotlin#2026
1 parent 54aca0a commit 88234c6

File tree

2 files changed

+33
-27
lines changed

2 files changed

+33
-27
lines changed

kotlinx-coroutines-core/api/kotlinx-coroutines-core.api

+4
Original file line numberDiff line numberDiff line change
@@ -1030,9 +1030,13 @@ public final class kotlinx/coroutines/flow/FlowKt {
10301030
}
10311031

10321032
public final class kotlinx/coroutines/flow/LintKt {
1033+
public static final fun cancel (Lkotlinx/coroutines/flow/FlowCollector;Ljava/util/concurrent/CancellationException;)V
1034+
public static synthetic fun cancel$default (Lkotlinx/coroutines/flow/FlowCollector;Ljava/util/concurrent/CancellationException;ILjava/lang/Object;)V
10331035
public static final fun conflate (Lkotlinx/coroutines/flow/StateFlow;)Lkotlinx/coroutines/flow/Flow;
10341036
public static final fun distinctUntilChanged (Lkotlinx/coroutines/flow/StateFlow;)Lkotlinx/coroutines/flow/Flow;
10351037
public static final fun flowOn (Lkotlinx/coroutines/flow/StateFlow;Lkotlin/coroutines/CoroutineContext;)Lkotlinx/coroutines/flow/Flow;
1038+
public static final fun getCoroutineContext (Lkotlinx/coroutines/flow/FlowCollector;)Lkotlin/coroutines/CoroutineContext;
1039+
public static final fun isActive (Lkotlinx/coroutines/flow/FlowCollector;)Z
10361040
}
10371041

10381042
public abstract interface class kotlinx/coroutines/flow/MutableStateFlow : kotlinx/coroutines/flow/StateFlow {

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

+29-27
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5+
@file:Suppress("unused")
6+
57
package kotlinx.coroutines.flow
68

79
import kotlinx.coroutines.*
@@ -43,30 +45,30 @@ public fun <T> StateFlow<T>.conflate(): Flow<T> = noImpl()
4345
)
4446
public fun <T> StateFlow<T>.distinctUntilChanged(): Flow<T> = noImpl()
4547

46-
//@Deprecated(
47-
// message = "isActive is resolved into the extension of outer CoroutineScope which is likely to be an error." +
48-
// "Use currentCoroutineContext().isActive or cancellable() operator instead " +
49-
// "or specify the receiver of isActive explicitly. " +
50-
// "Additionally, flow {} builder emissions are cancellable by default.",
51-
// level = DeprecationLevel.WARNING, // ERROR in 1.4
52-
// replaceWith = ReplaceWith("currentCoroutineContext().isActive")
53-
//)
54-
//public val FlowCollector<*>.isActive: Boolean
55-
// get() = noImpl()
56-
//
57-
//@Deprecated(
58-
// message = "cancel() is resolved into the extension of outer CoroutineScope which is likely to be an error." +
59-
// "Use currentCoroutineContext().cancel() instead or specify the receiver of cancel() explicitly",
60-
// level = DeprecationLevel.WARNING, // ERROR in 1.4
61-
// replaceWith = ReplaceWith("currentCoroutineContext().cancel(cause)")
62-
//)
63-
//public fun FlowCollector<*>.cancel(cause: CancellationException? = null): Unit = noImpl()
64-
//
65-
//@Deprecated(
66-
// message = "coroutineContext is resolved into the property of outer CoroutineScope which is likely to be an error." +
67-
// "Use currentCoroutineContext() instead or specify the receiver of coroutineContext explicitly",
68-
// level = DeprecationLevel.WARNING, // ERROR in 1.4
69-
// replaceWith = ReplaceWith("currentCoroutineContext()")
70-
//)
71-
//public val FlowCollector<*>.coroutineContext: CoroutineContext
72-
// get() = noImpl()
48+
@Deprecated(
49+
message = "isActive is resolved into the extension of outer CoroutineScope which is likely to be an error." +
50+
"Use currentCoroutineContext().isActive or cancellable() operator instead " +
51+
"or specify the receiver of isActive explicitly. " +
52+
"Additionally, flow {} builder emissions are cancellable by default.",
53+
level = DeprecationLevel.ERROR,
54+
replaceWith = ReplaceWith("currentCoroutineContext().isActive")
55+
)
56+
public val FlowCollector<*>.isActive: Boolean
57+
get() = noImpl()
58+
59+
@Deprecated(
60+
message = "cancel() is resolved into the extension of outer CoroutineScope which is likely to be an error." +
61+
"Use currentCoroutineContext().cancel() instead or specify the receiver of cancel() explicitly",
62+
level = DeprecationLevel.ERROR,
63+
replaceWith = ReplaceWith("currentCoroutineContext().cancel(cause)")
64+
)
65+
public fun FlowCollector<*>.cancel(cause: CancellationException? = null): Unit = noImpl()
66+
67+
@Deprecated(
68+
message = "coroutineContext is resolved into the property of outer CoroutineScope which is likely to be an error." +
69+
"Use currentCoroutineContext() instead or specify the receiver of coroutineContext explicitly",
70+
level = DeprecationLevel.ERROR,
71+
replaceWith = ReplaceWith("currentCoroutineContext()")
72+
)
73+
public val FlowCollector<*>.coroutineContext: CoroutineContext
74+
get() = noImpl()

0 commit comments

Comments
 (0)