Added quickfix for VAR_OVERRIDDEN_BY_VAL.
This commit is contained in:
committed by
Andrey Breslav
parent
7231606eb2
commit
a5cecd6048
@@ -144,6 +144,7 @@ public class QuickFixes {
|
|||||||
ChangeVariableMutabilityFix changeVariableMutabilityFix = new ChangeVariableMutabilityFix();
|
ChangeVariableMutabilityFix changeVariableMutabilityFix = new ChangeVariableMutabilityFix();
|
||||||
actions.put(VAL_WITH_SETTER, changeVariableMutabilityFix);
|
actions.put(VAL_WITH_SETTER, changeVariableMutabilityFix);
|
||||||
actions.put(VAL_REASSIGNMENT, changeVariableMutabilityFix);
|
actions.put(VAL_REASSIGNMENT, changeVariableMutabilityFix);
|
||||||
|
actions.put(VAR_OVERRIDDEN_BY_VAL, changeVariableMutabilityFix);
|
||||||
|
|
||||||
actions.put(UNNECESSARY_SAFE_CALL, ReplaceCallFix.toDotCallFromSafeCall());
|
actions.put(UNNECESSARY_SAFE_CALL, ReplaceCallFix.toDotCallFromSafeCall());
|
||||||
actions.put(UNSAFE_CALL, ReplaceCallFix.toSafeCall());
|
actions.put(UNSAFE_CALL, ReplaceCallFix.toSafeCall());
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
// "Make variable mutable" "true"
|
||||||
|
open class A {
|
||||||
|
open var x = 42;
|
||||||
|
}
|
||||||
|
|
||||||
|
class B : A() {
|
||||||
|
override var x: Int = 3;
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
// "Make variable mutable" "true"
|
||||||
|
open class A {
|
||||||
|
open var x = 42;
|
||||||
|
}
|
||||||
|
|
||||||
|
class B : A() {
|
||||||
|
override val<caret> x: Int = 3;
|
||||||
|
}
|
||||||
@@ -746,6 +746,11 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest {
|
|||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/variables/changeMutability"), Pattern.compile("^before(\\w+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/variables/changeMutability"), Pattern.compile("^before(\\w+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("beforeValOverrideVar.kt")
|
||||||
|
public void testValOverrideVar() throws Exception {
|
||||||
|
doTest("idea/testData/quickfix/variables/changeMutability/beforeValOverrideVar.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("beforeValReassignmentLocal.kt")
|
@TestMetadata("beforeValReassignmentLocal.kt")
|
||||||
public void testValReassignmentLocal() throws Exception {
|
public void testValReassignmentLocal() throws Exception {
|
||||||
doTest("idea/testData/quickfix/variables/changeMutability/beforeValReassignmentLocal.kt");
|
doTest("idea/testData/quickfix/variables/changeMutability/beforeValReassignmentLocal.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user