Skip to content

Fix subtype reduction involving type variables with union constraints#53351

Merged
ahejlsberg merged 2 commits intomainfrom
fix53311
Mar 21, 2023
Merged

Fix subtype reduction involving type variables with union constraints#53351
ahejlsberg merged 2 commits intomainfrom
fix53311

Conversation

@ahejlsberg
Copy link
Copy Markdown
Member

Fixes #53311.

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Mar 19, 2023
@ahejlsberg
Copy link
Copy Markdown
Member Author

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

@typescript-bot
Copy link
Copy Markdown
Collaborator

typescript-bot commented Mar 19, 2023

Heya @ahejlsberg, I've started to run the diff-based top-repos suite on this PR at f6c466a. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Copy Markdown
Collaborator

typescript-bot commented Mar 19, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Copy Markdown
Collaborator

typescript-bot commented Mar 19, 2023

Heya @ahejlsberg, I've started to run the diff-based user code test suite on this PR at f6c466a. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Copy Markdown
Collaborator

typescript-bot commented Mar 19, 2023

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

@typescript-bot
Copy link
Copy Markdown
Collaborator

typescript-bot commented Mar 19, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Copy Markdown
Collaborator

@ahejlsberg Here are the results of running the user test suite comparing main and refs/pull/53351/merge:

Everything looks good!

@typescript-bot
Copy link
Copy Markdown
Collaborator

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

Here they are:

Comparison Report - main..53351

