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

Fixed regression in generic signature instantiation with default type args #59510

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Aug 2, 2024

fixes #86390

complements the fix from #59121 so the correct cloned type parameter is used as the inference target

cc @weswigham

@typescript-bot typescript-bot added the For Milestone Bug PRs that fix a bug with a specific milestone label Aug 2, 2024
@jakebailey
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 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 @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/59510/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,901k (± 0.72%) 194,122k (± 1.00%) ~ 192,316k 195,907k p=0.173 n=6
Parse Time 1.57s (± 0.74%) 1.56s (± 0.91%) ~ 1.54s 1.58s p=0.325 n=6
Bind Time 0.86s (± 1.36%) 0.86s (± 0.95%) ~ 0.85s 0.87s p=0.738 n=6
Check Time 11.39s (± 0.33%) 11.38s (± 0.30%) ~ 11.33s 11.43s p=0.627 n=6
Emit Time 3.26s (± 0.75%) 3.26s (± 0.69%) ~ 3.23s 3.29s p=0.683 n=6
Total Time 17.08s (± 0.32%) 17.05s (± 0.12%) ~ 17.02s 17.08s p=0.518 n=6
angular-1 - node (v18.15.0, x64)
Errors 7 7 ~ ~ ~ p=1.000 n=6
Symbols 945,537 945,537 ~ ~ ~ p=1.000 n=6
Types 409,512 409,512 ~ ~ ~ p=1.000 n=6
Memory used 1,222,226k (± 0.00%) 1,222,246k (± 0.00%) ~ 1,222,204k 1,222,286k p=0.378 n=6
Parse Time 7.86s (± 0.29%) 7.88s (± 0.56%) ~ 7.84s 7.96s p=0.571 n=6
Bind Time 2.21s (± 0.44%) 2.22s (± 1.44%) ~ 2.19s 2.28s p=0.932 n=6
Check Time 36.22s (± 0.45%) 36.22s (± 0.42%) ~ 35.99s 36.40s p=1.000 n=6
Emit Time 17.75s (± 0.64%) 17.75s (± 0.52%) ~ 17.59s 17.84s p=0.810 n=6
Total Time 64.04s (± 0.32%) 64.07s (± 0.33%) ~ 63.87s 64.44s p=0.936 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,439,302 2,439,302 ~ ~ ~ p=1.000 n=6
Types 1,004,512 1,004,512 ~ ~ ~ p=1.000 n=6
Memory used 2,412,743k (± 0.00%) 2,412,746k (± 0.00%) ~ 2,412,683k 2,412,830k p=0.936 n=6
Parse Time 8.51s (± 0.22%) 8.48s (± 0.18%) ~ 8.47s 8.51s p=0.071 n=6
Bind Time 2.08s (± 0.43%) 2.08s (± 0.26%) ~ 2.07s 2.08s p=0.341 n=6
Check Time 75.06s (± 0.94%) 75.04s (± 1.38%) ~ 74.24s 76.95s p=0.689 n=6
Emit Time 0.28s (± 2.70%) 0.28s (± 1.92%) ~ 0.28s 0.29s p=0.137 n=6
Total Time 85.93s (± 0.83%) 85.88s (± 1.20%) ~ 85.09s 87.78s p=0.575 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,227,919 1,227,922 +3 (+ 0.00%) ~ ~ p=0.001 n=6
Types 265,192 265,193 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,524,979k (±11.77%) 2,465,591k (±11.75%) ~ 2,346,774k 3,057,676k p=0.471 n=6
Parse Time 7.47s (± 0.85%) 7.47s (± 1.59%) ~ 7.39s 7.71s p=0.748 n=6
Bind Time 2.78s (± 1.17%) 2.78s (± 1.00%) ~ 2.73s 2.81s p=0.569 n=6
Check Time 50.64s (± 0.84%) 50.69s (± 0.54%) ~ 50.35s 51.06s p=1.000 n=6
Emit Time 4.98s (± 3.54%) 5.06s (± 4.04%) ~ 4.86s 5.31s p=0.689 n=6
Total Time 65.91s (± 0.82%) 66.01s (± 0.29%) ~ 65.80s 66.35s p=0.748 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,227,919 1,227,922 +3 (+ 0.00%) ~ ~ p=0.001 n=6
Types 265,192 265,193 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,420,997k (± 0.03%) 2,446,464k (± 2.59%) ~ 2,419,813k 2,576,143k p=0.810 n=6
Parse Time 6.22s (± 0.60%) 6.24s (± 0.76%) ~ 6.17s 6.31s p=0.520 n=6
Bind Time 2.05s (± 0.82%) 2.04s (± 0.51%) ~ 2.02s 2.05s p=0.138 n=6
Check Time 41.15s (± 0.26%) 41.41s (± 0.67%) ~ 41.19s 41.93s p=0.054 n=6
Emit Time 4.09s (± 3.17%) 4.05s (± 1.14%) ~ 3.99s 4.13s p=0.936 n=6
Total Time 53.53s (± 0.37%) 53.75s (± 0.53%) ~ 53.50s 54.28s p=0.173 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 256,031 256,034 +3 (+ 0.00%) ~ ~ p=0.001 n=6
Types 104,976 104,977 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 427,931k (± 0.02%) 427,900k (± 0.01%) ~ 427,848k 428,007k p=0.873 n=6
Parse Time 4.16s (± 0.33%) 4.15s (± 0.53%) ~ 4.12s 4.18s p=0.565 n=6
Bind Time 1.64s (± 0.67%) 1.62s (± 1.56%) ~ 1.57s 1.64s p=0.063 n=6
Check Time 22.19s (± 0.53%) 22.28s (± 0.35%) ~ 22.18s 22.38s p=0.298 n=6
Emit Time 2.02s (± 0.92%) 2.03s (± 0.88%) ~ 2.00s 2.05s p=0.685 n=6
Total Time 30.01s (± 0.38%) 30.08s (± 0.36%) ~ 29.92s 30.23s p=0.335 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 35 ~ ~ ~ p=1.000 n=6
Symbols 224,931 224,931 ~ ~ ~ p=1.000 n=6
Types 94,146 94,146 ~ ~ ~ p=1.000 n=6
Memory used 370,126k (± 0.03%) 370,176k (± 0.02%) ~ 370,060k 370,321k p=0.230 n=6
Parse Time 2.76s (± 0.59%) 2.77s (± 0.71%) ~ 2.74s 2.79s p=0.370 n=6
Bind Time 1.58s (± 1.16%) 1.58s (± 0.93%) ~ 1.56s 1.60s p=0.681 n=6
Check Time 15.67s (± 0.21%) 15.65s (± 0.31%) ~ 15.57s 15.71s p=0.469 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.01s (± 0.28%) 19.99s (± 0.30%) ~ 19.90s 20.07s p=1.000 n=6
vscode - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,990,754 2,990,754 ~ ~ ~ p=1.000 n=6
Types 1,029,099 1,029,099 ~ ~ ~ p=1.000 n=6
Memory used 3,115,966k (± 0.00%) 3,115,936k (± 0.00%) ~ 3,115,873k 3,116,073k p=0.230 n=6
Parse Time 16.95s (± 0.30%) 16.97s (± 0.52%) ~ 16.82s 17.08s p=0.470 n=6
Bind Time 5.30s (± 2.62%) 5.23s (± 1.88%) ~ 5.17s 5.43s p=1.000 n=6
Check Time 95.82s (± 0.50%) 95.42s (± 0.27%) ~ 95.17s 95.86s p=0.128 n=6
Emit Time 24.95s (± 0.48%) 24.92s (± 0.35%) ~ 24.78s 25.03s p=0.686 n=6
Total Time 143.03s (± 0.29%) 142.53s (± 0.20%) -0.49s (- 0.34%) 142.05s 142.85s p=0.045 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 267,972 267,972 ~ ~ ~ p=1.000 n=6
Types 109,178 109,178 ~ ~ ~ p=1.000 n=6
Memory used 412,926k (± 0.01%) 412,908k (± 0.01%) ~ 412,837k 412,959k p=0.575 n=6
Parse Time 3.17s (± 0.65%) 3.19s (± 0.33%) ~ 3.17s 3.20s p=0.141 n=6
Bind Time 1.43s (± 0.77%) 1.43s (± 0.57%) ~ 1.42s 1.44s p=0.448 n=6
Check Time 14.37s (± 0.39%) 14.36s (± 0.14%) ~ 14.33s 14.38s p=0.334 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 18.97s (± 0.32%) 18.98s (± 0.14%) ~ 18.93s 19.00s p=0.936 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 538,543 538,543 ~ ~ ~ p=1.000 n=6
Types 176,469 176,469 ~ ~ ~ p=1.000 n=6
Memory used 481,362k (± 0.01%) 481,358k (± 0.01%) ~ 481,296k 481,421k p=0.936 n=6
Parse Time 2.83s (± 0.66%) 2.83s (± 0.47%) ~ 2.81s 2.84s p=0.359 n=6
Bind Time 1.05s (± 0.72%) 1.05s (± 0.78%) ~ 1.03s 1.05s p=1.000 n=6
Check Time 15.26s (± 0.30%) 15.24s (± 0.22%) ~ 15.19s 15.29s p=0.421 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 19.14s (± 0.31%) 19.12s (± 0.21%) ~ 19.08s 19.18s p=0.517 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/59510/merge:

Everything looks good!

Copy link
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

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

Needs a merge conflict resolved before it can be merged - but I"m starting to think it"d be nice to pull sameMap(signature.typeParameters!, tp => tp.mapper ? instantiateType(tp, tp.mapper) : tp) into a helper function like getTypeParametersForMapper(signature) for the two locations we use it (an inference context is a type mapper).

@Andarist
Copy link
Contributor Author

Andarist commented Aug 7, 2024

done and done :)

@jakebailey
Copy link
Member

@typescript-bot cherry-pick to release-5.5

This is the same fix as #59121 which we also backported to 5.5.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 9, 2024

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

Command Status Results
cherry-pick to release-5.5 ✅ Started ✅ Results

@typescript-bot
Copy link
Collaborator

Hey, @jakebailey! I"ve created #59570 for you.

@jakebailey jakebailey merged commit 1bb1d2a into microsoft:main Aug 9, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Milestone Bug PRs that fix a bug with a specific milestone
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

React"s ComponentProps type issues in TypeScript 5.5.4
4 participants