GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — --noImplicitOverride by Kingwl · Pull Request #39669 · microsoft/TypeScript

Conversation

@Kingwl

@Kingwl Wenlu Wang (Kingwl) commented Jul 20, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Related #38905 , #9034
Fixes #2000

This pr added the override keyword to mark the class method is overrides a method in the base class.
And a flag called noImplicitOverride and don't break something.

Basically, If the flag turns on, We add the below check.

  1. used without noImplicitOverride flag: ok but less check

  2. If a class member has override modifier and the container class does not extend any class: error

  3. if a class member has override modifier and the name of the method is not existed in the base class: error

  4. if a class member do not has override modifier and the name of the method is exited in the base class: error

  5. properties are the same as the method.

  6. node in ambient context: not check.

  7. must before accessibility modifier

  8. cannot be used with the declare static modifier.

  9. cannot be used with a constructor.

Something needs to consider:

  1. class declaration in Ambient context. Should we issue errors in the d.ts files? As Suggestion Backlog Slog, 6/8/2016 #9034 said. Looks needn't.

  2. abstract method or abstract class:

eg:

abstract class AB {
    abstract foo(v: string): void;

    abstract bar(v: string): void
}

abstract class AD1 extends AB {

}

abstract class AD2 extends AB {
    abstract foo(v: ''): void // need override?
}

abstract class AD3 extends AB {
    override foo(v: ''): void { } // need override?
    abstract bar(): void; // need override?
}

class D4 extends AB {
    override foo(v: ''): void {}
    override bar(v: ''): void {}
}
  1. property in constructor parameters:

eg:

class B {
    public baz: number = 1;
    constructor(public foo: string, public bar: number) {

    }
}

class D extends B {
    override public bar: number = 1

    // override required ?
    constructor(public foo: string, public baz: number) {
        super(foo, 42)
    }
}

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

alexrock, ifiokjr, rowbotman, InExtremaRes, Dionis-mgn, soncodi, cherryblossom000, J-Fields, dested, intellild, and 54 more reacted with thumbs up emoji achimmihca, likern, c9r, Trass3r, krozner, kirillgroshkov, Basssiiie, celian-rib, mass10, kaznovac, and 4 more reacted with heart emoji mass10, kaznovac, jonlepage, Enteleform, and LittleIronMan reacted with rocket emoji Jack-Works, mass10, kirillgroshkov, and celian-rib reacted with eyes emoji
All reactions
  • 👍 64 reactions
  • ❤️ 14 reactions
  • 🚀 5 reactions
  • 👀 4 reactions
Wenlu Wang (Kingwl) added 6 commits July 15, 2020 22:45
@Kingwl
wip: add types
8b90b8d
@Kingwl
wip
ea5608a
@Kingwl
Add cases
9371d87
@Kingwl
Add some case
6cb7f5e
@Kingwl
Add more check
061cd27
@Kingwl
accept baseline
37ada55
@Kingwl

Wenlu Wang (Kingwl) commented Jul 20, 2020

Copy link
Copy Markdown
Contributor Author

TypeScript Bot (@typescript-bot) run dt.
TypeScript Bot (@typescript-bot) pack this.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Jul 20, 2020 •
edited by orta
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

The TypeScript team has xxyy

Heya Wenlu Wang (@Kingwl), I've started to run the tarball bundle task on this PR at 37ada55. You can monitor the build here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Jul 20, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Heya Wenlu Wang (@Kingwl), I've started to run the parallelized Definitely Typed test suite on this PR at 37ada55. You can monitor the build here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Kingwl
add abstract abd declare method
6401e1a
@typescript-bot

TypeScript Bot (typescript-bot) commented Jul 20, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Hey Wenlu Wang (@Kingwl), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/80234/artifacts?artifactName=tgz&fileId=24EB196251C0700ECE50C8E4EF36FFE41ECC147DC5822099E673D2E05A67AFE302&fileName=/typescript-4.0.0-insiders.20200720.tgz"
    }
}

and then running npm install.


There is also a playground for this build.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Wenlu Wang (Kingwl) added 2 commits July 20, 2020 20:47
@Kingwl
add override in declaration
be00363
@Kingwl
accept baseline
fbb6e28
@typescript-bot TypeScript Bot (typescript-bot) added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jul 21, 2020
Wenlu Wang (Kingwl) added 7 commits July 21, 2020 15:04
@Kingwl
add property override
6014a3a
@Kingwl
Fix decalre modifier
a65df91
@Kingwl
update baseline
43d9f70
@Kingwl
Add more cases
e73c941
@Kingwl
make lint happy
c0edf6f
@Kingwl
make lint happy
dca93ac
@Kingwl
Update description
2fd560a
@Kingwl
Wenlu Wang (Kingwl) marked this pull request as ready for review August 19, 2020 03:04
@Kingwl

Wenlu Wang (Kingwl) commented Aug 19, 2020

Copy link
Copy Markdown
Contributor Author

Emmmm.... Need review and feedback

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Kingwl

Wenlu Wang (Kingwl) commented Aug 19, 2020

Copy link
Copy Markdown
Contributor Author

TypeScript Bot (@typescript-bot) pack this.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Aug 19, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Heya Wenlu Wang (@Kingwl), I've started to run the tarball bundle task on this PR at 2fd560a. You can monitor the build here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Aug 19, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Hey Wenlu Wang (@Kingwl), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/82712/artifacts?artifactName=tgz&fileId=F20A5C267D30CCAF558DD8B90945444BF1ECAF2C9D1D3EF7D1AECB09BA31230402&fileName=/typescript-4.1.0-insiders.20200819.tgz"
    }
}

and then running npm install.


There is also a playground for this build.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Wenlu Wang (Kingwl) added 3 commits August 19, 2020 17:49
@Kingwl
Add codefix
94187c7
@Kingwl
simplify code
2b57fbd
@Kingwl
Merge branch 'master' into exprement-override
3a2286b
@Kingwl

Wenlu Wang (Kingwl) commented Aug 19, 2020

Copy link
Copy Markdown
Contributor Author

TypeScript Bot (@typescript-bot) pack this.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@DanielRosenwasser

Daniel Rosenwasser (DanielRosenwasser) commented Mar 26, 2021

Copy link
Copy Markdown
Member

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.

Kingwl, whzx5byb, alex-okrushko, Basssiiie, a11delavar, felixhirt, and v1rtl reacted with hooray emoji Kingwl, a11delavar, and v1rtl reacted with heart emoji Kingwl, alexrock, a11delavar, and v1rtl reacted with rocket emoji Kingwl, a11delavar, and v1rtl reacted with eyes emoji
All reactions
  • 🎉 7 reactions
  • ❤️ 3 reactions
  • 🚀 4 reactions
  • 👀 3 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Mar 26, 2021

Copy link
Copy Markdown
Contributor

Daniel Rosenwasser (@DanielRosenwasser)
The results of the perf run you requested are in!

Here they are:

Comparison Report - master..39669

Metric master 39669 Delta Best Worst
Angular - node (v14.15.1, x64)
Memory used 321,274k (± 0.01%) 321,290k (± 0.01%) +16k (+ 0.01%) 321,215k 321,438k
Parse Time 1.93s (± 0.43%) 1.93s (± 0.61%) -0.00s (- 0.21%) 1.91s 1.96s
Bind Time 0.86s (± 0.57%) 0.85s (± 0.80%) -0.01s (- 1.04%) 0.84s 0.87s
Check Time 5.01s (± 0.46%) 5.01s (± 0.37%) +0.01s (+ 0.14%) 4.96s 5.05s
Emit Time 6.33s (± 0.48%) 6.35s (± 0.63%) +0.03s (+ 0.43%) 6.26s 6.44s
Total Time 14.13s (± 0.28%) 14.15s (± 0.33%) +0.02s (+ 0.12%) 14.07s 14.29s
Compiler-Unions - node (v14.15.1, x64)
Memory used 189,310k (± 0.01%) 189,355k (± 0.01%) +45k (+ 0.02%) 189,314k 189,397k
Parse Time 0.80s (± 0.69%) 0.80s (± 0.87%) -0.00s (- 0.12%) 0.79s 0.82s
Bind Time 0.56s (± 0.40%) 0.56s (± 0.67%) -0.01s (- 1.07%) 0.55s 0.56s
Check Time 7.07s (± 0.59%) 7.03s (± 0.62%) -0.04s (- 0.62%) 6.95s 7.14s
Emit Time 2.54s (± 0.52%) 2.54s (± 0.89%) +0.00s (+ 0.08%) 2.50s 2.60s
Total Time 10.97s (± 0.36%) 10.93s (± 0.54%) -0.05s (- 0.44%) 10.82s 11.08s
Monaco - node (v14.15.1, x64)
Memory used 323,900k (± 0.01%) 323,966k (± 0.01%) +66k (+ 0.02%) 323,941k 324,008k
Parse Time 1.56s (± 0.43%) 1.56s (± 0.82%) -0.00s (- 0.00%) 1.53s 1.58s
Bind Time 0.75s (± 0.80%) 0.75s (± 0.92%) -0.00s (- 0.13%) 0.73s 0.76s
Check Time 5.03s (± 0.54%) 5.02s (± 0.52%) -0.01s (- 0.26%) 4.98s 5.10s
Emit Time 3.18s (± 0.92%) 3.17s (± 0.58%) -0.00s (- 0.16%) 3.13s 3.22s
Total Time 10.52s (± 0.45%) 10.50s (± 0.36%) -0.02s (- 0.16%) 10.42s 10.59s
TFS - node (v14.15.1, x64)
Memory used 287,541k (± 0.01%) 287,629k (± 0.01%) +88k (+ 0.03%) 287,549k 287,673k
Parse Time 1.26s (± 1.13%) 1.25s (± 1.41%) -0.00s (- 0.16%) 1.22s 1.28s
Bind Time 0.72s (± 0.62%) 0.72s (± 0.69%) -0.00s (- 0.28%) 0.71s 0.73s
Check Time 4.65s (± 0.59%) 4.66s (± 0.31%) +0.01s (+ 0.19%) 4.63s 4.69s
Emit Time 3.26s (± 0.71%) 3.26s (± 0.81%) -0.00s (- 0.03%) 3.20s 3.32s
Total Time 9.88s (± 0.42%) 9.89s (± 0.28%) +0.00s (+ 0.05%) 9.83s 9.94s
material-ui - node (v14.15.1, x64)
Memory used 441,841k (± 0.06%) 441,985k (± 0.00%) +144k (+ 0.03%) 441,949k 442,005k
Parse Time 2.07s (± 0.62%) 2.09s (± 0.36%) +0.02s (+ 0.82%) 2.07s 2.10s
Bind Time 0.69s (± 0.69%) 0.69s (± 0.43%) -0.00s (- 0.14%) 0.69s 0.70s
Check Time 13.02s (± 0.60%) 12.91s (± 0.27%) -0.11s (- 0.85%) 12.84s 13.00s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.79s (± 0.53%) 15.69s (± 0.24%) -0.09s (- 0.60%) 15.60s 15.78s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-198-generic
Architecturex64
Available Memory16 GB
Available Memory4 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v14.15.1, x64)
Benchmark Name Iterations
Current 39669 10
Baseline master 10

Developer Information:

Download Benchmark

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Kingwl

Wenlu Wang (Kingwl) commented Mar 26, 2021

Copy link
Copy Markdown
Contributor Author

The benchmark looks good, at least with the option off.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) approved these changes Mar 26, 2021
View reviewed changes
@DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) merged commit 2f0c8b2 into microsoft:master Mar 26, 2021
@typescript-bot

TypeScript Bot (typescript-bot) commented Mar 26, 2021

Copy link
Copy Markdown
Contributor

Daniel Rosenwasser (@DanielRosenwasser)
The results of the perf run you requested are in!

Here they are:

Comparison Report - master..39669

Metric master 39669 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 344,876k (± 0.02%) 344,936k (± 0.02%) +60k (+ 0.02%) 344,745k 345,113k
Parse Time 1.95s (± 0.55%) 1.93s (± 0.63%) -0.02s (- 1.03%) 1.90s 1.96s
Bind Time 0.84s (± 0.84%) 0.83s (± 0.69%) -0.01s (- 1.07%) 0.82s 0.85s
Check Time 5.09s (± 0.35%) 5.08s (± 0.39%) -0.01s (- 0.16%) 5.04s 5.12s
Emit Time 5.94s (± 0.72%) 5.91s (± 0.60%) -0.03s (- 0.45%) 5.85s 6.00s
Total Time 13.81s (± 0.45%) 13.75s (± 0.31%) -0.06s (- 0.46%) 13.67s 13.86s
Compiler-Unions - node (v10.16.3, x64)
Memory used 203,133k (± 0.12%) 203,224k (± 0.03%) +91k (+ 0.04%) 203,055k 203,325k
Parse Time 0.79s (± 0.87%) 0.78s (± 0.67%) -0.00s (- 0.51%) 0.77s 0.79s
Bind Time 0.53s (± 1.25%) 0.52s (± 1.28%) -0.01s (- 1.89%) 0.51s 0.53s
Check Time 7.55s (± 0.67%) 7.46s (± 0.97%) -0.09s (- 1.23%) 7.32s 7.66s
Emit Time 2.61s (± 1.08%) 2.58s (± 0.99%) -0.04s (- 1.42%) 2.52s 2.62s
Total Time 11.48s (± 0.59%) 11.34s (± 0.77%) -0.14s (- 1.25%) 11.21s 11.59s
Monaco - node (v10.16.3, x64)
Memory used 342,681k (± 0.04%) 342,621k (± 0.02%) -60k (- 0.02%) 342,485k 342,747k
Parse Time 1.56s (± 0.89%) 1.55s (± 0.50%) -0.01s (- 0.64%) 1.53s 1.56s
Bind Time 0.74s (± 0.78%) 0.73s (± 1.21%) -0.01s (- 1.21%) 0.72s 0.76s
Check Time 5.24s (± 0.48%) 5.22s (± 0.51%) -0.01s (- 0.27%) 5.16s 5.28s
Emit Time 3.13s (± 0.31%) 3.12s (± 0.48%) -0.01s (- 0.38%) 3.07s 3.14s
Total Time 10.67s (± 0.35%) 10.63s (± 0.41%) -0.04s (- 0.39%) 10.52s 10.73s
TFS - node (v10.16.3, x64)
Memory used 304,243k (± 0.03%) 304,259k (± 0.03%) +16k (+ 0.01%) 304,028k 304,405k
Parse Time 1.21s (± 0.62%) 1.20s (± 0.74%) -0.01s (- 0.82%) 1.19s 1.23s
Bind Time 0.70s (± 0.68%) 0.70s (± 0.92%) -0.00s (- 0.14%) 0.68s 0.71s
Check Time 4.72s (± 0.59%) 4.71s (± 0.46%) -0.00s (- 0.02%) 4.67s 4.78s
Emit Time 3.27s (± 0.93%) 3.26s (± 1.12%) -0.01s (- 0.28%) 3.17s 3.32s
Total Time 9.90s (± 0.49%) 9.88s (± 0.52%) -0.02s (- 0.23%) 9.77s 10.01s
material-ui - node (v10.16.3, x64)
Memory used 465,477k (± 0.01%) 465,438k (± 0.02%) -39k (- 0.01%) 465,260k 465,623k
Parse Time 2.02s (± 0.55%) 2.01s (± 0.82%) -0.01s (- 0.35%) 1.98s 2.04s
Bind Time 0.66s (± 1.33%) 0.66s (± 0.75%) -0.01s (- 1.06%) 0.65s 0.67s
Check Time 14.32s (± 0.67%) 14.22s (± 0.42%) -0.09s (- 0.64%) 14.13s 14.43s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 17.00s (± 0.59%) 16.89s (± 0.38%) -0.11s (- 0.62%) 16.80s 17.11s
Angular - node (v12.1.0, x64)
Memory used 322,601k (± 0.02%) 322,661k (± 0.03%) +61k (+ 0.02%) 322,488k 322,914k
Parse Time 1.93s (± 0.48%) 1.92s (± 0.82%) -0.01s (- 0.36%) 1.89s 1.96s
Bind Time 0.81s (± 1.02%) 0.82s (± 1.17%) +0.00s (+ 0.12%) 0.80s 0.84s
Check Time 5.01s (± 0.40%) 5.01s (± 0.51%) -0.00s (- 0.02%) 4.97s 5.07s
Emit Time 6.04s (± 0.70%) 5.99s (± 0.67%) -0.05s (- 0.78%) 5.93s 6.10s
Total Time 13.79s (± 0.41%) 13.74s (± 0.43%) -0.05s (- 0.36%) 13.62s 13.89s
Compiler-Unions - node (v12.1.0, x64)
Memory used 190,228k (± 0.23%) 190,215k (± 0.13%) -13k (- 0.01%) 189,506k 190,784k
Parse Time 0.78s (± 0.88%) 0.77s (± 0.86%) -0.00s (- 0.26%) 0.76s 0.79s
Bind Time 0.53s (± 0.63%) 0.53s (± 0.76%) -0.00s (- 0.19%) 0.52s 0.54s
Check Time 7.04s (± 0.75%) 6.96s (± 0.45%) -0.07s (- 1.04%) 6.88s 7.05s
Emit Time 2.56s (± 1.02%) 2.56s (± 1.09%) +0.00s (+ 0.08%) 2.50s 2.61s
Total Time 10.90s (± 0.61%) 10.83s (± 0.32%) -0.07s (- 0.66%) 10.76s 10.90s
Monaco - node (v12.1.0, x64)
Memory used 325,000k (± 0.02%) 325,039k (± 0.02%) +39k (+ 0.01%) 324,848k 325,174k
Parse Time 1.54s (± 0.61%) 1.53s (± 0.87%) -0.01s (- 0.84%) 1.51s 1.57s
Bind Time 0.72s (± 0.80%) 0.72s (± 0.41%) -0.01s (- 0.69%) 0.71s 0.72s
Check Time 5.09s (± 0.70%) 5.08s (± 0.67%) -0.01s (- 0.14%) 5.03s 5.14s
Emit Time 3.14s (± 0.78%) 3.11s (± 0.74%) -0.03s (- 0.86%) 3.07s 3.17s
Total Time 10.49s (± 0.60%) 10.44s (± 0.53%) -0.05s (- 0.48%) 10.34s 10.58s
TFS - node (v12.1.0, x64)
Memory used 288,703k (± 0.02%) 288,748k (± 0.02%) +46k (+ 0.02%) 288,655k 288,904k
Parse Time 1.21s (± 0.43%) 1.20s (± 1.00%) -0.01s (- 0.41%) 1.17s 1.23s
Bind Time 0.70s (± 1.28%) 0.69s (± 0.75%) -0.01s (- 1.01%) 0.68s 0.70s
Check Time 4.65s (± 0.50%) 4.63s (± 0.38%) -0.02s (- 0.39%) 4.59s 4.67s
Emit Time 3.18s (± 0.66%) 3.17s (± 0.98%) -0.00s (- 0.13%) 3.11s 3.25s
Total Time 9.72s (± 0.41%) 9.69s (± 0.49%) -0.03s (- 0.33%) 9.59s 9.81s
material-ui - node (v12.1.0, x64)
Memory used 443,647k (± 0.01%) 443,544k (± 0.05%) -103k (- 0.02%) 442,584k 443,743k
Parse Time 2.04s (± 0.54%) 2.03s (± 0.45%) -0.01s (- 0.44%) 2.01s 2.05s
Bind Time 0.65s (± 1.05%) 0.64s (± 0.73%) -0.01s (- 0.93%) 0.63s 0.65s
Check Time 12.88s (± 0.56%) 12.90s (± 0.72%) +0.02s (+ 0.12%) 12.76s 13.11s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.57s (± 0.51%) 15.57s (± 0.65%) +0.00s (+ 0.02%) 15.42s 15.81s
Angular - node (v14.15.1, x64)
Memory used 321,274k (± 0.01%) 321,302k (± 0.01%) +28k (+ 0.01%) 321,198k 321,351k
Parse Time 1.93s (± 0.43%) 1.92s (± 0.46%) -0.01s (- 0.62%) 1.91s 1.95s
Bind Time 0.86s (± 0.57%) 0.86s (± 0.61%) -0.01s (- 0.58%) 0.84s 0.87s
Check Time 5.01s (± 0.46%) 5.00s (± 0.49%) -0.01s (- 0.10%) 4.95s 5.05s
Emit Time 6.33s (± 0.48%) 6.31s (± 0.52%) -0.02s (- 0.32%) 6.21s 6.35s
Total Time 14.13s (± 0.28%) 14.09s (± 0.37%) -0.04s (- 0.30%) 13.99s 14.20s
Compiler-Unions - node (v14.15.1, x64)
Memory used 189,310k (± 0.01%) 189,366k (± 0.01%) +57k (+ 0.03%) 189,333k 189,412k
Parse Time 0.80s (± 0.69%) 0.79s (± 0.63%) -0.01s (- 0.87%) 0.79s 0.81s
Bind Time 0.56s (± 0.40%) 0.55s (± 0.67%) -0.01s (- 1.07%) 0.55s 0.56s
Check Time 7.07s (± 0.59%) 7.06s (± 0.48%) -0.01s (- 0.11%) 7.01s 7.16s
Emit Time 2.54s (± 0.52%) 2.54s (± 0.41%) +0.00s (+ 0.00%) 2.51s 2.56s
Total Time 10.97s (± 0.36%) 10.95s (± 0.35%) -0.02s (- 0.19%) 10.88s 11.05s
Monaco - node (v14.15.1, x64)
Memory used 323,900k (± 0.01%) 323,953k (± 0.01%) +53k (+ 0.02%) 323,905k 324,010k
Parse Time 1.56s (± 0.43%) 1.56s (± 0.70%) -0.00s (- 0.13%) 1.54s 1.59s
Bind Time 0.75s (± 0.80%) 0.74s (± 0.66%) -0.00s (- 0.27%) 0.74s 0.76s
Check Time 5.03s (± 0.54%) 5.03s (± 0.44%) +0.00s (+ 0.02%) 4.98s 5.09s
Emit Time 3.18s (± 0.92%) 3.16s (± 0.39%) -0.02s (- 0.69%) 3.13s 3.19s
Total Time 10.52s (± 0.45%) 10.49s (± 0.26%) -0.03s (- 0.28%) 10.43s 10.56s
TFS - node (v14.15.1, x64)
Memory used 287,541k (± 0.01%) 287,632k (± 0.01%) +92k (+ 0.03%) 287,559k 287,674k
Parse Time 1.26s (± 1.13%) 1.24s (± 0.91%) -0.01s (- 1.19%) 1.22s 1.26s
Bind Time 0.72s (± 0.62%) 0.72s (± 1.49%) +0.00s (+ 0.14%) 0.71s 0.76s
Check Time 4.65s (± 0.59%) 4.64s (± 0.51%) -0.00s (- 0.04%) 4.59s 4.69s
Emit Time 3.26s (± 0.71%) 3.26s (± 0.70%) -0.01s (- 0.21%) 3.19s 3.30s
Total Time 9.88s (± 0.42%) 9.86s (± 0.39%) -0.02s (- 0.23%) 9.76s 9.92s
material-ui - node (v14.15.1, x64)
Memory used 441,841k (± 0.06%) 441,994k (± 0.00%) +154k (+ 0.03%) 441,971k 442,021k
Parse Time 2.07s (± 0.62%) 2.09s (± 0.52%) +0.02s (+ 1.06%) 2.07s 2.11s
Bind Time 0.69s (± 0.69%) 0.69s (± 0.43%) -0.00s (- 0.14%) 0.69s 0.70s
Check Time 13.02s (± 0.60%) 12.98s (± 0.47%) -0.04s (- 0.31%) 12.90s 13.12s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.79s (± 0.53%) 15.76s (± 0.42%) -0.02s (- 0.13%) 15.66s 15.91s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-198-generic
Architecturex64
Available Memory16 GB
Available Memory4 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v10.16.3, x64)
  • Compiler-Unions - node (v12.1.0, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v14.15.1, x64)
Benchmark Name Iterations
Current 39669 10
Baseline master 10

Developer Information:

Download Benchmark

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mjbvz Matt Bierner (mjbvz) mentioned this pull request Apr 7, 2021
Enable noImplicitOverride in our codebase microsoft/vscode#120675
Closed
@Jack-Works

Jack Works (Jack-Works) commented Apr 7, 2021

Copy link
Copy Markdown
Contributor

https://www.typescriptlang.org/play?ts=4.3.0-dev.20210406#code/MYGwhgzhAECK0G8CwAoa7oE8AUBKRAvqkSqJDACrQCmAHgC7UB2AJjPMmhgPYBu1AJwEBLFtSx5CxVEA

Is this expected? For code

class Q {
    y() {}
}
class T extends Q {
    override y() {}
}

The nightly playground emits the following JS code

"use strict";
class Q {
    y() { }
}
class T extends Q {
    override y() { }
}

which IMO is invalid. Is override y() {} a valid JS class member?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Kingwl

Wenlu Wang (Kingwl) commented Apr 7, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Jack Works (@Jack-Works) Nope. Fixed in #43536.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) mentioned this pull request Apr 7, 2021
Design Meeting Notes, 3/26/2021 #43581
Closed
@danfma

Daniel Ferreira Monteiro Alves (danfma) commented Apr 23, 2021

Copy link
Copy Markdown

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@andrewbranch

Andrew Branch (andrewbranch) commented Apr 23, 2021

Copy link
Copy Markdown
Member

Daniel Ferreira Monteiro Alves (@danfma) can you give an example?

danfma reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@danfma

Daniel Ferreira Monteiro Alves (danfma) commented Apr 23, 2021

Copy link
Copy Markdown

Yes.

On the left side, it's the original code. So, I tried to put the override in the constructor like protected override readonly context... the compiler will complain.

We had to use like in the right side to force the compiler to accept the code.

image

andrewbranch, Kingwl, InExtremaRes, and whzx5byb reacted with thumbs up emoji
All reactions
  • 👍 4 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Kingwl

Wenlu Wang (Kingwl) commented Apr 24, 2021

Copy link
Copy Markdown
Contributor Author

Would we consider to add quickfix for parameter property or allow override in parameter property as Daniel Ferreira Monteiro Alves (@danfma) said.😂

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@danfma

Daniel Ferreira Monteiro Alves (danfma) commented Apr 24, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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! 😬

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@andrewbranch

Andrew Branch (andrewbranch) commented Apr 26, 2021

Copy link
Copy Markdown
Member

Wenlu Wang (@Kingwl) I think we’re going to allow override in the parameter property, but I’m going to run it by the design meeting on Wednesday.

danfma reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Kingwl

Wenlu Wang (Kingwl) commented Apr 26, 2021

Copy link
Copy Markdown
Contributor Author

Okay. Looking forward for the good news :XP

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@andrewbranch Andrew Branch (andrewbranch) mentioned this pull request Apr 26, 2021
Allow override as parameter property #43831
Merged
@jogibear9988

Jochen Kühner (jogibear9988) commented May 1, 2021

Copy link
Copy Markdown

I've problems with static fields and override: #43916

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Thom1729 Thomas Smith (Thom1729) mentioned this pull request May 19, 2021
[TypeScript] Implement override keyword. sublimehq/Packages#2823
Merged
@Kingwl Wenlu Wang (Kingwl) mentioned this pull request Jun 6, 2021
noImplicitOverride does not complain on abstract methods #44457
Closed
@SLaks

SLaks (SLaks) commented Jun 8, 2021

Copy link
Copy Markdown

What about methods that implement interface (as opposed to base class) members?

hearnden, karol-depka, alanscodelog, and gdplouis reacted with thumbs up emoji
All reactions
  • 👍 4 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Kingwl

Wenlu Wang (Kingwl) commented Jun 9, 2021

Copy link
Copy Markdown
Contributor Author

What about methods that implement interface (as opposed to base class) members?

