Closed
Description
- Pharo 11
- create a method with a top comment like this:
foo: param
"Hello World"
param ifTrue:
[ Transcript show: 'Pharo rocks'.
Transcript show: 'Pharo rocks' ]
The system will show a critique like "Replace single branch conditional with guard clause" (last one at the bottom in screenshot)
Click on the button to "Automatically resolve the issue" and the system provides an automatic refactoring that transforms the code into the following code with an early return:
foo: param
param ifFalse: [ ^ self ].
Transcript show: 'Pharo rocks'.
Transcript show: 'Pharo rocks'
BUT IT ALSO REMOVED THE METHOD COMMENT WHICH IS A BUG