Skip to content

Properly account for this argument in intersection apparent type caching - #58677

Merged
Anders Hejlsberg (ahejlsberg) merged 3 commits into
mainfrom
fix58175
May 31, 2024
Merged

Properly account for this argument in intersection apparent type caching#58677
Anders Hejlsberg (ahejlsberg) merged 3 commits into
mainfrom
fix58175

Conversation

@ahejlsberg

Copy link
Copy Markdown
Member

Fixes#58175.

@ahejlsberg

Copy link
Copy Markdown
MemberAuthor

Will add regression tests later today.

@ahejlsberg

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) test it

@typescript-bot

TypeScript Bot (typescript-bot) commented May 28, 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 Anders Hejlsberg (@ahejlsberg), 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

Anders Hejlsberg (@ahejlsberg) Here are the results of running the user tests comparing main and refs/pull/58677/merge:

Everything looks good!

@typescript-bot

Copy link
Copy Markdown
Contributor

Anders Hejlsberg (@ahejlsberg)
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,15462,154~~~p=1.000 n=6
Types50,24850,248~~~p=1.000 n=6
Memory used192,997k (± 0.76%)193,462k (± 0.96%)~192,222k195,907kp=1.000 n=6
Parse Time1.30s (± 0.42%)1.30s (± 0.69%)~1.29s1.31sp=0.341 n=6
Bind Time0.72s0.72s~~~p=1.000 n=6
Check Time9.58s (± 0.56%)9.55s (± 0.35%)~9.51s9.60sp=0.377 n=6
Emit Time2.64s (± 0.75%)2.63s (± 1.19%)~2.60s2.69sp=0.370 n=6
Total Time14.24s (± 0.40%)14.20s (± 0.28%)~14.15s14.25sp=0.334 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,110944,110~~~p=1.000 n=6
Types407,140407,140~~~p=1.000 n=6
Memory used1,222,052k (± 0.00%)1,222,120k (± 0.00%)+69k (+ 0.01%)1,222,058k1,222,161kp=0.013 n=6
Parse Time6.78s (± 0.78%)6.78s (± 0.56%)~6.75s6.85sp=1.000 n=6
Bind Time1.88s (± 0.45%)1.87s (± 0.55%)~1.86s1.89sp=0.672 n=6
Check Time31.35s (± 0.20%)31.43s (± 0.47%)~31.23s31.64sp=0.377 n=6
Emit Time14.73s (± 0.38%)14.70s (± 0.73%)~14.51s14.78sp=0.810 n=6
Total Time54.74s (± 0.14%)54.78s (± 0.38%)~54.49s55.04sp=0.810 n=6
mui-docs - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols1,983,0441,983,044~~~p=1.000 n=6
Types881,266881,266~~~p=1.000 n=6
Memory used1,888,244k (± 0.00%)1,888,993k (± 0.00%)+749k (+ 0.04%)1,888,939k1,889,103kp=0.005 n=6
Parse Time6.82s (± 0.39%)6.83s (± 0.40%)~6.79s6.87sp=0.570 n=6
Bind Time2.27s (± 0.96%)2.30s (± 0.85%)+0.03s (+ 1.47%)2.27s2.32sp=0.032 n=6
Check Time60.53s (± 0.24%)61.20s (± 0.38%)+0.67s (+ 1.11%)60.99s61.52sp=0.005 n=6
Emit Time0.14s0.14s~~~p=1.000 n=6
Total Time69.76s (± 0.22%)70.47s (± 0.34%)+0.71s (+ 1.02%)70.24s70.79sp=0.005 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,226,3411,226,342+1 (+ 0.00%)~~p=0.001 n=6
Types260,978260,978~~~p=1.000 n=6
Memory used2,368,829k (± 2.59%)2,342,955k (± 0.05%)~2,341,929k2,345,240kp=0.093 n=6
Parse Time4.98s (± 0.66%)5.00s (± 0.77%)~4.96s5.06sp=0.630 n=6
Bind Time1.92s (± 0.77%)1.92s (± 0.63%)~1.90s1.93sp=0.739 n=6
Check Time33.85s (± 0.30%)33.89s (± 0.31%)~33.75s34.07sp=0.689 n=6
Emit Time2.58s (± 3.01%)2.66s (± 5.50%)~2.48s2.89sp=0.471 n=6
Total Time43.32s (± 0.26%)43.49s (± 0.48%)~43.15s43.74sp=0.173 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,226,3411,226,342+1 (+ 0.00%)~~p=0.001 n=6
Types260,978260,978~~~p=1.000 n=6
Memory used2,470,505k (± 3.13%)2,444,973k (± 2.52%)~2,418,164k2,570,928kp=0.298 n=6
Parse Time6.23s (± 0.85%)6.23s (± 0.75%)~6.15s6.28sp=0.936 n=6
Bind Time2.06s (± 0.91%)2.05s (± 0.57%)~2.04s2.07sp=0.290 n=6
Check Time40.35s (± 0.24%)40.37s (± 0.26%)~40.26s40.51sp=1.000 n=6
Emit Time3.02s (± 2.41%)3.12s (± 5.08%)~2.96s3.38sp=0.229 n=6
Total Time51.66s (± 0.29%)51.80s (± 0.35%)~51.66s52.07sp=0.128 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols258,038258,039+1 (+ 0.00%)~~p=0.001 n=6
Types104,984104,984~~~p=1.000 n=6
Memory used426,928k (± 0.02%)427,122k (± 0.02%)+194k (+ 0.05%)426,995k427,297kp=0.013 n=6
Parse Time4.13s (± 0.36%)4.13s (± 0.68%)~4.08s4.16sp=1.000 n=6
Bind Time1.61s (± 0.85%)1.64s (± 1.14%)~1.60s1.65sp=0.053 n=6
Check Time22.31s (± 0.35%)22.36s (± 0.18%)~22.31s22.40sp=0.333 n=6
Emit Time1.71s (± 1.21%)1.68s (± 2.04%)~1.65s1.73sp=0.228 n=6
Total Time29.76s (± 0.34%)29.80s (± 0.14%)~29.76s29.86sp=0.297 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,575224,575~~~p=1.000 n=6
Types93,78593,785~~~p=1.000 n=6
Memory used369,930k (± 0.04%)369,854k (± 0.04%)~369,712k370,066kp=0.298 n=6
Parse Time2.82s (± 1.16%)2.83s (± 0.89%)~2.79s2.86sp=0.871 n=6
Bind Time1.58s (± 0.48%)1.58s (± 0.57%)~1.57s1.59sp=0.798 n=6
Check Time15.64s (± 0.35%)15.62s (± 0.37%)~15.53s15.71sp=0.258 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time20.04s (± 0.22%)20.02s (± 0.34%)~19.97s20.15sp=0.421 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,840,5632,840,563~~~p=1.000 n=6
Types963,163963,163~~~p=1.000 n=6
Memory used3,013,875k (± 0.00%)3,013,863k (± 0.00%)~3,013,784k3,013,947kp=1.000 n=6
Parse Time17.00s (± 0.38%)16.98s (± 0.51%)~16.90s17.11sp=0.228 n=6
Bind Time5.14s (± 2.42%)5.14s (± 2.21%)~5.02s5.27sp=1.000 n=6
Check Time88.60s (± 0.27%)88.76s (± 0.28%)~88.53s89.13sp=0.520 n=6
Emit Time28.61s (± 0.50%)28.57s (± 0.62%)~28.31s28.75sp=0.630 n=6
Total Time139.35s (± 0.28%)139.45s (± 0.28%)~138.99s139.95sp=0.936 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols266,087266,087~~~p=1.000 n=6
Types108,518108,518~~~p=1.000 n=6
Memory used410,922k (± 0.01%)411,025k (± 0.03%)~410,894k411,201kp=0.173 n=6
Parse Time4.78s (± 0.51%)4.79s (± 0.54%)~4.76s4.83sp=0.627 n=6
Bind Time2.06s (± 1.00%)2.07s (± 0.56%)~2.05s2.08sp=0.934 n=6
Check Time21.05s (± 0.34%)21.16s (± 0.41%)+0.11s (+ 0.52%)21.03s21.29sp=0.043 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time27.90s (± 0.24%)28.02s (± 0.35%)+0.12s (+ 0.44%)27.86s28.15sp=0.036 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols535,745535,745~~~p=1.000 n=6
Types182,753182,753~~~p=1.000 n=6
Memory used470,384k (± 0.00%)470,488k (± 0.01%)+104k (+ 0.02%)470,432k470,590kp=0.005 n=6
Parse Time3.18s (± 0.51%)3.17s (± 0.51%)~3.16s3.20sp=0.737 n=6
Bind Time1.21s (± 1.32%)1.20s (± 0.43%)~1.20s1.21sp=0.923 n=6
Check Time18.37s (± 0.32%)18.39s (± 0.39%)~18.31s18.52sp=0.808 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time22.75s (± 0.30%)22.76s (± 0.31%)~22.69s22.88sp=0.936 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

