Skip to content

Fix of #58996 - #59155

Merged
Jake Bailey (jakebailey) merged 2 commits into
microsoft:mainfrom
MichalMarsalek:fix-58996
Feb 20, 2025
Merged

Fix of #58996#59155
Jake Bailey (jakebailey) merged 2 commits into
microsoft:mainfrom
MichalMarsalek:fix-58996

Conversation

@MichalMarsalek

Copy link
Copy Markdown
Contributor
  • 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-botTypeScript Bot (typescript-bot) added the For Backlog Bug PRs that fix a backlog bug label Jul 6, 2024
@MichalMarsalek

Copy link
Copy Markdown
ContributorAuthor

@microsoft-github-policy-service agree

// 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
Copy Markdown
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
Copy Markdown
Member

TypeScript Bot (@typescript-bot) test it

@typescript-bot

TypeScript Bot (typescript-bot) commented Jul 8, 2024

Copy link
Copy Markdown
Contributor

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

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

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Jake Bailey (@jakebailey), 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
Contributor

Jake Bailey (@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
Copy Markdown
Contributor

Jake Bailey (@jakebailey)
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols62,15362,153~~~p=1.000 n=6
Types50,24250,242~~~p=1.000 n=6
Memory used192,842k (± 0.76%)192,834k (± 0.75%)~192,185k195,763kp=1.000 n=6
Parse Time1.31s (± 0.48%)1.31s (± 1.33%)~1.28s1.33sp=0.236 n=6
Bind Time0.71s (± 0.58%)0.71s~~~p=0.405 n=6
Check Time9.46s (± 0.40%)9.42s (± 0.55%)~9.36s9.49sp=0.228 n=6
Emit Time2.77s (± 0.75%)2.76s (± 0.67%)~2.73s2.78sp=0.570 n=6
Total Time14.24s (± 0.34%)14.20s (± 0.38%)~14.15s14.29sp=0.148 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,114944,114~~~p=1.000 n=6
Types407,050407,050~~~p=1.000 n=6
Memory used1,218,400k (± 0.00%)1,218,402k (± 0.00%)~1,218,352k1,218,447kp=0.810 n=6
Parse Time6.65s (± 0.72%)6.69s (± 0.27%)~6.67s6.72sp=0.193 n=6
Bind Time1.86s (± 0.55%)1.87s (± 0.28%)~1.86s1.87sp=0.774 n=6
Check Time30.65s (± 0.54%)30.66s (± 0.37%)~30.48s30.78sp=0.688 n=6
Emit Time13.56s (± 0.39%)13.59s (± 0.30%)~13.56s13.67sp=0.572 n=6
Total Time52.73s (± 0.39%)52.81s (± 0.28%)~52.61s53.03sp=0.298 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,130,3432,130,343~~~p=1.000 n=6
Types927,684927,684~~~p=1.000 n=6
Memory used2,107,222k (± 0.00%)2,107,230k (± 0.00%)~2,107,132k2,107,273kp=0.686 n=6
Parse Time6.61s (± 0.06%)6.61s (± 0.18%)~6.60s6.63sp=0.849 n=6
Bind Time2.33s (± 0.57%)2.33s (± 0.63%)~2.32s2.36sp=0.863 n=6
Check Time70.63s (± 0.34%)70.72s (± 0.23%)~70.48s70.98sp=0.630 n=6
Emit Time0.14s (± 3.77%)0.14s (± 2.95%)~0.13s0.14sp=0.595 n=6
Total Time79.71s (± 0.31%)79.80s (± 0.22%)~79.55s80.08sp=0.630 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,225,4971,225,567+70 (+ 0.01%)~~p=0.001 n=6
Types261,459261,466+7 (+ 0.00%)~~p=0.001 n=6
Memory used2,340,472k (± 0.03%)2,340,659k (± 0.02%)~2,339,888k2,340,925kp=0.471 n=6
Parse Time5.04s (± 0.81%)5.03s (± 0.60%)~4.99s5.07sp=0.521 n=6
Bind Time1.93s (± 1.56%)1.90s (± 0.47%)~1.89s1.91sp=0.122 n=6
Check Time34.17s (± 0.40%)34.17s (± 0.22%)~34.08s34.28sp=0.689 n=6
Emit Time2.62s (± 3.60%)2.61s (± 1.77%)~2.56s2.69sp=1.000 n=6
Total Time43.79s (± 0.36%)43.73s (± 0.18%)~43.68s43.88sp=1.000 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,225,4971,225,567+70 (+ 0.01%)~~p=0.001 n=6
Types261,459261,466+7 (+ 0.00%)~~p=0.001 n=6
Memory used2,415,414k (± 0.02%)2,414,860k (± 0.03%)~2,413,945k2,415,665kp=0.261 n=6
Parse Time6.25s (± 0.71%)6.29s (± 0.49%)~6.23s6.32sp=0.128 n=6
Bind Time2.03s (± 1.11%)2.03s (± 1.20%)~2.00s2.07sp=1.000 n=6
Check Time40.74s (± 0.32%)40.81s (± 0.44%)~40.62s41.12sp=0.936 n=6
Emit Time3.11s (± 0.70%)3.25s (± 5.17%)🔻+0.13s (+ 4.28%)3.12s3.58sp=0.013 n=6
Total Time52.14s (± 0.24%)52.40s (± 0.43%)~52.16s52.68sp=0.066 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols258,195258,265+70 (+ 0.03%)~~p=0.001 n=6
Types104,737104,744+7 (+ 0.01%)~~p=0.001 n=6
Memory used427,493k (± 0.01%)427,545k (± 0.01%)+52k (+ 0.01%)427,513k427,571kp=0.020 n=6
Parse Time4.09s (± 0.72%)4.07s (± 0.26%)~4.05s4.08sp=0.118 n=6
Bind Time1.63s (± 1.27%)1.64s (± 0.54%)~1.63s1.65sp=0.285 n=6
Check Time22.02s (± 0.37%)22.01s (± 0.36%)~21.90s22.09sp=1.000 n=6
Emit Time1.54s (± 0.96%)1.54s (± 1.44%)~1.51s1.57sp=0.806 n=6
Total Time29.28s (± 0.29%)29.26s (± 0.29%)~29.14s29.37sp=1.000 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,565224,565~~~p=1.000 n=6
Types93,73493,734~~~p=1.000 n=6
Memory used369,540k (± 0.03%)369,546k (± 0.02%)~369,429k369,636kp=0.689 n=6
Parse Time3.45s (± 0.90%)3.44s (± 0.72%)~3.41s3.48sp=0.517 n=6
Bind Time1.93s (± 1.16%)1.93s (± 0.73%)~1.91s1.95sp=1.000 n=6
Check Time19.14s (± 0.30%)19.13s (± 0.19%)~19.06s19.16sp=0.334 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time24.53s (± 0.21%)24.50s (± 0.27%)~24.38s24.56sp=0.470 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,884,0092,884,016+7 (+ 0.00%)~~p=0.001 n=6
Types976,263976,264+1 (+ 0.00%)~~p=0.001 n=6
Memory used3,047,014k (± 0.00%)3,047,075k (± 0.00%)~3,046,938k3,047,191kp=0.298 n=6
Parse Time16.91s (± 0.36%)16.93s (± 0.74%)~16.83s17.18sp=1.000 n=6
Bind Time5.14s (± 1.78%)5.21s (± 1.93%)~5.09s5.31sp=0.335 n=6
Check Time90.78s (± 2.25%)91.00s (± 2.94%)~88.97s94.75sp=1.000 n=6
Emit Time27.97s (± 7.32%)27.66s (± 8.91%)~24.38s29.55sp=0.471 n=6
Total Time140.81s (± 0.18%)140.80s (± 0.26%)~140.39s141.34sp=0.810 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols267,117267,117~~~p=1.000 n=6
Types108,775108,775~~~p=1.000 n=6
Memory used411,605k (± 0.02%)411,616k (± 0.02%)~411,521k411,700kp=0.575 n=6
Parse Time4.69s (± 0.57%)4.69s (± 0.62%)~4.66s4.74sp=0.935 n=6
Bind Time2.08s (± 0.73%)2.08s (± 0.59%)~2.07s2.10sp=0.271 n=6
Check Time20.83s (± 0.36%)20.81s (± 0.32%)~20.71s20.87sp=0.574 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time27.60s (± 0.32%)27.58s (± 0.29%)~27.45s27.66sp=0.748 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols525,251525,251~~~p=1.000 n=6
Types178,574178,574~~~p=1.000 n=6
Memory used462,833k (± 0.08%)462,626k (± 0.08%)~462,329k463,101kp=0.575 n=6
Parse Time3.18s (± 0.71%)3.17s (± 0.75%)~3.14s3.21sp=0.809 n=6
Bind Time1.17s (± 0.44%)1.17s~~~p=0.174 n=6
Check Time17.92s (± 0.40%)17.92s (± 0.88%)~17.68s18.14sp=1.000 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time22.26s (± 0.36%)22.25s (± 0.75%)~22.02s22.49sp=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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@typescript-bot

Copy link
Copy Markdown
Contributor

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

Everything looks good!

@jakebaileyJake Bailey (jakebailey) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe this is correct, yes?

@jakebailey

Copy link
Copy Markdown
Member

I think I meant to merge this back when I reviewed it; I can merge main if you'd like.

@MichalMarsalek

Copy link
Copy Markdown
ContributorAuthor

Sure!

@jakebailey
Jake Bailey (jakebailey) merged commit 12c2323 into microsoft:mainFeb 20, 2025
@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Backlog BugPRs that fix a backlog bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filter with "something is smallerType" don't work as negative

7 participants

@MichalMarsalek@jakebailey@typescript-bot@Andarist@sandersn@weswigham@andrewbranch