pharo icon indicating copy to clipboard operation
pharo copied to clipboard

Sloppy bestNodeFor: return value and not assignment

Open Ducasse opened this issue 1 year ago • 0 comments

testBestNodeForReturnAStatementWhenIntervalInStatementWithoutLeftPart
	| ast start body |
	body := 
	'm
		| a |
		a := 1111111111111111.
		'.
	
	start := 'm
		| a |
		' size.
		
	ast := (RBParser parseMethod: body) bestNodeFor: (start + 2 to: start + 6).
	self assert: ast isAssignment.
	self assert: ast sourceCode equals: '1111111111111111'

shows that placing the caret just before the : in a := 1111111111111111. returns the value and not the assignment

Ducasse avatar Oct 07 '24 19:10 Ducasse