pharo icon indicating copy to clipboard operation
pharo copied to clipboard

Strange rule: initialize used in accessing related rule

Open Ducasse opened this issue 10 months ago • 1 comments

I got the following rule violation for initialize and it does not make sense.

Capture 2024-04-24 at 21 13 17

Ducasse avatar Apr 24 '24 19:04 Ducasse

I guess this happens anytime you put a method with an unary selector that does not return anything into the "accessing" category.

Maybe the idea behind this critique was that "accessing" typically hosts getters (unary) and setter methods (keyword) and laments when the getter forgets a return. So it looks at the #initialize when it is in "accessing" protocol as a kind of getter method as it is also unary. So it gives the warning that you might have forgotten the return for the getter.

image

astares avatar Apr 24 '24 20:04 astares