Anders Hejlsberg (@ahejlsberg) Here are the results of running the top 400 repos comparing main and refs/pull/58677/merge:

Everything looks good!

@ahejlsberg

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) test it

@typescript-bot

TypeScript Bot (typescript-bot) commented May 28, 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 Anders Hejlsberg (@ahejlsberg), 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

Anders Hejlsberg (@ahejlsberg) Here are the results of running the user tests comparing main and refs/pull/58677/merge:

Everything looks good!

@typescript-bot

Copy link
Copy Markdown
Contributor

Anders Hejlsberg (@ahejlsberg)
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,831k (± 0.76%)192,929k (± 0.73%)~192,193k195,799kp=0.810 n=6
Parse Time1.31s (± 0.64%)1.30s (± 0.76%)~1.29s1.31sp=0.256 n=6
Bind Time0.72s (± 0.57%)0.72s~~~p=0.405 n=6
Check Time9.53s (± 0.28%)9.54s (± 0.53%)~9.46s9.59sp=0.629 n=6
Emit Time2.64s (± 0.59%)2.64s (± 0.56%)~2.62s2.65sp=0.801 n=6
Total Time14.20s (± 0.23%)14.20s (± 0.43%)~14.09s14.25sp=0.810 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,105944,105~~~p=1.000 n=6
Types407,032407,032~~~p=1.000 n=6
Memory used1,221,992k (± 0.01%)1,222,007k (± 0.01%)~1,221,909k1,222,080kp=0.936 n=6
Parse Time8.12s (± 0.25%)8.11s (± 0.39%)~8.08s8.16sp=0.684 n=6
Bind Time2.23s (± 0.59%)2.25s (± 0.56%)+0.02s (+ 0.82%)2.23s2.26sp=0.048 n=6
Check Time36.47s (± 0.31%)36.50s (± 0.45%)~36.34s36.73sp=0.936 n=6
Emit Time17.56s (± 0.77%)17.49s (± 0.42%)~17.42s17.60sp=0.295 n=6
Total Time64.38s (± 0.29%)64.36s (± 0.32%)~64.14s64.60sp=1.000 n=6
mui-docs - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols1,983,1221,983,122~~~p=1.000 n=6
Types881,307881,307~~~p=1.000 n=6
Memory used1,888,318k (± 0.00%)1,888,351k (± 0.00%)~1,888,313k1,888,407kp=0.173 n=6
Parse Time6.82s (± 0.36%)6.83s (± 0.41%)~6.79s6.86sp=0.806 n=6
Bind Time2.28s (± 1.22%)2.29s (± 0.62%)~2.27s2.31sp=0.331 n=6
Check Time60.37s (± 0.39%)60.38s (± 0.46%)~59.98s60.79sp=0.936 n=6
Emit Time0.14s (± 2.95%)0.14s (± 2.95%)~0.13s0.14sp=1.000 n=6
Total Time69.61s (± 0.33%)69.63s (± 0.39%)~69.22s70.02sp=0.810 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,226,3171,226,318+1 (+ 0.00%)~~p=0.001 n=6
Types260,840260,840~~~p=1.000 n=6
Memory used2,418,465k (± 3.43%)2,369,381k (± 2.61%)~2,343,583k2,495,921kp=0.810 n=6
Parse Time7.42s (± 1.06%)7.47s (± 1.22%)~7.33s7.60sp=0.378 n=6
Bind Time2.78s (± 0.89%)2.78s (± 0.54%)~2.77s2.81sp=1.000 n=6
Check Time49.61s (± 1.19%)49.28s (± 0.55%)~48.85s49.65sp=0.298 n=6
Emit Time3.85s (± 3.55%)3.83s (± 4.90%)~3.69s4.16sp=0.689 n=6
Total Time63.68s (± 1.21%)63.37s (± 0.77%)~62.65s63.93sp=0.298 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,226,3171,226,318+1 (+ 0.00%)~~p=0.001 n=6
Types260,840260,840~~~p=1.000 n=6
Memory used2,444,561k (± 2.51%)2,419,247k (± 0.03%)~2,418,304k2,420,531kp=0.378 n=6
Parse Time5.16s (± 1.07%)5.17s (± 1.28%)~5.11s5.26sp=0.810 n=6
Bind Time1.71s (± 1.01%)1.70s (± 0.61%)~1.69s1.72sp=0.797 n=6
Check Time34.32s (± 0.26%)34.33s (± 0.28%)~34.21s34.48sp=0.936 n=6
Emit Time2.59s (± 2.86%)2.62s (± 1.92%)~2.55s2.70sp=0.521 n=6
Total Time43.79s (± 0.32%)43.84s (± 0.28%)~43.72s44.06sp=0.936 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols258,026258,027+1 (+ 0.00%)~~p=0.001 n=6
Types104,904104,904~~~p=1.000 n=6
Memory used426,927k (± 0.02%)426,914k (± 0.01%)~426,841k426,969kp=0.936 n=6
Parse Time3.32s (± 0.44%)3.33s (± 1.48%)~3.28s3.40sp=0.809 n=6
Bind Time1.32s (± 0.78%)1.32s (± 1.33%)~1.29s1.33sp=0.803 n=6
Check Time17.99s (± 0.51%)17.98s (± 0.32%)~17.87s18.03sp=0.809 n=6
Emit Time1.34s (± 1.60%)1.34s (± 1.02%)~1.33s1.37sp=0.213 n=6
Total Time23.98s (± 0.40%)23.97s (± 0.21%)~23.90s24.03sp=0.810 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,862k (± 0.02%)369,778k (± 0.02%)~369,698k369,879kp=0.066 n=6
Parse Time2.36s (± 0.92%)2.35s (± 1.02%)~2.33s2.39sp=0.461 n=6
Bind Time1.33s (± 1.13%)1.33s (± 0.91%)~1.32s1.35sp=0.402 n=6
Check Time13.35s (± 0.48%)13.33s (± 0.60%)~13.22s13.41sp=0.810 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time17.04s (± 0.34%)17.00s (± 0.57%)~16.88s17.10sp=0.810 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,840,5602,840,560~~~p=1.000 n=6
Types962,642962,642~~~p=1.000 n=6
Memory used3,013,622k (± 0.00%)3,013,618k (± 0.00%)~3,013,563k3,013,751kp=0.575 n=6
Parse Time17.02s (± 0.30%)17.07s (± 0.30%)~16.97s17.12sp=0.173 n=6
Bind Time5.10s (± 1.77%)5.10s (± 2.19%)~5.03s5.33sp=0.936 n=6
Check Time90.04s (± 2.19%)89.84s (± 2.20%)~88.88s93.88sp=0.575 n=6
Emit Time28.00s (± 6.74%)28.07s (± 6.92%)~24.11s29.02sp=0.575 n=6
Total Time140.17s (± 0.22%)140.09s (± 0.20%)~139.75s140.57sp=0.936 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols266,048266,048~~~p=1.000 n=6
Types108,470108,470~~~p=1.000 n=6
Memory used410,874k (± 0.02%)410,833k (± 0.02%)~410,757k410,963kp=0.575 n=6
Parse Time3.85s (± 0.31%)3.85s (± 0.26%)~3.84s3.86sp=0.865 n=6
Bind Time1.67s (± 0.83%)1.67s (± 1.20%)~1.64s1.69sp=0.568 n=6
Check Time17.03s (± 0.24%)16.98s (± 0.39%)~16.90s17.09sp=0.148 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time22.55s (± 0.25%)22.50s (± 0.26%)~22.43s22.61sp=0.172 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols535,743535,743~~~p=1.000 n=6
Types182,738182,738~~~p=1.000 n=6
Memory used470,440k (± 0.01%)470,475k (± 0.02%)~470,382k470,564kp=0.471 n=6
Parse Time3.95s (± 0.31%)3.94s (± 0.69%)~3.91s3.97sp=0.806 n=6
Bind Time1.49s (± 1.53%)1.49s (± 0.71%)~1.47s1.50sp=0.415 n=6
Check Time22.70s (± 0.66%)22.67s (± 0.33%)~22.56s22.77sp=0.630 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time28.14s (± 0.50%)28.09s (± 0.31%)~27.95s28.20sp=0.378 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

