pharo
pharo copied to clipboard
[ Refactoring ] Clean architecture of RBTemporaryToInstanceVariableRefactoring
Once https://github.com/pharo-project/pharo/pull/18821/ is integrated we should fix the popup. We should not get a pop up in the refactoring.
TemporaryToInstanceVariableRefactoring >> preconditionNoSubclassDefinesVar [
^ RBCondition
withBlock: [ (class allSubclasses anySatisfy: [ :cls | cls definesInstanceVariable: temporaryVariableName asString ]) not ]
errorString:
('One or more subclasses of <1p> already defines an<n>instance variable with the same name. Proceed anyway?'
expandMacrosWith: class name)
When we call the refacorings in scripting mode we can get a warning and capturing the exception. Now in interactive mode the driver could do the same.
In this refactoring this method is called by the driver in #18821 so there is no pop up there :) I tried to have a clean architecture exactly like the Remove class refactoring, preconditions are handled like this too
If you agree we can close this issue then