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

Fix of #58996 #59155

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

MichalMarsalek
Copy link

  • There is an associated issue in the Backlog milestone (required)
  • Code is up-to-date with the main branch
  • You've successfully run hereby runtests locally
  • There are new or updated unit tests validating the change

Fixes #58996
The issue was that the type Animal & Rock was not getting reduced to never and therefore the check failed.

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Jul 6, 2024
@MichalMarsalek
Copy link
Author

@microsoft-github-policy-service agree

@@ -38409,7 +38409,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
// "x is T" means that x is T if and only if it returns true. If it returns false then x is not T.
// This means that if the function is called with an argument of type trueType, there can't be anything left in the `else` branch. It must reduce to `never`.
const falseCondition = createFlowNode(FlowFlags.FalseCondition, expr, antecedent);
const falseSubtype = getFlowTypeOfReference(param.name, initType, trueType, func, falseCondition);
const falseSubtype = getReducedType(getFlowTypeOfReference(param.name, initType, trueType, func, falseCondition));
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice find 👍

@jakebailey
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 8, 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 @jakebailey, the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@typescript-bot
Copy link
Collaborator

@jakebailey
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 30 30 ~ ~ ~ p=1.000 n=6
Symbols 62,153 62,153 ~ ~ ~ p=1.000 n=6
Types 50,242 50,242 ~ ~ ~ p=1.000 n=6
Memory used 192,842k (± 0.76%) 192,834k (± 0.75%) ~ 192,185k 195,763k p=1.000 n=6
Parse Time 1.31s (± 0.48%) 1.31s (± 1.33%) ~ 1.28s 1.33s p=0.236 n=6
Bind Time 0.71s (± 0.58%) 0.71s ~ ~ ~ p=0.405 n=6
Check Time 9.46s (± 0.40%) 9.42s (± 0.55%) ~ 9.36s 9.49s p=0.228 n=6
Emit Time 2.77s (± 0.75%) 2.76s (± 0.67%) ~ 2.73s 2.78s p=0.570 n=6
Total Time 14.24s (± 0.34%) 14.20s (± 0.38%) ~ 14.15s 14.29s p=0.148 n=6
angular-1 - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 944,114 944,114 ~ ~ ~ p=1.000 n=6
Types 407,050 407,050 ~ ~ ~ p=1.000 n=6
Memory used 1,218,400k (± 0.00%) 1,218,402k (± 0.00%) ~ 1,218,352k 1,218,447k p=0.810 n=6
Parse Time 6.65s (± 0.72%) 6.69s (± 0.27%) ~ 6.67s 6.72s p=0.193 n=6
Bind Time 1.86s (± 0.55%) 1.87s (± 0.28%) ~ 1.86s 1.87s p=0.774 n=6
Check Time 30.65s (± 0.54%) 30.66s (± 0.37%) ~ 30.48s 30.78s p=0.688 n=6
Emit Time 13.56s (± 0.39%) 13.59s (± 0.30%) ~ 13.56s 13.67s p=0.572 n=6
Total Time 52.73s (± 0.39%) 52.81s (± 0.28%) ~ 52.61s 53.03s p=0.298 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,130,343 2,130,343 ~ ~ ~ p=1.000 n=6
Types 927,684 927,684 ~ ~ ~ p=1.000 n=6
Memory used 2,107,222k (± 0.00%) 2,107,230k (± 0.00%) ~ 2,107,132k 2,107,273k p=0.686 n=6
Parse Time 6.61s (± 0.06%) 6.61s (± 0.18%) ~ 6.60s 6.63s p=0.849 n=6
Bind Time 2.33s (± 0.57%) 2.33s (± 0.63%) ~ 2.32s 2.36s p=0.863 n=6
Check Time 70.63s (± 0.34%) 70.72s (± 0.23%) ~ 70.48s 70.98s p=0.630 n=6
Emit Time 0.14s (± 3.77%) 0.14s (± 2.95%) ~ 0.13s 0.14s p=0.595 n=6
Total Time 79.71s (± 0.31%) 79.80s (± 0.22%) ~ 79.55s 80.08s p=0.630 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,225,497 1,225,567 +70 (+ 0.01%) ~ ~ p=0.001 n=6
Types 261,459 261,466 +7 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,340,472k (± 0.03%) 2,340,659k (± 0.02%) ~ 2,339,888k 2,340,925k p=0.471 n=6
Parse Time 5.04s (± 0.81%) 5.03s (± 0.60%) ~ 4.99s 5.07s p=0.521 n=6
Bind Time 1.93s (± 1.56%) 1.90s (± 0.47%) ~ 1.89s 1.91s p=0.122 n=6
Check Time 34.17s (± 0.40%) 34.17s (± 0.22%) ~ 34.08s 34.28s p=0.689 n=6
Emit Time 2.62s (± 3.60%) 2.61s (± 1.77%) ~ 2.56s 2.69s p=1.000 n=6
Total Time 43.79s (± 0.36%) 43.73s (± 0.18%) ~ 43.68s 43.88s p=1.000 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,225,497 1,225,567 +70 (+ 0.01%) ~ ~ p=0.001 n=6
Types 261,459 261,466 +7 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,415,414k (± 0.02%) 2,414,860k (± 0.03%) ~ 2,413,945k 2,415,665k p=0.261 n=6
Parse Time 6.25s (± 0.71%) 6.29s (± 0.49%) ~ 6.23s 6.32s p=0.128 n=6
Bind Time 2.03s (± 1.11%) 2.03s (± 1.20%) ~ 2.00s 2.07s p=1.000 n=6
Check Time 40.74s (± 0.32%) 40.81s (± 0.44%) ~ 40.62s 41.12s p=0.936 n=6
Emit Time 3.11s (± 0.70%) 3.25s (± 5.17%) 🔻+0.13s (+ 4.28%) 3.12s 3.58s p=0.013 n=6
Total Time 52.14s (± 0.24%) 52.40s (± 0.43%) ~ 52.16s 52.68s p=0.066 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 258,195 258,265 +70 (+ 0.03%) ~ ~ p=0.001 n=6
Types 104,737 104,744 +7 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 427,493k (± 0.01%) 427,545k (± 0.01%) +52k (+ 0.01%) 427,513k 427,571k p=0.020 n=6
Parse Time 4.09s (± 0.72%) 4.07s (± 0.26%) ~ 4.05s 4.08s p=0.118 n=6
Bind Time 1.63s (± 1.27%) 1.64s (± 0.54%) ~ 1.63s 1.65s p=0.285 n=6
Check Time 22.02s (± 0.37%) 22.01s (± 0.36%) ~ 21.90s 22.09s p=1.000 n=6
Emit Time 1.54s (± 0.96%) 1.54s (± 1.44%) ~ 1.51s 1.57s p=0.806 n=6
Total Time 29.28s (± 0.29%) 29.26s (± 0.29%) ~ 29.14s 29.37s p=1.000 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 35 ~ ~ ~ p=1.000 n=6
Symbols 224,565 224,565 ~ ~ ~ p=1.000 n=6
Types 93,734 93,734 ~ ~ ~ p=1.000 n=6
Memory used 369,540k (± 0.03%) 369,546k (± 0.02%) ~ 369,429k 369,636k p=0.689 n=6
Parse Time 3.45s (± 0.90%) 3.44s (± 0.72%) ~ 3.41s 3.48s p=0.517 n=6
Bind Time 1.93s (± 1.16%) 1.93s (± 0.73%) ~ 1.91s 1.95s p=1.000 n=6
Check Time 19.14s (± 0.30%) 19.13s (± 0.19%) ~ 19.06s 19.16s p=0.334 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.53s (± 0.21%) 24.50s (± 0.27%) ~ 24.38s 24.56s p=0.470 n=6
vscode - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,884,009 2,884,016 +7 (+ 0.00%) ~ ~ p=0.001 n=6
Types 976,263 976,264 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 3,047,014k (± 0.00%) 3,047,075k (± 0.00%) ~ 3,046,938k 3,047,191k p=0.298 n=6
Parse Time 16.91s (± 0.36%) 16.93s (± 0.74%) ~ 16.83s 17.18s p=1.000 n=6
Bind Time 5.14s (± 1.78%) 5.21s (± 1.93%) ~ 5.09s 5.31s p=0.335 n=6
Check Time 90.78s (± 2.25%) 91.00s (± 2.94%) ~ 88.97s 94.75s p=1.000 n=6
Emit Time 27.97s (± 7.32%) 27.66s (± 8.91%) ~ 24.38s 29.55s p=0.471 n=6
Total Time 140.81s (± 0.18%) 140.80s (± 0.26%) ~ 140.39s 141.34s p=0.810 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 267,117 267,117 ~ ~ ~ p=1.000 n=6
Types 108,775 108,775 ~ ~ ~ p=1.000 n=6
Memory used 411,605k (± 0.02%) 411,616k (± 0.02%) ~ 411,521k 411,700k p=0.575 n=6
Parse Time 4.69s (± 0.57%) 4.69s (± 0.62%) ~ 4.66s 4.74s p=0.935 n=6
Bind Time 2.08s (± 0.73%) 2.08s (± 0.59%) ~ 2.07s 2.10s p=0.271 n=6
Check Time 20.83s (± 0.36%) 20.81s (± 0.32%) ~ 20.71s 20.87s p=0.574 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 27.60s (± 0.32%) 27.58s (± 0.29%) ~ 27.45s 27.66s p=0.748 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 525,251 525,251 ~ ~ ~ p=1.000 n=6
Types 178,574 178,574 ~ ~ ~ p=1.000 n=6
Memory used 462,833k (± 0.08%) 462,626k (± 0.08%) ~ 462,329k 463,101k p=0.575 n=6
Parse Time 3.18s (± 0.71%) 3.17s (± 0.75%) ~ 3.14s 3.21s p=0.809 n=6
Bind Time 1.17s (± 0.44%) 1.17s ~ ~ ~ p=0.174 n=6
Check Time 17.92s (± 0.40%) 17.92s (± 0.88%) ~ 17.68s 18.14s p=1.000 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 22.26s (± 0.36%) 22.25s (± 0.75%) ~ 22.02s 22.49s p=0.810 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

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

Everything looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
5 participants