Safe Delete
Safe Delete removes a class, a function, a method or a field once it has checked that nothing uses it. Here Derived's doWork repeats Base's word for word, so EK9 refuses it - E11044, explained in the Hovers panel; Derived has doWork from Base without it. To play it in the IDE: Help > Lessons > Refactoring…, or ek9 -ide -lesson safe-delete.
Start from
The code the lesson starts from: copy it into a file of your own and follow the steps.
Fails with E11044: override method body is identical to super - remove the override
#!ek9 defines module error.e11044.bad defines class Base as open doWork() <- rtn as String: "working" Derived extends Base override doWork() <- rtn as String: "working"
Step 1: Where it is
Put the caret on doWork, on line 11.
Step 2: Safe Delete
Choose Refactor > Safe Delete…
Step 3: Preview and apply
The preview shows every change the refactoring makes; then the IDE formats each file it changed. Choose Apply.
The result
That is Safe Delete: Derived's doWork is gone, and Derived has Base's. Had anything still used what you deleted, the preview would have listed each place instead of offering Apply. It is on the right-click menu wherever the caret is on a declaration, and is Delete safely… on each entry of the Unused Code navigator; AI assistants use the ek9_safe_delete tool.
Where this lesson comes from
- The errors it fixes - each one's explanation offers this lesson: E11044.
- Answers -
ek9 -qand the IDE's Answers tab: 801. - For AI assistants - the MCP tool
ek9_safe_delete.



