"Convert put to assignment": don't report on 'super' #KT-27146 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
b611facd71
commit
d89947bd5a
@@ -38,6 +38,8 @@ class ReplacePutWithAssignmentInspection : AbstractApplicabilityBasedInspection<
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
override fun isApplicable(element: KtDotQualifiedExpression): Boolean {
|
override fun isApplicable(element: KtDotQualifiedExpression): Boolean {
|
||||||
|
if (element.receiverExpression is KtSuperExpression) return false
|
||||||
|
|
||||||
val callExpression = element.callExpression
|
val callExpression = element.callExpression
|
||||||
if (callExpression?.valueArguments?.size != 2) return false
|
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")
|
||||||
|
}
|
||||||
|
}
|
||||||
+5
@@ -5071,6 +5071,11 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest {
|
|||||||
runTest("idea/testData/inspectionsLocal/replacePutWithAssignment/putOnParameter.kt");
|
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")
|
@TestMetadata("putOnThis.kt")
|
||||||
public void testPutOnThis() throws Exception {
|
public void testPutOnThis() throws Exception {
|
||||||
runTest("idea/testData/inspectionsLocal/replacePutWithAssignment/putOnThis.kt");
|
runTest("idea/testData/inspectionsLocal/replacePutWithAssignment/putOnThis.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user