diff --git a/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java b/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java index b75649b2962..e646365173f 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java @@ -122,6 +122,7 @@ public class QuickFixes { JetIntentionActionFactory changeToPropertyNameFactory = ChangeToPropertyNameFix.createFactory(); factories.put(NO_BACKING_FIELD_ABSTRACT_PROPERTY, changeToPropertyNameFactory); factories.put(NO_BACKING_FIELD_CUSTOM_ACCESSORS, changeToPropertyNameFactory); + factories.put(INACCESSIBLE_BACKING_FIELD, changeToPropertyNameFactory); JetIntentionActionFactory unresolvedReferenceFactory = ImportClassAndFunFix.createFactory(); factories.put(UNRESOLVED_REFERENCE, unresolvedReferenceFactory); @@ -157,7 +158,6 @@ public class QuickFixes { actions.put(UNSAFE_CALL, ExclExclCallFix.introduceExclExclCall()); actions.put(UNNECESSARY_NOT_NULL_ASSERTION, ExclExclCallFix.removeExclExclCall()); - factories.put(UNSAFE_INFIX_CALL, ReplaceInfixCallFix.createFactory()); JetIntentionActionFactory removeProtectedModifierFactory = RemoveModifierFix.createRemoveModifierFromListOwnerFactory(PROTECTED_KEYWORD); factories.put(PACKAGE_MEMBER_CANNOT_BE_PROTECTED, removeProtectedModifierFactory); diff --git a/idea/testData/quickfix/variables/changeToPropertyName/afterInaccessibleBackingField.kt b/idea/testData/quickfix/variables/changeToPropertyName/afterInaccessibleBackingField.kt new file mode 100644 index 00000000000..a53e74f1388 --- /dev/null +++ b/idea/testData/quickfix/variables/changeToPropertyName/afterInaccessibleBackingField.kt @@ -0,0 +1,5 @@ +// "Change '$a' to 'a'" "true" +val a = 5 +class A { + val b = a +} \ No newline at end of file diff --git a/idea/testData/quickfix/variables/changeToPropertyName/afterInaccessibleBackingFieldQualified.kt b/idea/testData/quickfix/variables/changeToPropertyName/afterInaccessibleBackingFieldQualified.kt new file mode 100644 index 00000000000..f2d63c65187 --- /dev/null +++ b/idea/testData/quickfix/variables/changeToPropertyName/afterInaccessibleBackingFieldQualified.kt @@ -0,0 +1,6 @@ +// "Change '$a' to 'a'" "true" +package foo +val a = 5 +class A { + val b = foo.a +} \ No newline at end of file diff --git a/idea/testData/quickfix/variables/changeToPropertyName/beforeInaccessibleBackingField.kt b/idea/testData/quickfix/variables/changeToPropertyName/beforeInaccessibleBackingField.kt new file mode 100644 index 00000000000..9612356fc4d --- /dev/null +++ b/idea/testData/quickfix/variables/changeToPropertyName/beforeInaccessibleBackingField.kt @@ -0,0 +1,5 @@ +// "Change '$a' to 'a'" "true" +val a = 5 +class A { + val b = $a +} \ No newline at end of file diff --git a/idea/testData/quickfix/variables/changeToPropertyName/beforeInaccessibleBackingFieldQualified.kt b/idea/testData/quickfix/variables/changeToPropertyName/beforeInaccessibleBackingFieldQualified.kt new file mode 100644 index 00000000000..bee9f5aa95c --- /dev/null +++ b/idea/testData/quickfix/variables/changeToPropertyName/beforeInaccessibleBackingFieldQualified.kt @@ -0,0 +1,6 @@ +// "Change '$a' to 'a'" "true" +package foo +val a = 5 +class A { + val b = foo.$a +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java b/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java index 881b3335d25..0db217b6907 100644 --- a/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java @@ -860,6 +860,16 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { doTest("idea/testData/quickfix/variables/changeToPropertyName/beforeCustomAccessors.kt"); } + @TestMetadata("beforeInaccessibleBackingField.kt") + public void testInaccessibleBackingField() throws Exception { + doTest("idea/testData/quickfix/variables/changeToPropertyName/beforeInaccessibleBackingField.kt"); + } + + @TestMetadata("beforeInaccessibleBackingFieldQualified.kt") + public void testInaccessibleBackingFieldQualified() throws Exception { + doTest("idea/testData/quickfix/variables/changeToPropertyName/beforeInaccessibleBackingFieldQualified.kt"); + } + } public static Test innerSuite() {