@ahejlsberg

Copy link
Copy Markdown
MemberAuthor

Tests are clean and performance is unaffected. I think this one is ready for review and merge.

@typescript-bot

Copy link
Copy Markdown
Contributor

Anders Hejlsberg (@ahejlsberg) Here are the results of running the top 400 repos comparing main and refs/pull/58677/merge:

Everything looks good!

Jonathan Skeate (skeate) added a commit to skeate/TypeScript that referenced this pull request Jun 1, 2024
* upstream/main: (37 commits)
Added NoTruncation flag to completions (microsoft#58719)
Clone node to remove location even when it has been modified if needed (microsoft#58706)
Properly account for `this` argument in intersection apparent type caching (microsoft#58677)
Fix: Include Values of Script Extensions for Unicode Property Value Expressions in Regular Expressions (microsoft#58615)
In `reScanSlashToken` use `charCodeChecked` not `codePointChecked` (microsoft#58727)
Shorten error spans for errors reported on constructor declarations (microsoft#58061)
Mark file as skips typechecking if it contains ts-nocheck (microsoft#58593)
Fixed an issue with broken `await using` declarations in `for of` loops (microsoft#56466)
Do not expand type references in keyof and index access (microsoft#58715)
Improve the performance of isolatedDeclarations quickfix (microsoft#58722)
Unwrap `NoInfer` types when narrowing (microsoft#58292)
Recover from type reuse errors by falling back to inferred type printing (microsoft#58720)
Fixing self import (microsoft#58718)
Enable JS emit for noCheck and noCheck for transpileModule (microsoft#58364)
Revert PR 55371 (microsoft#58702)
Update dependencies (microsoft#58639)
Fix baselines after PR 58621 (microsoft#58705)
Do not infer `yield*` type from contextual `TReturn` (microsoft#58621)
`await using` normative changes (microsoft#58624)
Handling statements from a known source file (microsoft#58679)
...
@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

Author: TeamFor Milestone BugPRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent tsc behavior on TS 5.4

4 participants

@ahejlsberg@typescript-bot@DanielRosenwasser@rbuckton