CreateExpect: add actual modifier to original class if needed

This commit is contained in:
Dmitry Gridin
2019-08-21 17:27:19 +07:00
parent 73ae993d81
commit 4ed56908af
@@ -159,10 +159,8 @@ class CreateExpectedClassFix(
} else
selectedElements
if (originalElements.isNotEmpty()) {
project.executeWriteCommand("Repair actual members") {
repairActualModifiers(originalElements, resultDeclarations.toSet())
}
project.executeWriteCommand("Repair actual members") {
repairActualModifiers(originalElements + klass, resultDeclarations.toSet())
}
generateClassOrObject(project, true, element, checker, listOfNotNull(outerExpectedClass))
@@ -271,7 +269,7 @@ private fun repairActualModifiers(
originalElements: Collection<KtNamedDeclaration>,
selectedElements: Collection<KtNamedDeclaration>
) {
if (originalElements == selectedElements)
if (originalElements.size == selectedElements.size)
for (original in originalElements) {
original.makeActualWithParents()
}