pharo icon indicating copy to clipboard operation
pharo copied to clipboard

[RB] RBMoveTemporaryVariableDefinitionTransformation should define applicatbilityPreconditions

Open Ducasse opened this issue 3 months ago • 0 comments

RBMoveTemporaryVariableDefinitionTransformation >> buildTransformations

	"ifnil... tight blocks should not be returned as errors"
	blockNodes ifNil: [ self checkMethodForBlocks ].

	^ (OrderedCollection
		withAll: ((blockNodes
			sorted: [ :a :b | a start > b start ])
			collect: [ :blockNode |
				RBAddTemporaryVariableTransformation
					variable: variableName
					inInterval: blockNode body sourceInterval
					inMethod: selector
					inClass: class ]))
		add: (RBRemoveTemporaryVariableTransformation
					variable: variableName
					inMethod: selector
					inClass: class);
		yourself

and it should not include it in the buildTransformation

Ducasse avatar Nov 13 '25 19:11 Ducasse