Metric main 53351 Delta Best Worst p-value
Angular - node (v16.17.1, x64)
Memory used 360,896k (± 0.01%) 360,917k (± 0.01%) ~ 360,887k 360,939k p=0.199 n=6
Parse Time 3.52s (± 0.69%) 3.53s (± 0.68%) ~ 3.51s 3.57s p=0.871 n=6
Bind Time 1.18s (± 0.69%) 1.18s (± 0.54%) ~ 1.17s 1.19s p=0.432 n=6
Check Time 9.46s (± 0.52%) 9.45s (± 0.31%) ~ 9.41s 9.48s p=0.871 n=6
Emit Time 7.93s (± 0.68%) 7.91s (± 0.56%) ~ 7.88s 8.00s p=0.625 n=6
Total Time 22.10s (± 0.38%) 22.08s (± 0.26%) ~ 22.00s 22.16s p=0.810 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 192,531k (± 0.04%) 193,133k (± 0.70%) ~ 192,555k 195,908k p=0.471 n=6
Parse Time 1.57s (± 1.64%) 1.57s (± 1.45%) ~ 1.53s 1.59s p=0.623 n=6
Bind Time 0.82s (± 0.77%) 0.82s (± 0.00%) ~ 0.82s 0.82s p=1.000 n=6
Check Time 10.08s (± 0.62%) 10.07s (± 0.46%) ~ 10.01s 10.15s p=0.575 n=6
Emit Time 2.99s (± 0.63%) 2.98s (± 0.78%) ~ 2.95s 3.02s p=0.684 n=6
Total Time 15.47s (± 0.30%) 15.44s (± 0.28%) ~ 15.38s 15.49s p=0.469 n=6
Monaco - node (v16.17.1, x64)
Memory used 345,434k (± 0.01%) 345,421k (± 0.00%) ~ 345,408k 345,428k p=0.106 n=6
Parse Time 2.72s (± 0.36%) 2.72s (± 0.44%) ~ 2.71s 2.74s p=0.867 n=6
Bind Time 1.09s (± 0.50%) 1.08s (± 0.59%) ~ 1.07s 1.09s p=0.201 n=6
Check Time 7.66s (± 0.32%) 7.67s (± 0.31%) ~ 7.64s 7.70s p=0.625 n=6
Emit Time 4.42s (± 0.57%) 4.42s (± 0.39%) ~ 4.40s 4.44s p=1.000 n=6
Total Time 15.89s (± 0.19%) 15.89s (± 0.12%) ~ 15.86s 15.91s p=0.871 n=6
TFS - node (v16.17.1, x64)
Memory used 299,792k (± 0.01%) 299,807k (± 0.01%) ~ 299,754k 299,852k p=0.377 n=6
Parse Time 2.17s (± 0.48%) 2.17s (± 0.75%) ~ 2.15s 2.19s p=0.369 n=6
Bind Time 1.24s (± 0.88%) 1.24s (± 1.10%) ~ 1.22s 1.25s p=0.798 n=6
Check Time 7.17s (± 0.57%) 7.17s (± 0.39%) ~ 7.12s 7.20s p=0.936 n=6
Emit Time 4.31s (± 0.70%) 4.35s (± 0.45%) +0.04s (+ 0.97%) 4.32s 4.37s p=0.036 n=6
Total Time 14.88s (± 0.33%) 14.92s (± 0.18%) ~ 14.89s 14.96s p=0.106 n=6
material-ui - node (v16.17.1, x64)
Memory used 477,460k (± 0.02%) 477,477k (± 0.02%) ~ 477,355k 477,588k p=0.810 n=6
Parse Time 3.21s (± 0.36%) 3.22s (± 0.64%) ~ 3.19s 3.24s p=0.281 n=6
Bind Time 0.95s (± 0.54%) 0.96s (± 0.54%) ~ 0.95s 0.96s p=0.311 n=6
Check Time 17.96s (± 0.49%) 17.95s (± 0.27%) ~ 17.89s 18.01s p=1.000 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.12s (± 0.45%) 22.13s (± 0.20%) ~ 22.09s 22.21s p=0.810 n=6
xstate - node (v16.17.1, x64)
Memory used 550,802k (± 0.02%) 550,703k (± 0.01%) ~ 550,613k 550,821k p=0.093 n=6
Parse Time 3.94s (± 0.35%) 3.94s (± 0.21%) ~ 3.93s 3.95s p=0.195 n=6
Bind Time 1.80s (± 0.30%) 1.79s (± 0.74%) ~ 1.77s 1.80s p=0.490 n=6
Check Time 3.03s (± 0.39%) 3.02s (± 0.74%) ~ 2.99s 3.05s p=0.418 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 8.86s (± 0.27%) 8.85s (± 0.38%) ~ 8.82s 8.90s p=0.518 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • Angular - node (v16.17.1, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Monaco - node (v16.17.1, x64)
  • TFS - node (v16.17.1, x64)
  • material-ui - node (v16.17.1, x64)
  • xstate - node (v16.17.1, x64)
Benchmark Name Iterations
Current 53351 6
Baseline main 6

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Copy Markdown
Collaborator

Hey @ahejlsberg, the results of running the DT tests are ready.
Everything looks the same!
You can check the log here.

@typescript-bot
Copy link
Copy Markdown
Collaborator

@ahejlsberg Here are the results of running the top-repos suite comparing main and refs/pull/53351/merge:

Everything looks good!

@ahejlsberg
Copy link
Copy Markdown
Member Author

Tests and performance are unchanged. This one is good to go.

Copy link
Copy Markdown
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

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

Do we need to backport this to 5.0?

@ahejlsberg
Copy link
Copy Markdown
Member Author

Do we need to backport this to 5.0?

I could go either way on that. The underlying issue has been present for years, but the combination of that and an unrelated change in 5.0 caused a regression.

@ahejlsberg ahejlsberg merged commit bace689 into main Mar 21, 2023
@ahejlsberg ahejlsberg deleted the fix53311 branch March 21, 2023 19:52
@jakebailey
Copy link
Copy Markdown
Member

I'll trigger it anyway, and we can discuss it at a meeting.

@typescript-bot cherry-pick this to release-5.0

@typescript-bot
Copy link
Copy Markdown
Collaborator

typescript-bot commented Mar 21, 2023

Heya @jakebailey, I've started to run the task to cherry-pick this into release-5.0 on this PR at f6c466a. You can monitor the build here.

@typescript-bot
Copy link
Copy Markdown
Collaborator

Hey @jakebailey, I've opened #53422 for you.

typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request Mar 21, 2023
Component commits:
3811515 Fix subtype reduction involving type variables with union constraints

f6c466a Add tests
DanielRosenwasser pushed a commit that referenced this pull request Mar 28, 2023
…e-5.0 (#53422)

Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
drivron pushed a commit to scenari/typescript that referenced this pull request Sep 14, 2023
…to release-5.0 (microsoft#53422)

Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[5.0.2 regression] unused type guard result erroneously changing inferred type of variable

3 participants