Repository navigation
Add "virtual" and "override" keywords for methods #1524
Copy link
Copy link
Closed
Labels
DeclinedThe issue was declined as something which matches the TypeScript visionThe issue was declined as something which matches the TypeScript visionSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
Activity
- changed the title
[-][Suggestion] Add "virtual" and "override" to make the function marked as "overridable"[/-][+]Add "virtual" and "override" keywords for methods[/+]on Dec 17, 2014 - addedSuggestionAn idea for TypeScriptAn idea for TypeScript
on Dec 17, 2014 - addedDeclinedThe issue was declined as something which matches the TypeScript visionThe issue was declined as something which matches the TypeScript vision
on Dec 17, 2014 RyanCavanaugh commented
on Dec 17, 2014 MemberMore actionsThis would be a breaking change as methods are 'virtual' by default.
it's not even clear what a non-virtual method would mean in JavaScript - there is no such thing as a non-virtual call.
- ghost changed the title
[-]Add "virtual" and "override" keywords for methods[/-][+]Add "sealed" key word to mark some public/protected methods not be overriden[/+]on Dec 18, 2014 - ghost changed the title
[-]Add "sealed" key word to mark some public/protected methods not be overriden[/-][+][Suggestion] Add "sealed" key word to mark some public/protected methods not be overriden[/+]on Dec 18, 2014 RyanCavanaugh commented
on Dec 18, 2014 MemberMore actionsCan you un-edit the title and log a new issue to track that suggestion? Thanks!
- changed the title
[-][Suggestion] Add "sealed" key word to mark some public/protected methods not be overriden[/-][+]Add "virtual" and "override" keywords for methods[/+]on Dec 18, 2014 this may be a superfluous suggestion, but maybe one idea, for purely syntactic sugar keyword that maybe wouldn't break anything, is just allow you to have the override keyword after a function, to make it clear that is overriding a specific function?
Reacted by Bruno Brant, D Bullock and cbchenowethRyanCavanaugh commented
on Aug 16, 2017 MemberMore actionsReacted by Nate Gates@MaleDong #2000 is open, the suggestion is that is the only thing that is being considered and you should add any thoughts to that issue.
Reacted by Nate Gates- locked and limited conversation to collaborators
on Jun 18, 2018
Metadata
Metadata
Assignees
Labels
DeclinedThe issue was declined as something which matches the TypeScript visionThe issue was declined as something which matches the TypeScript visionSuggestionAn idea for TypeScriptAn idea for TypeScript
I know that my suggestion (as what you see above in the title) is something (not a must)……Well, however, it would be nice if we can use this "syntax suger" to make TypeScript "more professional", the wrapper of js. Those without the "virtual" cannot be overridden. And when you type something like "override", it will offer you functions that can be overridden.
Thanks anyway!