diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/ReplacePutWithAssignmentInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/ReplacePutWithAssignmentInspection.kt index 12f04718ef9..7f6c93e2cbd 100644 --- a/idea/src/org/jetbrains/kotlin/idea/inspections/ReplacePutWithAssignmentInspection.kt +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/ReplacePutWithAssignmentInspection.kt @@ -38,6 +38,8 @@ class ReplacePutWithAssignmentInspection : AbstractApplicabilityBasedInspection< ) { override fun isApplicable(element: KtDotQualifiedExpression): Boolean { + if (element.receiverExpression is KtSuperExpression) return false + val callExpression = element.callExpression if (callExpression?.valueArguments?.size != 2) return false diff --git a/idea/testData/inspectionsLocal/replacePutWithAssignment/putOnSuper.kt b/idea/testData/inspectionsLocal/replacePutWithAssignment/putOnSuper.kt new file mode 100644 index 00000000000..a4541eace82 --- /dev/null +++ b/idea/testData/inspectionsLocal/replacePutWithAssignment/putOnSuper.kt @@ -0,0 +1,8 @@ +// PROBLEM: none +// RUNTIME_WITH_FULL_JDK + +class Test : java.util.LinkedHashMap() { + fun test() { + super.put("foo", "bar") + } +} \ 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 94c9a6d9b84..a78aad621af 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java @@ -5071,6 +5071,11 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest { runTest("idea/testData/inspectionsLocal/replacePutWithAssignment/putOnParameter.kt"); } + @TestMetadata("putOnSuper.kt") + public void testPutOnSuper() throws Exception { + runTest("idea/testData/inspectionsLocal/replacePutWithAssignment/putOnSuper.kt"); + } + @TestMetadata("putOnThis.kt") public void testPutOnThis() throws Exception { runTest("idea/testData/inspectionsLocal/replacePutWithAssignment/putOnThis.kt");