Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Narrow types by satisfies expressions #60782

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

Merged

Conversation

Andarist
Copy link
Contributor

fixes #60778

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Dec 17, 2024
@Andarist Andarist force-pushed the narrow-type-on-satisfies-expressions branch from f468771 to 6a7ab24 Compare December 17, 2024 09:16
@jakebailey
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 22, 2025

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

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

Everything looks good!

@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
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,390 62,390 ~ ~ ~ p=1.000 n=6
Types 50,395 50,395 ~ ~ ~ p=1.000 n=6
Memory used 193,713k (± 0.80%) 193,175k (± 0.08%) ~ 193,090k 193,491k p=0.108 n=6
Parse Time 1.30s (± 1.06%) 1.31s (± 0.80%) ~ 1.29s 1.32s p=1.000 n=6
Bind Time 0.73s 0.73s ~ ~ ~ p=1.000 n=6
Check Time 9.77s (± 0.32%) 9.79s (± 0.39%) ~ 9.75s 9.85s p=0.294 n=6
Emit Time 2.74s (± 0.65%) 2.73s (± 0.82%) ~ 2.71s 2.77s p=0.256 n=6
Total Time 14.54s (± 0.26%) 14.55s (± 0.33%) ~ 14.50s 14.64s p=0.936 n=6
angular-1 - node (v18.15.0, x64)
Errors 37 37 ~ ~ ~ p=1.000 n=6
Symbols 947,987 947,987 ~ ~ ~ p=1.000 n=6
Types 410,955 410,955 ~ ~ ~ p=1.000 n=6
Memory used 1,225,696k (± 0.00%) 1,225,690k (± 0.00%) ~ 1,225,643k 1,225,731k p=0.936 n=6
Parse Time 6.64s (± 0.66%) 6.67s (± 0.29%) ~ 6.64s 6.70s p=0.406 n=6
Bind Time 1.90s (± 0.62%) 1.89s (± 0.62%) ~ 1.88s 1.91s p=0.365 n=6
Check Time 32.01s (± 0.43%) 31.91s (± 0.36%) ~ 31.80s 32.11s p=0.261 n=6
Emit Time 15.18s (± 0.34%) 15.17s (± 0.40%) ~ 15.08s 15.24s p=0.630 n=6
Total Time 55.73s (± 0.19%) 55.64s (± 0.25%) ~ 55.46s 55.86s p=0.378 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,444,319 2,444,319 ~ ~ ~ p=1.000 n=6
Types 896,761 896,761 ~ ~ ~ p=1.000 n=6
Memory used 2,302,947k (± 0.00%) 2,302,946k (± 0.00%) ~ 2,302,895k 2,303,002k p=0.936 n=6
Parse Time 8.93s (± 0.11%) 8.94s (± 0.19%) ~ 8.92s 8.97s p=0.157 n=6
Bind Time 2.17s (± 0.54%) 2.19s (± 0.63%) ~ 2.17s 2.21s p=0.121 n=6
Check Time 73.49s (± 0.41%) 73.59s (± 0.56%) ~ 73.07s 74.26s p=0.810 n=6
Emit Time 0.28s (± 1.45%) 0.28s (± 4.15%) ~ 0.27s 0.30s p=0.858 n=6
Total Time 84.87s (± 0.36%) 84.99s (± 0.51%) ~ 84.48s 85.71s p=0.689 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,228,792 1,228,793 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 266,906 266,907 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,360,258k (± 0.02%) 2,360,456k (± 0.02%) ~ 2,359,934k 2,361,154k p=0.575 n=6
Parse Time 5.22s (± 0.88%) 5.23s (± 0.83%) ~ 5.18s 5.30s p=0.688 n=6
Bind Time 1.76s (± 0.36%) 1.78s (± 0.84%) +0.02s (+ 1.33%) 1.76s 1.80s p=0.019 n=6
Check Time 35.18s (± 0.23%) 35.26s (± 0.31%) ~ 35.13s 35.45s p=0.173 n=6
Emit Time 3.01s (± 1.98%) 3.01s (± 1.09%) ~ 2.95s 3.05s p=0.419 n=6
Total Time 45.18s (± 0.21%) 45.28s (± 0.24%) ~ 45.15s 45.46s p=0.230 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,228,792 1,228,793 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 266,906 266,907 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 3,036,058k (± 9.76%) 2,915,600k (±12.85%) ~ 2,431,405k 3,158,493k p=1.000 n=6
Parse Time 6.96s (± 0.99%) 6.90s (± 2.10%) ~ 6.70s 7.07s p=0.575 n=6
Bind Time 2.12s (± 1.22%) 2.15s (± 1.33%) ~ 2.11s 2.19s p=0.126 n=6
Check Time 42.78s (± 0.41%) 42.80s (± 0.25%) ~ 42.65s 42.94s p=1.000 n=6
Emit Time 3.48s (± 2.77%) 3.43s (± 3.19%) ~ 3.32s 3.58s p=0.336 n=6
Total Time 55.34s (± 0.33%) 55.28s (± 0.53%) ~ 54.88s 55.64s p=0.936 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 262,659 262,660 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 106,711 106,712 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 440,798k (± 0.03%) 440,825k (± 0.02%) ~ 440,708k 440,898k p=0.810 n=6
Parse Time 3.56s (± 0.77%) 3.57s (± 0.82%) ~ 3.54s 3.61s p=0.293 n=6
Bind Time 1.32s (± 1.30%) 1.33s (± 0.56%) ~ 1.32s 1.34s p=0.273 n=6
Check Time 19.09s (± 0.38%) 19.05s (± 0.40%) ~ 18.93s 19.16s p=0.747 n=6
Emit Time 1.52s (± 0.79%) 1.53s (± 0.99%) ~ 1.50s 1.54s p=0.806 n=6
Total Time 25.49s (± 0.31%) 25.48s (± 0.24%) ~ 25.39s 25.54s p=0.628 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 70 70 ~ ~ ~ p=1.000 n=6
Symbols 226,113 226,113 ~ ~ ~ p=1.000 n=6
Types 94,488 94,488 ~ ~ ~ p=1.000 n=6
Memory used 371,688k (± 0.01%) 371,710k (± 0.05%) ~ 371,573k 372,043k p=0.471 n=6
Parse Time 2.90s (± 1.48%) 2.89s (± 1.11%) ~ 2.86s 2.94s p=0.687 n=6
Bind Time 1.61s (± 1.27%) 1.60s (± 1.57%) ~ 1.55s 1.62s p=0.625 n=6
Check Time 16.46s (± 0.40%) 16.49s (± 0.40%) ~ 16.40s 16.60s p=0.567 n=6
Emit Time 0.00s (±244.70%) 0.00s ~ ~ ~ p=0.405 n=6
Total Time 20.97s (± 0.54%) 20.98s (± 0.13%) ~ 20.95s 21.01s p=0.934 n=6
vscode - node (v18.15.0, x64)
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 3,258,890 3,258,890 ~ ~ ~ p=1.000 n=6
Types 1,120,678 1,120,678 ~ ~ ~ p=1.000 n=6
Memory used 3,333,181k (± 0.01%) 3,333,020k (± 0.01%) ~ 3,332,578k 3,333,531k p=0.689 n=6
Parse Time 14.59s (± 0.67%) 14.56s (± 0.25%) ~ 14.52s 14.62s p=0.936 n=6
Bind Time 4.58s (± 0.30%) 4.59s (± 0.32%) ~ 4.57s 4.61s p=0.120 n=6
Check Time 90.44s (± 2.16%) 90.42s (± 2.09%) ~ 88.50s 92.47s p=1.000 n=6
Emit Time 27.82s (± 3.46%) 28.50s (± 2.82%) ~ 27.43s 29.13s p=0.471 n=6
Total Time 137.42s (± 1.39%) 138.07s (± 1.45%) ~ 135.34s 140.59s p=0.575 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 291,613 291,613 ~ ~ ~ p=1.000 n=6
Types 118,977 118,977 ~ ~ ~ p=1.000 n=6
Memory used 445,482k (± 0.03%) 445,322k (± 0.01%) -160k (- 0.04%) 445,252k 445,408k p=0.008 n=6
Parse Time 5.08s (± 0.81%) 5.05s (± 0.91%) ~ 4.99s 5.10s p=0.170 n=6
Bind Time 2.23s (± 1.41%) 2.22s (± 1.75%) ~ 2.16s 2.28s p=0.745 n=6
Check Time 23.36s (± 0.27%) 23.35s (± 0.26%) ~ 23.28s 23.44s p=0.810 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 30.68s (± 0.10%) 30.62s (± 0.26%) ~ 30.49s 30.72s p=0.198 n=6
xstate-main - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 555,068 555,068 ~ ~ ~ p=1.000 n=6
Types 186,115 186,115 ~ ~ ~ p=1.000 n=6
Memory used 494,042k (± 0.01%) 494,018k (± 0.02%) ~ 493,784k 494,069k p=0.297 n=6
Parse Time 3.40s (± 0.40%) 3.42s (± 0.54%) ~ 3.38s 3.43s p=0.156 n=6
Bind Time 1.18s (± 1.24%) 1.18s (± 1.03%) ~ 1.16s 1.19s p=0.564 n=6
Check Time 19.54s (± 0.49%) 19.74s (± 2.10%) ~ 19.50s 20.58s p=0.423 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.13s (± 0.43%) 24.34s (± 1.68%) ~ 24.09s 25.16s p=0.297 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/60782/merge:

Everything looks good!

Copy link
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.

LGTM; #60778 is marked experience enhancement so this should be good to go.

@jakebailey jakebailey merged commit efe07a0 into microsoft:main Jan 22, 2025
32 checks passed
@Andarist Andarist deleted the narrow-type-on-satisfies-expressions branch January 22, 2025 22:13
@sandersn sandersn removed this from PR Backlog Apr 22, 2025
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion: allow type predicates to be inferred when satisfies boolean is present
3 participants