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 instantiation expression type param leak in body-less arrows #61054

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Andarist
Copy link
Contributor

fixes #61041

@typescript-bot typescript-bot added the For Milestone Bug PRs that fix a bug with a specific milestone label Jan 26, 2025
Comment on lines +6 to +8
export const test1 = <X,>(g: <A>(x: X) => X) => g<string>;
export const output1 = test1<number>((y: number) => 1);
output1(1);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The leaked type param was filtered out by the call to isTypeParameterPossiblyReferenced in getObjectTypeInstantiation. It was crucial for the bug that a body-less arrow function returned the instantiation expression. With a block function body isTypeParameterPossiblyReferenced would already return true.

@jakebailey
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 27, 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/61054/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,852k (± 0.73%) 194,933k (± 0.95%) ~ 193,125k 196,957k p=0.261 n=6
Parse Time 1.30s (± 1.43%) 1.30s (± 1.06%) ~ 1.28s 1.32s p=0.867 n=6
Bind Time 0.73s 0.73s ~ ~ ~ p=1.000 n=6
Check Time 9.75s (± 0.32%) 9.74s (± 0.62%) ~ 9.66s 9.84s p=0.870 n=6
Emit Time 2.71s (± 0.60%) 2.72s (± 0.60%) ~ 2.70s 2.74s p=0.330 n=6
Total Time 14.49s (± 0.29%) 14.50s (± 0.40%) ~ 14.42s 14.59s p=1.000 n=6
angular-1 - node (v18.15.0, x64)
Errors 37 37 ~ ~ ~ p=1.000 n=6
Symbols 948,493 948,493 ~ ~ ~ p=1.000 n=6
Types 411,005 411,005 ~ ~ ~ p=1.000 n=6
Memory used 1,225,417k (± 0.00%) 1,225,398k (± 0.00%) ~ 1,225,353k 1,225,448k p=0.336 n=6
Parse Time 6.65s (± 0.52%) 6.67s (± 0.15%) ~ 6.66s 6.68s p=0.091 n=6
Bind Time 1.88s (± 0.62%) 1.90s (± 0.47%) +0.02s (+ 0.97%) 1.89s 1.91s p=0.027 n=6
Check Time 31.99s (± 0.44%) 31.91s (± 0.25%) ~ 31.79s 32.04s p=0.422 n=6
Emit Time 15.24s (± 0.41%) 15.21s (± 0.28%) ~ 15.12s 15.23s p=0.226 n=6
Total Time 55.76s (± 0.27%) 55.69s (± 0.14%) ~ 55.58s 55.80s p=0.378 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,447,301 2,447,301 ~ ~ ~ p=1.000 n=6
Types 898,516 898,516 ~ ~ ~ p=1.000 n=6
Memory used 2,307,984k (± 0.00%) 2,308,042k (± 0.00%) ~ 2,307,939k 2,308,079k p=0.173 n=6
Parse Time 8.94s (± 0.24%) 8.93s (± 0.24%) ~ 8.90s 8.95s p=0.416 n=6
Bind Time 2.17s (± 0.47%) 2.18s (± 0.19%) ~ 2.17s 2.18s p=0.257 n=6
Check Time 74.38s (± 0.55%) 74.29s (± 0.16%) ~ 74.09s 74.40s p=0.575 n=6
Emit Time 0.28s (± 2.26%) 0.28s (± 2.67%) ~ 0.27s 0.29s p=0.718 n=6
Total Time 85.77s (± 0.47%) 85.68s (± 0.14%) ~ 85.45s 85.81s p=0.521 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,229,397 1,229,398 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 267,085 267,086 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,362,458k (± 0.03%) 2,362,656k (± 0.02%) ~ 2,362,074k 2,363,178k p=1.000 n=6
Parse Time 5.22s (± 0.59%) 5.24s (± 0.58%) ~ 5.19s 5.27s p=0.336 n=6
Bind Time 1.79s (± 0.96%) 1.80s (± 0.77%) ~ 1.78s 1.82s p=0.738 n=6
Check Time 35.22s (± 0.20%) 35.24s (± 0.45%) ~ 34.98s 35.47s p=0.575 n=6
Emit Time 3.00s (± 1.22%) 3.00s (± 0.69%) ~ 2.97s 3.03s p=0.686 n=6
Total Time 45.24s (± 0.19%) 45.27s (± 0.33%) ~ 45.00s 45.46s p=0.423 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,229,397 1,229,398 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 267,085 267,086 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,796,207k (±14.22%) 2,795,945k (±14.22%) ~ 2,432,269k 3,159,523k p=0.936 n=6
Parse Time 6.93s (± 1.40%) 6.91s (± 1.71%) ~ 6.73s 7.07s p=0.810 n=6
Bind Time 2.16s (± 1.30%) 2.18s (± 1.42%) ~ 2.13s 2.21s p=0.333 n=6
Check Time 42.82s (± 0.67%) 42.79s (± 0.52%) ~ 42.56s 43.02s p=0.575 n=6
Emit Time 3.51s (± 2.75%) 3.55s (± 2.16%) ~ 3.44s 3.61s p=0.630 n=6
Total Time 55.41s (± 0.69%) 55.43s (± 0.61%) ~ 55.10s 55.77s p=1.000 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 263,074 263,075 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Types 106,881 106,882 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 441,364k (± 0.03%) 441,342k (± 0.01%) ~ 441,253k 441,414k p=0.936 n=6
Parse Time 3.57s (± 1.07%) 3.53s (± 0.77%) ~ 3.49s 3.56s p=0.064 n=6
Bind Time 1.31s (± 0.89%) 1.31s (± 1.32%) ~ 1.28s 1.33s p=0.934 n=6
Check Time 18.98s (± 0.32%) 19.00s (± 0.37%) ~ 18.90s 19.08s p=0.573 n=6
Emit Time 1.53s (± 1.15%) 1.53s (± 1.15%) ~ 1.51s 1.56s p=0.868 n=6
Total Time 25.40s (± 0.42%) 25.36s (± 0.27%) ~ 25.25s 25.42s p=0.470 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,741k (± 0.01%) 371,823k (± 0.05%) ~ 371,669k 372,216k p=0.810 n=6
Parse Time 2.90s (± 1.24%) 2.91s (± 0.67%) ~ 2.88s 2.93s p=1.000 n=6
Bind Time 1.58s (± 1.11%) 1.61s (± 1.40%) ~ 1.59s 1.64s p=0.124 n=6
Check Time 16.52s (± 0.21%) 16.48s (± 0.21%) ~ 16.43s 16.52s p=0.063 n=6
Emit Time 0.00s 0.00s (±244.70%) ~ 0.00s 0.01s p=0.405 n=6
Total Time 21.01s (± 0.23%) 21.00s (± 0.16%) ~ 20.96s 21.05s p=0.629 n=6
vscode - node (v18.15.0, x64)
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 3,270,017 3,270,019 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Types 1,124,149 1,124,152 +3 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 3,343,696k (± 0.00%) 3,343,576k (± 0.01%) ~ 3,343,343k 3,343,899k p=0.298 n=6
Parse Time 18.01s (± 0.52%) 18.17s (± 2.85%) ~ 17.89s 19.22s p=0.688 n=6
Bind Time 5.65s (± 2.13%) 5.66s (± 2.11%) ~ 5.58s 5.90s p=0.628 n=6
Check Time 108.88s (± 1.59%) 108.47s (± 0.76%) ~ 107.65s 109.55s p=1.000 n=6
Emit Time 34.16s (± 2.68%) 34.88s (± 2.80%) ~ 33.59s 35.98s p=0.173 n=6
Total Time 166.70s (± 1.51%) 167.18s (± 1.18%) ~ 164.92s 169.77s p=0.810 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 292,550 292,550 ~ ~ ~ p=1.000 n=6
Types 119,124 119,124 ~ ~ ~ p=1.000 n=6
Memory used 446,170k (± 0.03%) 446,072k (± 0.03%) ~ 445,956k 446,266k p=0.230 n=6
Parse Time 5.09s (± 1.28%) 5.06s (± 0.69%) ~ 5.03s 5.11s p=0.414 n=6
Bind Time 2.24s (± 1.70%) 2.22s (± 0.97%) ~ 2.20s 2.25s p=0.747 n=6
Check Time 23.36s (± 0.51%) 23.34s (± 0.37%) ~ 23.21s 23.43s p=0.630 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 30.68s (± 0.44%) 30.62s (± 0.36%) ~ 30.47s 30.73s p=0.470 n=6
xstate-main - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 555,449 555,449 ~ ~ ~ p=1.000 n=6
Types 186,146 186,146 ~ ~ ~ p=1.000 n=6
Memory used 494,626k (± 0.01%) 494,549k (± 0.02%) ~ 494,322k 494,630k p=0.378 n=6
Parse Time 3.41s (± 0.67%) 3.42s (± 0.86%) ~ 3.37s 3.45s p=0.224 n=6
Bind Time 1.20s (± 0.97%) 1.21s (± 1.04%) ~ 1.20s 1.23s p=0.094 n=6
Check Time 19.67s (± 0.49%) 19.75s (± 0.86%) ~ 19.57s 20.04s p=0.423 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.28s (± 0.49%) 24.39s (± 0.74%) ~ 24.16s 24.67s p=0.230 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/61054/merge:

Everything looks good!

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: Not started
Development

Successfully merging this pull request may close these issues.

Type variables in type abstractions are not properly concretized
4 participants