"Convert put to assignment": don't report on 'super' #KT-27146 Fixed

This commit is contained in:
Toshiaki Kameyama
2018-09-28 23:54:36 +09:00
committed by Mikhail Glukhikh
parent b611facd71
commit d89947bd5a
3 changed files with 15 additions and 0 deletions
@@ -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
@@ -0,0 +1,8 @@
// PROBLEM: none
// RUNTIME_WITH_FULL_JDK
class Test : java.util.LinkedHashMap<String, String>() {
fun test() {
super.<caret>put("foo", "bar")
}
}
@@ -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");