- Notifications
You must be signed in to change notification settings - Fork13.2k
--noImplicitOverride#39669
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
--noImplicitOverride#39669
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Kingwl commentedJul 20, 2020
@typescript-bot run dt. |
typescript-bot commentedJul 20, 2020 • edited by orta
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by orta
Uh oh!
There was an error while loading.Please reload this page.
typescript-bot commentedJul 20, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
typescript-bot commentedJul 20, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hey@Kingwl, I've packed this intoan installable tgz. You can install it for testing by referencing it in your and then running There is also a playgroundfor this build. |
Kingwl commentedAug 19, 2020
Emmmm.... Need review and feedback |
Kingwl commentedAug 19, 2020
@typescript-bot pack this. |
typescript-bot commentedAug 19, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
typescript-bot commentedAug 19, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hey@Kingwl, I've packed this intoan installable tgz. You can install it for testing by referencing it in your and then running There is also a playgroundfor this build. |
Kingwl commentedAug 19, 2020
@typescript-bot pack this. |
DanielRosenwasser commentedMar 26, 2021
Yeah, I doubt we'll see anything significant, and I will likely merge if it's not too crazy seeing as we can optimize later. |
typescript-bot commentedMar 26, 2021
@DanielRosenwasser Here they are:Comparison Report - master..39669
System
Hosts
Scenarios
Developer Information: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Kingwl commentedMar 26, 2021
The benchmark looks good, at least with the option off. |
typescript-bot commentedMar 26, 2021
@DanielRosenwasser Here they are:Comparison Report - master..39669
System
Hosts
Scenarios
Developer Information: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Jack-Works commentedApr 7, 2021
Is this expected? For code classQ{y(){}}classTextendsQ{overridey(){}} The nightly playground emits the following JS code "use strict";classQ{y(){}}classTextendsQ{overridey(){}} which IMO is invalid. Is |
Kingwl commentedApr 7, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@Jack-Works Nope. Fixed in#43536. |
danfma commentedApr 23, 2021
The compiler is complaining about the missing override keyword for constructor declared properties but it doesn't allow using the modifier on the constructor too. |
andrewbranch commentedApr 23, 2021
@danfma can you give an example? |
danfma commentedApr 23, 2021
Kingwl commentedApr 24, 2021
Would we consider to add quickfix for parameter property or allow override in parameter property as@danfma said.😂 |
danfma commentedApr 24, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
By the way, this language feature fits me very well because I'm using an AST transformer to apply some Mobx decorators, and one of these modifiers is the “override” decorator! So, I can read the modifier and translate the code to what Mobx needs! Thus, thank you! 😬 |
andrewbranch commentedApr 26, 2021
@Kingwl I think we’re going to allow |
Kingwl commentedApr 26, 2021
Okay. Looking forward for the good news :XP |
jogibear9988 commentedMay 1, 2021
I've problems with static fields and override:#43916 |
SLaks commentedJun 8, 2021
What about methods that implement interface (as opposed to base class) members? |
Kingwl commentedJun 9, 2021
No plan yet. |
guilhermesimoes commentedSep 30, 2021
Is there a way to apply this to my entire projectexcept to classes that inherit from a particular class (like |
ekilah commentedJun 29, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Same question/need as@guilhermesimoes - getting errors on without a way to exclude these (either by name, e.g. I realize that the TS team is not likely to want to have React-specific things in its codebase, but I just wanted to bring more attention to a common pain point with this feature for a subset of your users :) Example errors for reference: ERRORinsrc/SomeComponent/index.tsx:22:3TS4114:Thismembermusthavean'override'modifierbecauseitoverridesamemberinthebaseclass'Component<IProps, IState, any>'.20|IState21|>{>22|state:IState={}|^^^^^23|24|render(){ERRORinsrc/SomeComponent/index.tsx:24:3TS4114:Thismembermusthavean'override'modifierbecauseitoverridesamemberinthebaseclass'Component<IProps, IState, any>'.22|state:IState={}23|>24|render(){|^^^^^^25|return( |

Uh oh!
There was an error while loading.Please reload this page.
Related#38905 ,#9034
Fixes#2000
This pr added the
overridekeyword to mark the class method is overrides a method in the base class.And a flag called
noImplicitOverrideand don't break something.Basically, If the flag turns on, We add the below check.
used without
noImplicitOverrideflag:ok but less checkIf a class member has override modifier and the container class does not extend any class:error
if a class member has override modifier and the name of the method is not existed in the base class:error
if a class member do not has override modifier and the name of the method is exited in the base class:error
properties arethe same as the method.
node in ambient context:not check.
must before accessibility modifier
cannot be used with the
declarestaticmodifier.cannot be used with a constructor.
Something needs to consider:
class declaration in Ambient context. Should we issue errors in the d.ts files?AsSuggestion Backlog Slog, 6/8/2016 #9034 said. Looks needn't.abstract method or abstract class:
eg:
eg: