pharo
pharo copied to clipboard
[RB] Revisit RBTemporaryToInstanceVariableTransformation
It contains the following condition that we tagged as breaking changes but this is not that clear
(RBCondition withBlock: [
(class allSubclasses anySatisfy:
[ :cls | cls definesInstanceVariable: temporaryVariableName asString ])
ifTrue: [ self refactoringWarning:
('One or more subclasses of <1p> already defines an<n>instance variable with the same name. Proceed anyway?' expandMacrosWith: class name) ].
true ])
Indeed if a subclass defines an instance variable with the same name than the variable to be promoted it will break the invariant that we cannot have twice the same instance variable in a hierarchy. So to me it means that the proceed anyway cannot work.