pharo icon indicating copy to clipboard operation
pharo copied to clipboard

[RB] Revisit RBTemporaryToInstanceVariableTransformation

Open Ducasse opened this issue 2 years ago • 0 comments

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.

Ducasse avatar Jul 08 '23 16:07 Ducasse