Introduce "remove actual" fix for ACTUAL_WITHOUT_EXPECT

Related to KT-25044
This commit is contained in:
Mikhail Glukhikh
2018-08-08 12:19:56 +03:00
parent a91442cd3b
commit ed5791ed9e
6 changed files with 36 additions and 0 deletions
@@ -507,6 +507,7 @@ class QuickFixRegistrar : QuickFixContributor {
OVERLOADS_LOCAL.registerFactory(RemoveAnnotationFix.JvmOverloads)
OVERLOADS_WITHOUT_DEFAULT_ARGUMENTS.registerFactory(RemoveAnnotationFix.JvmOverloads)
ACTUAL_WITHOUT_EXPECT.registerFactory(RemoveModifierFix.createRemoveModifierFromListOwnerFactory(ACTUAL_KEYWORD))
NO_ACTUAL_FOR_EXPECT.registerFactory(CreateActualFix)
NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS.registerFactory(AddActualFix)
@@ -0,0 +1,5 @@
expect interface ExpInterface {
fun first()
}
expect class ExpImpl : ExpInterface { }
@@ -0,0 +1,5 @@
expect interface ExpInterface {
fun first()
}
expect class ExpImpl : ExpInterface { }
@@ -0,0 +1,10 @@
// "Remove 'actual' modifier" "true"
// ERROR: Actual function 'first' has no corresponding expected declaration
actual interface ExpInterface {
actual fun first()
}
actual class ExpImpl : ExpInterface {
actual override fun <caret>first() { }
}
@@ -0,0 +1,10 @@
// "Remove 'actual' modifier" "true"
// ERROR: Actual function 'first' has no corresponding expected declaration
actual interface ExpInterface {
actual fun first()
}
actual class ExpImpl : ExpInterface {
override fun first() { }
}
@@ -30,6 +30,11 @@ public class QuickFixMultiModuleTestGenerated extends AbstractQuickFixMultiModul
runTest("idea/testData/multiModuleQuickFix/abstract/");
}
@TestMetadata("actualWithoutExpect")
public void testActualWithoutExpect() throws Exception {
runTest("idea/testData/multiModuleQuickFix/actualWithoutExpect/");
}
@TestMetadata("addActualToClass")
public void testAddActualToClass() throws Exception {
runTest("idea/testData/multiModuleQuickFix/addActualToClass/");