pharo icon indicating copy to clipboard operation
pharo copied to clipboard

[RB] RBAddTemporaryVariableTransformation get some precondition inside the transformation phase

Open Ducasse opened this issue 3 months ago • 0 comments

privateTransform

	| methodTree parseTree |
	methodTree := self definingMethod.
	parseTree := methodTree body.

	interval ifNotNil: [
		| nodeInInterval |
		nodeInInterval := methodTree bestNodeFor: interval.
		nodeInInterval isSequence ifTrue: [ parseTree := nodeInInterval ] ].

	self flag: #skippingPreconditions.
	(parseTree allTemporaryVariables includes: variableName) ifTrue: [ ^ self ].
	
	parseTree addTemporaryNamed: variableName.
	class compileTree: methodTree

and clearly (parseTree allTemporaryVariables includes: variableName) ifTrue: [ ^ self ]. should be done in applicability phase.

Ducasse avatar Nov 13 '25 18:11 Ducasse