Skip to content

Commit

Permalink
Added quickfix for VAR_OVERRIDDEN_BY_VAL.
Browse files Browse the repository at this point in the history
  • Loading branch information
univerio authored and abreslav committed Feb 13, 2013
1 parent 7231606 commit a5cecd6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ private QuickFixes() {}
ChangeVariableMutabilityFix changeVariableMutabilityFix = new ChangeVariableMutabilityFix();
actions.put(VAL_WITH_SETTER, changeVariableMutabilityFix);
actions.put(VAL_REASSIGNMENT, changeVariableMutabilityFix);
actions.put(VAR_OVERRIDDEN_BY_VAL, changeVariableMutabilityFix);

actions.put(UNNECESSARY_SAFE_CALL, ReplaceCallFix.toDotCallFromSafeCall());
actions.put(UNSAFE_CALL, ReplaceCallFix.toSafeCall());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// "Make variable mutable" "true"
open class A {
open var x = 42;
}

class B : A() {
override var x: Int = 3;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// "Make variable mutable" "true"
open class A {
open var x = 42;
}

class B : A() {
override val<caret> x: Int = 3;
}
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,11 @@ public void testAllFilesPresentInChangeMutability() throws Exception {
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")
public void testValReassignmentLocal() throws Exception {
doTest("idea/testData/quickfix/variables/changeMutability/beforeValReassignmentLocal.kt");
Expand Down

0 comments on commit a5cecd6

Please sign in to comment.