Redundant async: do not suggest for calls with 'start'
The reason with 'withContext' does not have such parameter anymore
This commit is contained in:
+1
-1
@@ -39,7 +39,7 @@ class RedundantAsyncInspection : AbstractCallChainChecker() {
|
|||||||
} ?: return null
|
} ?: return null
|
||||||
defaultContext ?: return null
|
defaultContext ?: return null
|
||||||
defaultStart ?: return null
|
defaultStart ?: return null
|
||||||
if (defaultContext!! && !defaultStart!!) return null
|
if (!defaultStart!!) return null
|
||||||
|
|
||||||
val receiverExpression = expression.receiverExpression
|
val receiverExpression = expression.receiverExpression
|
||||||
val scopeExpression = (receiverExpression as? KtQualifiedExpression)?.receiverExpression
|
val scopeExpression = (receiverExpression as? KtQualifiedExpression)?.receiverExpression
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ fun <T> CoroutineScope.async(
|
|||||||
|
|
||||||
suspend fun <T> withContext(
|
suspend fun <T> withContext(
|
||||||
context: CoroutineContext,
|
context: CoroutineContext,
|
||||||
start: CoroutineStart = CoroutineStart.DEFAULT,
|
|
||||||
block: suspend CoroutineScope.() -> T
|
block: suspend CoroutineScope.() -> T
|
||||||
) {
|
) {
|
||||||
TODO()
|
TODO()
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
// PROBLEM: none
|
||||||
|
|
||||||
package kotlinx.coroutines
|
package kotlinx.coroutines
|
||||||
|
|
||||||
|
|||||||
-9
@@ -1,9 +0,0 @@
|
|||||||
// WITH_RUNTIME
|
|
||||||
|
|
||||||
package kotlinx.coroutines
|
|
||||||
|
|
||||||
suspend fun test(ctx: CoroutineContext) {
|
|
||||||
coroutineScope {
|
|
||||||
withContext(ctx, CoroutineStart.LAZY) { 42 }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user