mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] SuspiciousImplicitCoroutineScopeReceiverAccess: avoid endless loop
- when functional literal doesn't belong to any call ^KTIJ-39388 fixed (cherry picked from commit 0a4f356027659d7ad1370b2224daedc023c2cddb) IJ-CR-218907 GitOrigin-RevId: 440778a288dde343f88a6868cf0628586283bfc0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d1f0f05ba8
commit
16fc65741d
+1
-1
@@ -152,7 +152,7 @@ internal class SuspiciousImplicitCoroutineScopeReceiverAccessInspection :
|
||||
}
|
||||
|
||||
// Check if the matching parameter's return type is a suspend type
|
||||
val (functionSymbol, argumentSymbol) = getCallExpressionSymbol(current) ?: continue
|
||||
val (functionSymbol, argumentSymbol) = getCallExpressionSymbol(current) ?: return false
|
||||
// Resolve the outer call of the lambda
|
||||
val parameterType = argumentSymbol.returnType
|
||||
|
||||
|
||||
+5
@@ -16347,6 +16347,11 @@ public abstract class K2LocalInspectionTestGenerated extends AbstractK2LocalInsp
|
||||
runTest("testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/lambdaExtensionReceiver_withLabel_suspendWrapper.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("selectBuilderProperty.kt")
|
||||
public void testSelectBuilderProperty() throws Exception {
|
||||
runTest("testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/selectBuilderProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("selectExpression.kt")
|
||||
public void testSelectExpression() throws Exception {
|
||||
runTest("testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/selectExpression.kt");
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// WITH_COROUTINES
|
||||
// PROBLEM: none
|
||||
package test
|
||||
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.selects.SelectBuilder
|
||||
|
||||
fun CoroutineScope.doStuff() {}
|
||||
|
||||
suspend fun CoroutineScope.test() {
|
||||
val deferred = async { 42 }
|
||||
|
||||
val p: SelectBuilder<Unit>.() -> Unit = {
|
||||
deferred.onAwait {
|
||||
<caret>doStuff()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user