rbs
rbs copied to clipboard
Add support for `undef`
Quite a few things in the standard library (and a few of my personal projects) undefine methods from parent classes (for example, Class inherits from Module but undefs refine and module_function). Having syntax for it would be helpful.
Hmm. The syntax would be something like:
class Class
undef refine
undef self.module_function # Example for singleton method
end
And we can implement it by removing the entry from Definition#methods or adding a special entry.
The way ruby does it is it actually creates a new method in the class, but gives it the "UNDEF" visibility. We could try something similar
A concern is that undefs actively break polymorphism, though this would be Ruby’s issue, not RBS’s.