Hacker News new | ask | show | jobs
by kmkemp 2707 days ago
Unfortunately, the "new" keyword can override functionality.
1 comments

It cannot, really. It can only shadow the old declaration (and isn't even necessary). This means if you have Derived : Base with such a shadowed member, then code from the library that uses a Base cannot call your shadowing member. You can't really change behaviour that way, nor break anything, except for yourself.