diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/RedundantSuspendModifierInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/RedundantSuspendModifierInspection.kt index ad2a3675204..0006ce97a2f 100644 --- a/idea/src/org/jetbrains/kotlin/idea/inspections/RedundantSuspendModifierInspection.kt +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/RedundantSuspendModifierInspection.kt @@ -33,7 +33,7 @@ class RedundantSuspendModifierInspection : AbstractKotlinInspection() { val suspendModifier = function.modifierList?.getModifier(KtTokens.SUSPEND_KEYWORD) ?: return if (!function.hasBody()) return - if (function.hasModifier(KtTokens.OVERRIDE_KEYWORD)) return + if (function.hasModifier(KtTokens.OVERRIDE_KEYWORD) || function.hasModifier(KtTokens.ACTUAL_KEYWORD)) return val context = function.analyzeWithContent() val descriptor = context[BindingContext.FUNCTION, function] ?: return diff --git a/idea/testData/inspectionsLocal/redundantSuspend/actual.kt b/idea/testData/inspectionsLocal/redundantSuspend/actual.kt new file mode 100644 index 00000000000..0d0e18b34fb --- /dev/null +++ b/idea/testData/inspectionsLocal/redundantSuspend/actual.kt @@ -0,0 +1,6 @@ +// PROBLEM: none +// DISABLE-ERRORS +expect suspend fun a() + +actual suspend fun a() { +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java index 930d4beb2bb..2c28d84d923 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java @@ -8327,6 +8327,11 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest { KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); } + @TestMetadata("actual.kt") + public void testActual() throws Exception { + runTest("idea/testData/inspectionsLocal/redundantSuspend/actual.kt"); + } + public void testAllFilesPresentInRedundantSuspend() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/inspectionsLocal/redundantSuspend"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), null, true); }