-
Notifications
You must be signed in to change notification settings - Fork 12.8k
override
keyword not honored for methods of Object
on classes with no extends
, Object
super
members missing
#49224
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
Comments
This would be a breaking change for people who have a custom It seems like if you're explicit enough to be specifying that |
This doesn't necessarily require issuing an error on Really what I'm getting is that we should at least allow specifying
that might not be a bad idea. In the meantime though, an explicit |
Turning that from a boolean (must write, cannot write) to a tristate (must write, may write, cannot write) is a big can of worms. |
I forgot about the fact that |
how about another compiler option like |
Every JS programmer should know that Some people are importing classes from libraries, for example, and forking a library just to add What about an new option |
Bug Report
All classes without an
extends
clause implicitly extend fromObject
. However theoverride
keyword does not work when overriding members ofObject
, and I believe it should for consistency, semantics, and display of developer intent.Furthermore, TypeScript chooses to hide
super
members ofObject
, and the following valid JavaScript has an unexpected type error:The class is implicitly derived (from
Object
), andsuper.toString
exists.🔎 Search Terms
🕗 Version & Regression Information
I don't think it ever worked?
⏯ Playground Link
Playground link with relevant code
Playground link with relevant code
🙁 Actual behavior
No type information is present for inherited
Object
members inside a class withoutextends
.Possibly related: even on any plain object like a POJO, intellisense in VS Code does not show helpful autocompletion for
Object
members.🙂 Expected behavior
It should show the full picture, because it is valid JavaScript.
The text was updated successfully, but these errors were encountered: