Create a Trait (!)
Trait named: #TNoUsers
uses: {}
category: 'TTT'
browse this trait and choose "Remove ..." from Nautilus class pane.
A changes browser dialog appears and an Inform message:
"Information
Cannot remove top level class
when it has subclasses"
And you can perform the change anyway!
BTW the precondition rule in RBRemoveClassRefactoring is strange
for classes too, because it checks
aClass superclass notNil
if this rule does not applies:
aClass superclass = nil -> "Information: you cannot remove top level
classes"
?
This rule would only apply to ProtoObject :)
Now what happens if you try to delete a class that has subclasses?
The subclasses are automatically redefined with Object as superclass!
(15076 <https://pharo.fogbugz.com/default.asp?15076>
RBRemoveClassRefactoring slightly broken)