From dc44eb9fa6aa923e618c9a3e8a5dd6e4cba24f64 Mon Sep 17 00:00:00 2001 From: Roman Golyshev Date: Fri, 17 Jul 2026 20:00:57 +0000 Subject: [PATCH] KTIJ-39388 [kotlin] Clean up SuspiciousImplicitCoroutineScopeReceiverAccess Java test data Test-data only; no change to inspection behavior. See comments in https://jetbrains.team/p/ij/reviews/210957/timeline M-Session-Id: M-332dcc36-6a77-4542-b67a-8a34c99a3792 (cherry picked from commit 00bceb41f57bd94ab3cf9a9ca7401828bd69ef4f) IJ-CR-218907 GitOrigin-RevId: 725bc198f6744e509d7f98b61637a24717e6bb56 --- ...xtensionReceiver_suspendWrapper_suspendFunInterface.kt | 4 ++-- ...onReceiver_suspendWrapper_suspendFunInterface.kt.after | 4 ++-- ...Receiver_suspendWrapper_suspendFunInterfaceJava.1.java | 8 ++++---- ...sionReceiver_suspendWrapper_suspendFunInterfaceJava.kt | 2 +- ...dWrapper_suspendFunInterface_explicitSamConstructor.kt | 6 +++--- ...er_suspendFunInterface_explicitSamConstructor.kt.after | 6 +++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterface.kt b/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterface.kt index f44aae041e61..6af2750db8a0 100644 --- a/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterface.kt +++ b/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterface.kt @@ -5,11 +5,11 @@ package test import kotlinx.coroutines.CoroutineScope -fun interface CustomSuspendLambda { +fun interface CustomSuspendAction { suspend fun customInvoke(): Unit } -private suspend fun suspendWrapper(action: CustomSuspendLambda) { +private suspend fun suspendWrapper(action: CustomSuspendAction) { action.customInvoke() } diff --git a/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterface.kt.after b/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterface.kt.after index 72ab31a3a8dd..fa20d6d6d04d 100644 --- a/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterface.kt.after +++ b/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterface.kt.after @@ -5,11 +5,11 @@ package test import kotlinx.coroutines.CoroutineScope -fun interface CustomSuspendLambda { +fun interface CustomSuspendAction { suspend fun customInvoke(): Unit } -private suspend fun suspendWrapper(action: CustomSuspendLambda) { +private suspend fun suspendWrapper(action: CustomSuspendAction) { action.customInvoke() } diff --git a/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterfaceJava.1.java b/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterfaceJava.1.java index c21aa947d45b..b016dda7be2f 100644 --- a/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterfaceJava.1.java +++ b/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterfaceJava.1.java @@ -1,13 +1,13 @@ -package test +package test; -import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.CoroutineScope; -interface CustomSuspendLambda { +interface CustomAction { void customInvoke(); } class Main { - static void suspendWrapper(CustomSuspendLambda action) { + static void javaStaticWrapper(CustomAction action) { action.customInvoke(); } } \ No newline at end of file diff --git a/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterfaceJava.kt b/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterfaceJava.kt index 9313c4539b21..1d21355fb528 100644 --- a/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterfaceJava.kt +++ b/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterfaceJava.kt @@ -8,7 +8,7 @@ import kotlinx.coroutines.CoroutineScope fun CoroutineScope.doStuff() {} suspend fun CoroutineScope.test() { - Main.suspendWrapper { + Main.javaStaticWrapper { doStuff() } } \ No newline at end of file diff --git a/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterface_explicitSamConstructor.kt b/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterface_explicitSamConstructor.kt index a1bb9fe8f8ca..d062f19ade79 100644 --- a/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterface_explicitSamConstructor.kt +++ b/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterface_explicitSamConstructor.kt @@ -5,18 +5,18 @@ package test import kotlinx.coroutines.CoroutineScope -fun interface CustomSuspendLambda { +fun interface CustomSuspendAction { suspend fun customInvoke(): Unit } -private suspend fun suspendWrapper(action: CustomSuspendLambda) { +private suspend fun suspendWrapper(action: CustomSuspendAction) { action.customInvoke() } fun CoroutineScope.doStuff() {} suspend fun CoroutineScope.test() { - suspendWrapper(CustomSuspendLambda { + suspendWrapper(CustomSuspendAction { doStuff() }) } \ No newline at end of file diff --git a/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterface_explicitSamConstructor.kt.after b/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterface_explicitSamConstructor.kt.after index 66f64b1f7e07..fce01261e37c 100644 --- a/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterface_explicitSamConstructor.kt.after +++ b/plugins/kotlin/code-insight/inspections-k2/tests/testData/inspectionsLocal/coroutines/ambiguousCoroutineScope/functionExtensionReceiver_suspendWrapper_suspendFunInterface_explicitSamConstructor.kt.after @@ -5,18 +5,18 @@ package test import kotlinx.coroutines.CoroutineScope -fun interface CustomSuspendLambda { +fun interface CustomSuspendAction { suspend fun customInvoke(): Unit } -private suspend fun suspendWrapper(action: CustomSuspendLambda) { +private suspend fun suspendWrapper(action: CustomSuspendAction) { action.customInvoke() } fun CoroutineScope.doStuff() {} suspend fun CoroutineScope.test() { - suspendWrapper(CustomSuspendLambda { + suspendWrapper(CustomSuspendAction { this@test.doStuff() }) } \ No newline at end of file