pharo icon indicating copy to clipboard operation
pharo copied to clipboard

[Refactoring-UI] Push down should clearly state that we can lose a method

Open JanBliznicenko opened this issue 9 months ago • 1 comments

When doing push down on a method that exists in the subclass, the method in the superclass is simply removed without explicitly stating that this is something abnormal. This behavior is quite unexpected and it should show a warning similar to situations like when renaming to a selector that already exists and similar.

Steps to reproduce:

  1. Create a method with code abc ^ 1 in any class that has a subclass
  2. Create a method with code abc ^ 2 in its direct subclass
  3. Right click the 'abc' method in the superclass (the one that returns 1)
  4. Refactorings
  5. Push down
  6. Refactor
  7. Notice how it only offers to remove the method in the superclass without creating or changing anything else
  8. Ok

The method from the superclass was removed without anything warning that the push down does not actually happen because the method exists in one of the subclasses. Removing the method might be one of the possible resolutions of the conflict, but the user should be informed about the conflict and ideally should be able to choose what to do (replace the one in the subclass, remove the one from superclass, do nothing?)

JanBliznicenko avatar May 27 '25 16:05 JanBliznicenko

Thanks for this bug report.

Ducasse avatar Jun 02 '25 08:06 Ducasse

We should not lose method so this is a bug.

Ducasse avatar Jun 28 '25 07:06 Ducasse