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

Check if switch statements are exhaustive when their expressions is generic with a literal type constraint #60644

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Nov 30, 2024

cc @gabritto since it's somewhat related to #56941

fixes #60658

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Nov 30, 2024
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@jfet97
Copy link
Contributor

jfet97 commented Nov 30, 2024

That "person" case is suspiciously familiar :P
Btw thanks :D

@Jontii
Copy link

Jontii commented Dec 2, 2024

Would love this

@jfet97
Copy link
Contributor

jfet97 commented Dec 2, 2024

Would fix #60658

@gabritto
Copy link
Member

gabritto commented Dec 2, 2024

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 2, 2024

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
test top400 ✅ Started ✅ Results
user test this ✅ Started ✅ Results
run dt ✅ Started ✅ Results
perf test this faster ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

Hey @gabritto, the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@gabritto Here are the results of running the user tests with tsc comparing main and refs/pull/60644/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

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

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-Unions - node (v18.15.0, x64)
Errors 34 34 ~ ~ ~ p=1.000 n=6
Symbols 62,363 62,363 ~ ~ ~ p=1.000 n=6
Types 50,395 50,395 ~ ~ ~ p=1.000 n=6
Memory used 193,618k (± 0.75%) 193,636k (± 0.76%) ~ 193,007k 196,637k p=0.378 n=6
Parse Time 1.31s (± 0.89%) 1.31s (± 0.92%) ~ 1.29s 1.32s p=0.388 n=6
Bind Time 0.72s 0.72s ~ ~ ~ p=1.000 n=6
Check Time 9.83s (± 0.51%) 9.80s (± 0.56%) ~ 9.73s 9.87s p=0.377 n=6
Emit Time 2.74s (± 1.31%) 2.73s (± 0.52%) ~ 2.71s 2.75s p=0.934 n=6
Total Time 14.59s (± 0.29%) 14.56s (± 0.36%) ~ 14.48s 14.61s p=0.518 n=6
angular-1 - node (v18.15.0, x64)
Errors 37 37 ~ ~ ~ p=1.000 n=6
Symbols 947,936 947,936 ~ ~ ~ p=1.000 n=6
Types 410,955 410,955 ~ ~ ~ p=1.000 n=6
Memory used 1,225,985k (± 0.00%) 1,226,011k (± 0.00%) ~ 1,225,989k 1,226,048k p=0.065 n=6
Parse Time 6.67s (± 0.65%) 6.66s (± 0.64%) ~ 6.61s 6.71s p=0.809 n=6
Bind Time 1.88s (± 0.29%) 1.88s (± 0.40%) ~ 1.87s 1.89s p=0.476 n=6
Check Time 31.98s (± 0.40%) 32.04s (± 0.41%) ~ 31.80s 32.18s p=0.335 n=6
Emit Time 15.17s (± 0.49%) 15.16s (± 0.42%) ~ 15.09s 15.24s p=1.000 n=6
Total Time 55.70s (± 0.28%) 55.75s (± 0.28%) ~ 55.47s 55.90s p=0.630 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,501,661 2,501,661 ~ ~ ~ p=1.000 n=6
Types 909,610 909,610 ~ ~ ~ p=1.000 n=6
Memory used 2,319,041k (± 0.00%) 2,319,069k (± 0.00%) ~ 2,319,030k 2,319,098k p=0.148 n=6
Parse Time 9.30s (± 0.29%) 9.29s (± 0.27%) ~ 9.26s 9.32s p=1.000 n=6
Bind Time 2.15s (± 0.64%) 2.17s (± 0.74%) ~ 2.14s 2.18s p=0.140 n=6
Check Time 74.89s (± 0.49%) 75.08s (± 1.54%) ~ 73.47s 77.04s p=0.810 n=6
Emit Time 0.28s (± 2.26%) 0.29s (± 4.29%) ~ 0.27s 0.30s p=0.591 n=6
Total Time 86.63s (± 0.41%) 86.83s (± 1.33%) ~ 85.27s 88.83s p=0.936 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,225,251 1,225,251 ~ ~ ~ p=1.000 n=6
Types 266,546 266,546 ~ ~ ~ p=1.000 n=6
Memory used 2,354,183k (± 0.03%) 2,354,055k (± 0.02%) ~ 2,353,579k 2,354,515k p=0.936 n=6
Parse Time 5.23s (± 1.20%) 5.21s (± 0.69%) ~ 5.17s 5.26s p=0.335 n=6
Bind Time 1.78s (± 0.84%) 1.77s (± 1.13%) ~ 1.75s 1.80s p=0.288 n=6
Check Time 35.22s (± 0.28%) 35.21s (± 0.11%) ~ 35.16s 35.25s p=0.688 n=6
Emit Time 3.03s (± 3.77%) 2.96s (± 1.51%) ~ 2.89s 3.02s p=0.261 n=6
Total Time 45.28s (± 0.34%) 45.18s (± 0.09%) ~ 45.12s 45.24s p=0.378 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,225,251 1,225,251 ~ ~ ~ p=1.000 n=6
Types 266,546 266,546 ~ ~ ~ p=1.000 n=6
Memory used 3,028,519k (± 9.75%) 2,908,400k (±12.88%) ~ 2,423,421k 3,150,982k p=0.298 n=6
Parse Time 6.96s (± 1.54%) 6.97s (± 2.00%) ~ 6.78s 7.12s p=0.575 n=6
Bind Time 2.15s (± 2.08%) 2.15s (± 1.40%) ~ 2.10s 2.18s p=0.936 n=6
Check Time 42.80s (± 0.37%) 42.94s (± 0.52%) ~ 42.67s 43.27s p=0.378 n=6
Emit Time 3.50s (± 2.04%) 3.49s (± 3.59%) ~ 3.40s 3.73s p=0.575 n=6
Total Time 55.41s (± 0.41%) 55.55s (± 0.59%) ~ 55.01s 55.99s p=0.230 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 262,223 262,223 ~ ~ ~ p=1.000 n=6
Types 106,607 106,607 ~ ~ ~ p=1.000 n=6
Memory used 439,832k (± 0.01%) 439,799k (± 0.01%) ~ 439,701k 439,856k p=0.378 n=6
Parse Time 3.53s (± 0.43%) 3.53s (± 0.77%) ~ 3.50s 3.57s p=1.000 n=6
Bind Time 1.31s (± 0.62%) 1.31s (± 1.40%) ~ 1.28s 1.33s p=0.801 n=6
Check Time 18.89s (± 0.34%) 18.88s (± 0.24%) ~ 18.82s 18.94s p=0.687 n=6
Emit Time 1.52s (± 1.34%) 1.53s (± 1.64%) ~ 1.50s 1.57s p=1.000 n=6
Total Time 25.25s (± 0.28%) 25.24s (± 0.19%) ~ 25.19s 25.30s p=0.936 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 70 70 ~ ~ ~ p=1.000 n=6
Symbols 226,062 226,062 ~ ~ ~ p=1.000 n=6
Types 94,488 94,488 ~ ~ ~ p=1.000 n=6
Memory used 371,661k (± 0.04%) 371,689k (± 0.06%) ~ 371,495k 371,988k p=0.810 n=6
Parse Time 2.90s (± 1.62%) 2.87s (± 0.42%) ~ 2.85s 2.88s p=0.331 n=6
Bind Time 1.58s (± 1.29%) 1.58s (± 0.77%) ~ 1.57s 1.60s p=0.745 n=6
Check Time 16.48s (± 0.41%) 16.48s (± 0.23%) ~ 16.43s 16.53s p=0.936 n=6
Emit Time 0.00s 0.00s (±244.70%) ~ 0.00s 0.01s p=0.405 n=6
Total Time 20.97s (± 0.37%) 20.94s (± 0.26%) ~ 20.87s 21.01s p=0.629 n=6
vscode - node (v18.15.0, x64)
Errors 4 4 ~ ~ ~ p=1.000 n=6
Symbols 3,188,837 3,188,837 ~ ~ ~ p=1.000 n=6
Types 1,096,744 1,096,744 ~ ~ ~ p=1.000 n=6
Memory used 3,263,160k (± 0.01%) 3,263,009k (± 0.01%) ~ 3,262,590k 3,263,645k p=0.471 n=6
Parse Time 14.15s (± 0.77%) 14.11s (± 0.41%) ~ 14.04s 14.20s p=0.335 n=6
Bind Time 4.60s (± 3.05%) 4.68s (± 2.49%) ~ 4.52s 4.77s p=0.519 n=6
Check Time 89.03s (± 3.25%) 86.44s (± 0.64%) ~ 85.60s 87.05s p=0.109 n=6
Emit Time 26.77s (±10.67%) 28.31s (± 2.64%) ~ 27.27s 28.90s p=0.810 n=6
Total Time 134.55s (± 0.86%) 133.54s (± 0.87%) ~ 131.82s 134.55s p=0.173 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 288,733 288,733 ~ ~ ~ p=1.000 n=6
Types 117,152 117,152 ~ ~ ~ p=1.000 n=6
Memory used 440,955k (± 0.04%) 441,009k (± 0.03%) ~ 440,883k 441,242k p=0.298 n=6
Parse Time 4.10s (± 0.51%) 4.08s (± 0.51%) ~ 4.06s 4.11s p=0.289 n=6
Bind Time 1.75s (± 3.21%) 1.74s (± 1.34%) ~ 1.71s 1.77s p=0.810 n=6
Check Time 18.87s (± 0.42%) 18.88s (± 0.29%) ~ 18.80s 18.95s p=0.936 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.72s (± 0.52%) 24.71s (± 0.27%) ~ 24.62s 24.78s p=0.689 n=6
xstate-main - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 552,390 552,390 ~ ~ ~ p=1.000 n=6
Types 185,096 185,096 ~ ~ ~ p=1.000 n=6
Memory used 492,423k (± 0.03%) 492,461k (± 0.04%) ~ 492,112k 492,640k p=0.689 n=6
Parse Time 3.40s (± 0.73%) 3.42s (± 0.35%) ~ 3.41s 3.44s p=0.283 n=6
Bind Time 1.18s (± 1.03%) 1.17s (± 1.17%) ~ 1.16s 1.19s p=0.286 n=6
Check Time 19.65s (± 1.25%) 19.55s (± 0.85%) ~ 19.40s 19.86s p=0.630 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.24s (± 1.02%) 24.14s (± 0.65%) ~ 24.01s 24.44s p=0.521 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@gabritto Here are the results of running the top 400 repos with tsc comparing main and refs/pull/60644/merge:

Everything looks good!

@gabritto
Copy link
Member

gabritto commented Dec 2, 2024

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 2, 2024

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
pack this ✅ Started ✅ Results

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 2, 2024

Hey @gabritto, 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/164255/artifacts?artifactName=tgz&fileId=EE4806BE35BC77ED3673245ECA2612801A455CE794E0A2BBF4926021973E02A302&fileName=/typescript-5.8.0-insiders.20241202.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@5.8.0-pr-60644-12".;

@gabritto gabritto merged commit 14c65b3 into microsoft:main Dec 2, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Status: Done
5 participants