-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Remove restriction of properties overriding prototype methods #6154
Comments
Pinging @bterlson to make sure we're not forgetting some weird edge case before simply removing this error |
I can't think of why this should be an error (it isn't with ES classes + class property declarations proposal, either). |
@RyanCavanaugh, maybe the reason was because it is a bit dangerous to use them in the constructor itself? If they where both methods it worked as expected but with the base a method and the derived a property the results are different.
|
I'd call it mildly surprising, relative to what people's random expectations of initialization order seem to be 😉 |
I can have a look at this one, as my first issue :) |
…ed class (#24343) * Fix to issue 6154 - Overriding a method with a property in the derived class should not cause a compiler error * new baselines * fixed deleted baselines
We currently enforce this rule:
This breaks two real scenarios:
foo
as an arrow function because you have some unbound callers that your base class didn'tThe reverse case is important to continue to enforce, but no one can remember why we have this rule.
The text was updated successfully, but these errors were encountered: