diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/coroutines/RedundantAsyncInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/coroutines/RedundantAsyncInspection.kt index a68230e6bd4..d5c9418d2b5 100644 --- a/idea/src/org/jetbrains/kotlin/idea/inspections/coroutines/RedundantAsyncInspection.kt +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/coroutines/RedundantAsyncInspection.kt @@ -39,7 +39,7 @@ class RedundantAsyncInspection : AbstractCallChainChecker() { } ?: return null defaultContext ?: return null defaultStart ?: return null - if (defaultContext!! && !defaultStart!!) return null + if (!defaultStart!!) return null val receiverExpression = expression.receiverExpression val scopeExpression = (receiverExpression as? KtQualifiedExpression)?.receiverExpression diff --git a/idea/testData/inspectionsLocal/coroutines/redundantAsync/coroutines.lib.kt b/idea/testData/inspectionsLocal/coroutines/redundantAsync/coroutines.lib.kt index 94072127e34..0791bbff53c 100644 --- a/idea/testData/inspectionsLocal/coroutines/redundantAsync/coroutines.lib.kt +++ b/idea/testData/inspectionsLocal/coroutines/redundantAsync/coroutines.lib.kt @@ -33,7 +33,6 @@ fun CoroutineScope.async( suspend fun withContext( context: CoroutineContext, - start: CoroutineStart = CoroutineStart.DEFAULT, block: suspend CoroutineScope.() -> T ) { TODO() diff --git a/idea/testData/inspectionsLocal/coroutines/redundantAsync/withStartAndContext.kt b/idea/testData/inspectionsLocal/coroutines/redundantAsync/withStartAndContext.kt index a8c4abd51ae..859abfbc05c 100644 --- a/idea/testData/inspectionsLocal/coroutines/redundantAsync/withStartAndContext.kt +++ b/idea/testData/inspectionsLocal/coroutines/redundantAsync/withStartAndContext.kt @@ -1,4 +1,5 @@ // WITH_RUNTIME +// PROBLEM: none package kotlinx.coroutines diff --git a/idea/testData/inspectionsLocal/coroutines/redundantAsync/withStartAndContext.kt.after b/idea/testData/inspectionsLocal/coroutines/redundantAsync/withStartAndContext.kt.after deleted file mode 100644 index d98bbae7882..00000000000 --- a/idea/testData/inspectionsLocal/coroutines/redundantAsync/withStartAndContext.kt.after +++ /dev/null @@ -1,9 +0,0 @@ -// WITH_RUNTIME - -package kotlinx.coroutines - -suspend fun test(ctx: CoroutineContext) { - coroutineScope { - withContext(ctx, CoroutineStart.LAZY) { 42 } - } -} \ No newline at end of file