-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opt-in when overriding a propery or method #12132
Comments
I think this might be #2000? |
Yes but no. Is not opt-in : "it is not an error to omit the override keyword from an overridden method." |
There was a lot of discussions about that.
|
This comment is not opt-in. Forces a method with override tag to be overriden if extended, or return error. And the I'm talking about something mid-way. Preventing the method from being overriden (like By the way, seeing the thread topic, I guess that is more appropriate to post there. PD: And found the only one post telling the same as me: #2000 (comment). Closing this. |
This, more than a proposal, is just a question to see what do you think on this, and maybe create a proposal just in case...
We have 2 classes, A and B extending A.
Now B can override methods and properties from A without noticing, leading to a problem if the override was by accident.
What if when you override, you have to opt-in by adding a decorator? So you will know that you are overriding something and act accordingly (Add the decorator to really override or change the property/method name).
There's already this: #8306 but I think that mine is a bit different.
The text was updated successfully, but these errors were encountered: