Skip to content
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

Do not covariantly mix in constraints from contravarrying positions #43439

Merged

Conversation

weswigham
Copy link
Member

When calculating substitutions within a conditional.

Fixes #43427

@weswigham
Copy link
Member Author

@typescript-bot test this
@typescript-bot user test this
@typescript-bot run dt
@typescript-bot perf test this faster

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 30, 2021

Heya @weswigham, I've started to run the extended test suite on this PR at cb1833b. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 30, 2021

Heya @weswigham, I've started to run the parallelized Definitely Typed test suite on this PR at cb1833b. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 30, 2021

Heya @weswigham, I've started to run the abridged perf test suite on this PR at cb1833b. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 30, 2021

Heya @weswigham, I've started to run the parallelized community code test suite on this PR at cb1833b. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 30, 2021

Heya @weswigham, I've started to run the perf test suite on this PR at cb1833b. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@weswigham
The results of the perf run you requested are in!

Here they are:

Comparison Report - master..43439

Metric master 43439 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 344,930k (± 0.02%) 344,947k (± 0.02%) +17k (+ 0.00%) 344,782k 345,082k
Parse Time 1.95s (± 1.47%) 1.93s (± 0.55%) -0.03s (- 1.43%) 1.91s 1.95s
Bind Time 0.84s (± 0.89%) 0.83s (± 0.82%) -0.00s (- 0.36%) 0.82s 0.85s
Check Time 5.12s (± 0.53%) 5.10s (± 0.57%) -0.02s (- 0.43%) 5.01s 5.16s
Emit Time 5.92s (± 0.58%) 5.91s (± 0.70%) -0.01s (- 0.10%) 5.83s 6.01s
Total Time 13.83s (± 0.48%) 13.77s (± 0.48%) -0.06s (- 0.45%) 13.65s 13.94s
Compiler-Unions - node (v10.16.3, x64)
Memory used 203,064k (± 0.15%) 203,295k (± 0.03%) +230k (+ 0.11%) 203,144k 203,425k
Parse Time 0.79s (± 0.76%) 0.79s (± 1.67%) +0.01s (+ 0.89%) 0.77s 0.84s
Bind Time 0.53s (± 1.27%) 0.53s (± 1.27%) -0.00s (- 0.00%) 0.51s 0.54s
Check Time 7.50s (± 0.72%) 7.59s (± 0.73%) +0.09s (+ 1.15%) 7.47s 7.70s
Emit Time 2.58s (± 0.86%) 2.60s (± 1.57%) +0.02s (+ 0.89%) 2.52s 2.75s
Total Time 11.39s (± 0.58%) 11.51s (± 0.61%) +0.12s (+ 1.01%) 11.34s 11.66s
Monaco - node (v10.16.3, x64)
Memory used 342,707k (± 0.02%) 342,696k (± 0.02%) -12k (- 0.00%) 342,536k 342,819k
Parse Time 1.57s (± 1.47%) 1.56s (± 0.22%) -0.01s (- 0.51%) 1.56s 1.57s
Bind Time 0.74s (± 1.17%) 0.74s (± 0.66%) +0.00s (+ 0.27%) 0.74s 0.76s
Check Time 5.27s (± 0.38%) 5.28s (± 0.47%) +0.01s (+ 0.23%) 5.23s 5.33s
Emit Time 3.14s (± 0.76%) 3.15s (± 0.65%) +0.00s (+ 0.10%) 3.10s 3.18s
Total Time 10.72s (± 0.45%) 10.74s (± 0.34%) +0.01s (+ 0.10%) 10.65s 10.81s
TFS - node (v10.16.3, x64)
Memory used 304,292k (± 0.02%) 304,301k (± 0.02%) +9k (+ 0.00%) 304,196k 304,403k
Parse Time 1.22s (± 1.50%) 1.22s (± 0.74%) -0.01s (- 0.49%) 1.20s 1.24s
Bind Time 0.70s (± 0.70%) 0.70s (± 0.88%) -0.00s (- 0.43%) 0.68s 0.71s
Check Time 4.74s (± 0.35%) 4.75s (± 0.38%) +0.01s (+ 0.19%) 4.72s 4.79s
Emit Time 3.28s (± 1.28%) 3.26s (± 1.39%) -0.02s (- 0.49%) 3.11s 3.33s
Total Time 9.95s (± 0.55%) 9.93s (± 0.56%) -0.02s (- 0.19%) 9.75s 10.04s
material-ui - node (v10.16.3, x64)
Memory used 465,575k (± 0.02%) 465,481k (± 0.01%) -95k (- 0.02%) 465,364k 465,622k
Parse Time 2.03s (± 2.15%) 2.01s (± 0.41%) -0.03s (- 1.33%) 1.98s 2.02s
Bind Time 0.66s (± 1.13%) 0.66s (± 1.33%) -0.00s (- 0.45%) 0.64s 0.67s
Check Time 14.29s (± 0.54%) 14.35s (± 0.54%) +0.06s (+ 0.41%) 14.17s 14.50s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.99s (± 0.59%) 17.01s (± 0.49%) +0.03s (+ 0.16%) 16.81s 17.17s
Angular - node (v12.1.0, x64)
Memory used 322,756k (± 0.03%) 322,720k (± 0.02%) -37k (- 0.01%) 322,556k 322,875k
Parse Time 1.93s (± 0.72%) 1.92s (± 0.31%) -0.01s (- 0.52%) 1.90s 1.93s
Bind Time 0.81s (± 0.76%) 0.81s (± 0.61%) +0.00s (+ 0.37%) 0.81s 0.83s
Check Time 5.00s (± 0.37%) 5.01s (± 0.34%) +0.01s (+ 0.22%) 4.97s 5.04s
Emit Time 5.99s (± 0.65%) 5.97s (± 0.60%) -0.02s (- 0.40%) 5.92s 6.09s
Total Time 13.73s (± 0.38%) 13.71s (± 0.32%) -0.02s (- 0.16%) 13.66s 13.86s
Compiler-Unions - node (v12.1.0, x64)
Memory used 190,573k (± 0.11%) 190,171k (± 0.20%) -402k (- 0.21%) 189,188k 190,903k
Parse Time 0.76s (± 0.49%) 0.77s (± 0.68%) +0.00s (+ 0.52%) 0.76s 0.78s
Bind Time 0.53s (± 0.65%) 0.53s (± 0.71%) -0.00s (- 0.38%) 0.52s 0.53s
Check Time 7.03s (± 0.60%) 7.02s (± 0.81%) -0.00s (- 0.03%) 6.92s 7.14s
Emit Time 2.55s (± 0.90%) 2.56s (± 1.01%) +0.01s (+ 0.47%) 2.50s 2.60s
Total Time 10.86s (± 0.57%) 10.88s (± 0.57%) +0.02s (+ 0.16%) 10.77s 11.00s
Monaco - node (v12.1.0, x64)
Memory used 325,050k (± 0.03%) 325,115k (± 0.03%) +64k (+ 0.02%) 324,909k 325,421k
Parse Time 1.55s (± 1.09%) 1.54s (± 0.75%) -0.00s (- 0.26%) 1.51s 1.57s
Bind Time 0.72s (± 0.92%) 0.72s (± 1.03%) +0.00s (+ 0.00%) 0.71s 0.74s
Check Time 5.12s (± 0.63%) 5.10s (± 0.44%) -0.01s (- 0.23%) 5.05s 5.17s
Emit Time 3.10s (± 0.64%) 3.08s (± 0.52%) -0.02s (- 0.55%) 3.05s 3.12s
Total Time 10.48s (± 0.47%) 10.45s (± 0.34%) -0.03s (- 0.28%) 10.38s 10.52s
TFS - node (v12.1.0, x64)
Memory used 288,770k (± 0.03%) 288,773k (± 0.02%) +3k (+ 0.00%) 288,575k 288,893k
Parse Time 1.21s (± 0.83%) 1.21s (± 0.84%) -0.01s (- 0.41%) 1.19s 1.23s
Bind Time 0.69s (± 0.75%) 0.70s (± 0.71%) +0.01s (+ 0.72%) 0.69s 0.71s
Check Time 4.66s (± 0.49%) 4.69s (± 0.63%) +0.03s (+ 0.60%) 4.64s 4.75s
Emit Time 3.15s (± 0.60%) 3.17s (± 0.76%) +0.02s (+ 0.60%) 3.10s 3.22s
Total Time 9.71s (± 0.44%) 9.76s (± 0.42%) +0.05s (+ 0.54%) 9.69s 9.88s
material-ui - node (v12.1.0, x64)
Memory used 443,735k (± 0.01%) 443,496k (± 0.09%) -240k (- 0.05%) 442,362k 443,865k
Parse Time 2.02s (± 0.66%) 2.02s (± 0.44%) -0.00s (- 0.00%) 2.00s 2.04s
Bind Time 0.64s (± 0.73%) 0.64s (± 1.25%) +0.00s (+ 0.31%) 0.63s 0.66s
Check Time 12.99s (± 0.63%) 13.00s (± 0.96%) +0.01s (+ 0.08%) 12.75s 13.28s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.65s (± 0.53%) 15.67s (± 0.80%) +0.01s (+ 0.10%) 15.41s 15.95s
Angular - node (v14.15.1, x64)
Memory used 321,275k (± 0.08%) 321,412k (± 0.01%) +137k (+ 0.04%) 321,373k 321,490k
Parse Time 1.94s (± 0.51%) 1.92s (± 0.27%) -0.02s (- 0.88%) 1.91s 1.93s
Bind Time 0.86s (± 0.72%) 0.86s (± 0.35%) -0.00s (- 0.12%) 0.85s 0.86s
Check Time 5.05s (± 0.75%) 5.04s (± 0.62%) -0.01s (- 0.22%) 4.96s 5.12s
Emit Time 6.37s (± 1.09%) 6.32s (± 1.67%) -0.05s (- 0.75%) 6.23s 6.73s
Total Time 14.22s (± 0.73%) 14.14s (± 0.74%) -0.08s (- 0.53%) 13.99s 14.52s
Compiler-Unions - node (v14.15.1, x64)
Memory used 189,309k (± 0.13%) 189,402k (± 0.01%) +93k (+ 0.05%) 189,360k 189,453k
Parse Time 0.80s (± 0.42%) 0.81s (± 0.69%) +0.01s (+ 0.62%) 0.80s 0.82s
Bind Time 0.56s (± 0.53%) 0.56s (± 0.40%) +0.00s (+ 0.18%) 0.55s 0.56s
Check Time 7.13s (± 0.90%) 7.13s (± 0.55%) -0.01s (- 0.11%) 7.04s 7.24s
Emit Time 2.57s (± 1.28%) 2.56s (± 0.63%) -0.00s (- 0.19%) 2.54s 2.60s
Total Time 11.06s (± 0.69%) 11.05s (± 0.43%) -0.01s (- 0.10%) 10.96s 11.20s
Monaco - node (v14.15.1, x64)
Memory used 324,037k (± 0.01%) 324,017k (± 0.01%) -20k (- 0.01%) 323,958k 324,048k
Parse Time 1.57s (± 0.92%) 1.57s (± 0.53%) +0.00s (+ 0.00%) 1.56s 1.59s
Bind Time 0.74s (± 0.46%) 0.75s (± 0.49%) +0.00s (+ 0.40%) 0.74s 0.75s
Check Time 5.06s (± 0.48%) 5.07s (± 0.43%) +0.01s (+ 0.14%) 5.03s 5.14s
Emit Time 3.20s (± 0.71%) 3.19s (± 0.91%) -0.01s (- 0.22%) 3.14s 3.25s
Total Time 10.58s (± 0.38%) 10.59s (± 0.49%) +0.01s (+ 0.08%) 10.48s 10.74s
TFS - node (v14.15.1, x64)
Memory used 287,697k (± 0.01%) 287,702k (± 0.01%) +5k (+ 0.00%) 287,645k 287,762k
Parse Time 1.27s (± 1.04%) 1.26s (± 0.80%) -0.01s (- 0.63%) 1.24s 1.29s
Bind Time 0.72s (± 0.62%) 0.72s (± 0.82%) +0.00s (+ 0.28%) 0.71s 0.74s
Check Time 4.69s (± 0.41%) 4.71s (± 0.48%) +0.02s (+ 0.47%) 4.65s 4.74s
Emit Time 3.25s (± 0.51%) 3.27s (± 0.71%) +0.02s (+ 0.49%) 3.24s 3.34s
Total Time 9.93s (± 0.39%) 9.97s (± 0.31%) +0.04s (+ 0.35%) 9.89s 10.05s
material-ui - node (v14.15.1, x64)
Memory used 441,883k (± 0.06%) 441,876k (± 0.06%) -8k (- 0.00%) 440,748k 442,033k
Parse Time 2.09s (± 0.45%) 2.10s (± 0.69%) +0.00s (+ 0.14%) 2.05s 2.12s
Bind Time 0.69s (± 0.98%) 0.70s (± 0.71%) +0.00s (+ 0.29%) 0.69s 0.71s
Check Time 13.01s (± 0.51%) 13.08s (± 1.05%) +0.07s (+ 0.51%) 12.85s 13.51s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.80s (± 0.45%) 15.87s (± 0.89%) +0.07s (+ 0.45%) 15.63s 16.30s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-206-generic
Architecturex64
Available Memory16 GB
Available Memory10 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 43439 10
Baseline master 10

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

@weswigham
The results of the perf run you requested are in!

Here they are:

Comparison Report - master..43439

Metric master 43439 Delta Best Worst
Angular - node (v14.15.1, x64)
Memory used 321,275k (± 0.08%) 321,251k (± 0.08%) -24k (- 0.01%) 320,241k 321,430k
Parse Time 1.94s (± 0.51%) 1.93s (± 0.56%) -0.01s (- 0.36%) 1.91s 1.96s
Bind Time 0.86s (± 0.72%) 0.86s (± 0.55%) -0.00s (- 0.23%) 0.85s 0.87s
Check Time 5.05s (± 0.75%) 5.04s (± 0.63%) -0.01s (- 0.28%) 4.97s 5.10s
Emit Time 6.37s (± 1.09%) 6.31s (± 0.60%) -0.06s (- 1.02%) 6.27s 6.45s
Total Time 14.22s (± 0.73%) 14.13s (± 0.40%) -0.09s (- 0.62%) 14.04s 14.29s
Compiler-Unions - node (v14.15.1, x64)
Memory used 189,309k (± 0.13%) 189,409k (± 0.01%) +101k (+ 0.05%) 189,368k 189,447k
Parse Time 0.80s (± 0.42%) 0.80s (± 0.77%) -0.00s (- 0.50%) 0.79s 0.81s
Bind Time 0.56s (± 0.53%) 0.55s (± 0.67%) -0.00s (- 0.54%) 0.55s 0.56s
Check Time 7.13s (± 0.90%) 7.07s (± 0.52%) -0.06s (- 0.87%) 6.98s 7.17s
Emit Time 2.57s (± 1.28%) 2.56s (± 0.85%) -0.01s (- 0.47%) 2.51s 2.62s
Total Time 11.06s (± 0.69%) 10.98s (± 0.38%) -0.08s (- 0.76%) 10.89s 11.09s
Monaco - node (v14.15.1, x64)
Memory used 324,037k (± 0.01%) 324,040k (± 0.01%) +3k (+ 0.00%) 323,998k 324,076k
Parse Time 1.57s (± 0.92%) 1.56s (± 0.64%) -0.02s (- 1.08%) 1.54s 1.58s
Bind Time 0.74s (± 0.46%) 0.74s (± 0.66%) +0.00s (+ 0.13%) 0.73s 0.75s
Check Time 5.06s (± 0.48%) 5.04s (± 0.40%) -0.01s (- 0.30%) 4.99s 5.08s
Emit Time 3.20s (± 0.71%) 3.17s (± 0.86%) -0.03s (- 1.06%) 3.12s 3.24s
Total Time 10.58s (± 0.38%) 10.52s (± 0.28%) -0.06s (- 0.60%) 10.44s 10.60s
TFS - node (v14.15.1, x64)
Memory used 287,697k (± 0.01%) 287,699k (± 0.01%) +2k (+ 0.00%) 287,630k 287,752k
Parse Time 1.27s (± 1.04%) 1.26s (± 0.74%) -0.01s (- 0.79%) 1.24s 1.29s
Bind Time 0.72s (± 0.62%) 0.72s (± 0.95%) -0.01s (- 0.83%) 0.71s 0.74s
Check Time 4.69s (± 0.41%) 4.68s (± 0.38%) -0.00s (- 0.11%) 4.64s 4.72s
Emit Time 3.25s (± 0.51%) 3.25s (± 0.31%) -0.01s (- 0.25%) 3.23s 3.28s
Total Time 9.93s (± 0.39%) 9.90s (± 0.29%) -0.03s (- 0.28%) 9.86s 9.97s
material-ui - node (v14.15.1, x64)
Memory used 441,883k (± 0.06%) 441,996k (± 0.00%) +113k (+ 0.03%) 441,939k 442,014k
Parse Time 2.09s (± 0.45%) 2.09s (± 0.64%) -0.00s (- 0.05%) 2.05s 2.11s
Bind Time 0.69s (± 0.98%) 0.69s (± 0.86%) -0.00s (- 0.00%) 0.68s 0.70s
Check Time 13.01s (± 0.51%) 13.04s (± 0.59%) +0.03s (+ 0.22%) 12.88s 13.20s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.80s (± 0.45%) 15.83s (± 0.49%) +0.03s (+ 0.17%) 15.68s 16.02s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-206-generic
Architecturex64
Available Memory16 GB
Available Memory10 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 43439 10
Baseline master 10

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master.

@RyanCavanaugh
Copy link
Member

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 30, 2021

Heya @RyanCavanaugh, I've started to run the tarball bundle task on this PR at cb1833b. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 30, 2021

Hey @RyanCavanaugh, 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/99765/artifacts?artifactName=tgz&fileId=3F0E740F4C6B9374DE9E9EAC3D681D2988529BF5808C1BCBC3B8A5D211957FAC02&fileName=/typescript-4.3.0-insiders.20210330.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@4.3.0-pr-43439-11".;

@weswigham
Copy link
Member Author

@typescript-bot user test this
@typescript-bot run dt

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 30, 2021

Heya @weswigham, I've started to run the parallelized Definitely Typed test suite on this PR at 6abbc96. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 30, 2021

Heya @weswigham, I've started to run the parallelized community code test suite on this PR at 6abbc96. You can monitor the build here.

Copy link
Member

@ahejlsberg ahejlsberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you still need to accept the test suite baseline changes. Otherwise, looks good, assuming it doesn't break anything in the other test suites.

@weswigham
Copy link
Member Author

There's one DT change left I wanna adjust this to not hit - I think I'll adjust this so substitutes on type variables continue to always occur, regardless of position.

@weswigham
Copy link
Member Author

@typescript-bot user test this
@typescript-bot run dt

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 1, 2021

Heya @weswigham, I've started to run the parallelized Definitely Typed test suite on this PR at c392b0f. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 1, 2021

Heya @weswigham, I've started to run the parallelized community code test suite on this PR at c392b0f. You can monitor the build here.

@weswigham weswigham merged commit f03e59e into microsoft:master Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect intersection narrowing of nongeneric type in conditional type
4 participants