No plan yet.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dominic-simplan dominic-simplan mentioned this pull request Jul 21, 2021
Rule Proposal: Override checking for interfaces typescript-eslint/typescript-eslint#3608
Closed
@kmxz kmxz mentioned this pull request Sep 3, 2021
Cannot use override keyword to override methods of Object without explicitly extending Object #45704
Open
@sandersn Nathan Shively-Sanders (sandersn) mentioned this pull request Sep 13, 2021
implement code fix for override of js files #45780
Merged
@guilhermesimoes

Guilherme Simoes (guilhermesimoes) commented Sep 30, 2021

Copy link
Copy Markdown

Is there a way to apply this to my entire project except to classes that inherit from a particular class (like React.Component, for example)?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ekilah

Monroe Ekilah (ekilah) commented Jun 29, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Same question/need as Guilherme Simoes (@guilhermesimoes) - getting errors on state and render inside a React.Component is not helpful, but this flag would be very helpful outside of React (class) components.

without a way to exclude these (either by name, e.g. state, render, componentDidMount, etc.), or specifically for known React class properties (exceptReact or something), or even maybe include/exclude by directory or file extension (e.g. *.ts but not *.tsx), i can't use --noImplicitOverride in my project, but I have lots of non-React classes I'd love to have this protection apply to.

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:

ERROR in src/SomeComponent/index.tsx:22:3
TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'Component<IProps, IState, any>'.
    20 |   IState
    21 | > {
  > 22 |   state: IState = {}
       |   ^^^^^
    23 |
    24 |   render() {

ERROR in src/SomeComponent/index.tsx:24:3
TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'Component<IProps, IState, any>'.
    22 |   state: IState = {}
    23 |
  > 24 |   render() {
       |   ^^^^^^
    25 |     return (
guilhermesimoes reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Andarist Mateusz Burzyński (Andarist) mentioned this pull request Nov 28, 2024
override isn't required in ambient contexts with noImplicitOverride #60635
Closed
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@andrewbranch Andrew Branch (andrewbranch) andrewbranch approved these changes
@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) DanielRosenwasser approved these changes
@sandersn Nathan Shively-Sanders (sandersn) Awaiting requested review from sandersn
@RyanCavanaugh Ryan Cavanaugh (RyanCavanaugh) Awaiting requested review from RyanCavanaugh
+1 more reviewer
@mprobst Martin Probst (mprobst) mprobst left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser)

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

PR Backlog
Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Support override keyword on class methods

Uh oh!

There was an error while loading. Please reload this page.

19 participants

@Kingwl @typescript-bot @ifiokjr @DanielRosenwasser @millsp @andrewbranch @sk- @RyanCavanaugh @orta @karol-depka @pcj @evmar @Jack-Works @danfma @jogibear9988 @SLaks @guilhermesimoes @ekilah @mprobst
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.