-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Disallow inheritance from ProgressBar #20487
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
[Console] Disallow inheritance from ProgressBar #20487
Conversation
Can you explain your use-case when you need to inherit the |
the right fix would be to re-bind the closure explicitly to the right class instead. Switching to protected makes the method accessible (and overwritable) in child class, and so impacts the API covered by BC, which is a no-go. |
If it doesn't work right now, it won't be a BC break to finalize the class. It just depends on use-cases. |
@unkind indeed it is not a bc break, but it will add stuff to maintain because of sf's bc policy which is avoided when possible. |
|
@unkind I performed some experiments, but my ideas didn't work because of this issue with inheritance. So, at the end I have no real use case, because I went with another approach. However, my point is: either |
@unkind of course sorry, I didn't understand well what you meant. I agree with you and I think we should consider make more classes |
So do I understand correctly that extended the class does only work as long as you do not call the |
@xabbuh yes |
In this case declaring the class as |
BC Promise disallows to make classes final. ping @nicolas-grekas, @fabpot |
Does it always throw? This would mean nobody could have extended the class, so making it final would be safe. |
@nicolas-grekas yes, it throws always. |
#20493 was only needed in case we considered this change as a bc break. As we don't, you can just directly make the class |
@unkind, @GuilhemN thank you for explanation. |
Thank you @a-ast. |
Changed
ProgressBar
tofinal
, fixed tests.As explained below, this modification doesn't break BC because inheritance from
ProgressBar
was not possible anyway.See: #20427