Skip to content

Add Promise overloads for undefined then callback - #58678

Closed
Andrew Branch (andrewbranch) wants to merge 1 commit into
microsoft:mainfrom
andrewbranch:experiment/58619
Closed

Andrew Branch (andrewbranch) wants to merge 1 commit into
microsoft:mainfrom
andrewbranch:experiment/58619

Conversation

@andrewbranch

Copy link
Copy Markdown
Member

Fixes #58619, but surely breaks too much other stuff

@andrewbranch

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) test top100
TypeScript Bot (@typescript-bot) perf test

@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.

Command Status Results
test top100 ✅ Started 👀 Results
perf test ✅ Started 👀 Results

@typescript-bot

Copy link
Copy Markdown
Contributor

Andrew Branch (@andrewbranch)
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,185 +32 (+ 0.05%) ~ ~ p=0.001 n=6
Types 50,242 50,274 +32 (+ 0.06%) ~ ~ p=0.001 n=6
Memory used 193,450k (± 0.96%) 192,854k (± 0.75%) ~ 192,224k 195,811k p=0.810 n=6
Parse Time 1.94s (± 1.37%) 1.96s (± 0.99%) ~ 1.93s 1.98s p=0.188 n=6
Bind Time 1.08s (± 0.97%) 1.07s (± 0.78%) ~ 1.06s 1.08s p=0.109 n=6
Check Time 14.00s (± 0.25%) 14.03s (± 0.37%) ~ 13.95s 14.09s p=0.378 n=6
Emit Time 3.91s (± 0.50%) 3.88s (± 0.76%) ~ 3.83s 3.91s p=0.064 n=6
Total Time 20.93s (± 0.29%) 20.94s (± 0.24%) ~ 20.88s 20.99s p=0.688 n=6
angular-1 - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 944,105 945,166 +1,061 (+ 0.11%) ~ ~ p=0.001 n=6
Types 407,032 408,080 +1,048 (+ 0.26%) ~ ~ p=0.001 n=6
Memory used 1,222,072k (± 0.00%) 1,223,023k (± 0.00%) +951k (+ 0.08%) 1,222,989k 1,223,059k p=0.005 n=6
Parse Time 8.13s (± 0.65%) 8.04s (± 0.45%) -0.09s (- 1.17%) 7.98s 8.09s p=0.010 n=6
Bind Time 2.24s (± 0.84%) 2.24s (± 0.34%) ~ 2.23s 2.25s p=0.565 n=6
Check Time 36.47s (± 0.38%) 36.60s (± 0.44%) ~ 36.41s 36.81s p=0.173 n=6
Emit Time 17.51s (± 0.29%) 17.47s (± 0.68%) ~ 17.36s 17.69s p=0.336 n=6
Total Time 64.35s (± 0.18%) 64.34s (± 0.23%) ~ 64.15s 64.59s p=0.810 n=6
mui-docs - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 1,983,039 1,983,113 +74 (+ 0.00%) ~ ~ p=0.001 n=6
Types 881,252 881,336 +84 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 1,888,198k (± 0.00%) 1,888,201k (± 0.00%) ~ 1,888,143k 1,888,224k p=0.471 n=6
Parse Time 9.91s (± 0.27%) 9.95s (± 0.34%) ~ 9.89s 9.99s p=0.075 n=6
Bind Time 3.34s (± 0.83%) 3.37s (± 0.68%) ~ 3.33s 3.39s p=0.103 n=6
Check Time 87.42s (± 0.26%) 87.62s (± 0.27%) ~ 87.28s 88.01s p=0.230 n=6
Emit Time 0.20s 0.20s ~ ~ ~ p=1.000 n=6
Total Time 100.87s (± 0.25%) 101.14s (± 0.24%) ~ 100.82s 101.56s p=0.128 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,226,317 1,226,877 +560 (+ 0.05%) ~ ~ p=0.001 n=6
Types 260,840 261,079 +239 (+ 0.09%) ~ ~ p=0.001 n=6
Memory used 2,368,405k (± 2.60%) 2,395,233k (± 3.28%) ~ 2,343,984k 2,497,699k p=0.093 n=6
Parse Time 5.99s (± 0.79%) 5.96s (± 0.91%) ~ 5.92s 6.06s p=0.199 n=6
Bind Time 2.26s (± 1.07%) 2.27s (± 0.82%) ~ 2.25s 2.30s p=0.421 n=6
Check Time 39.92s (± 0.42%) 39.88s (± 0.37%) ~ 39.67s 40.10s p=0.688 n=6
Emit Time 3.10s (± 4.37%) 3.03s (± 2.18%) ~ 2.95s 3.12s p=0.378 n=6
Total Time 51.27s (± 0.63%) 51.15s (± 0.34%) ~ 50.95s 51.44s p=0.471 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,226,317 1,226,877 +560 (+ 0.05%) ~ ~ p=0.001 n=6
Types 260,840 261,079 +239 (+ 0.09%) ~ ~ p=0.001 n=6
Memory used 2,494,835k (± 3.32%) 2,470,776k (± 3.17%) ~ 2,419,081k 2,572,648k p=0.810 n=6
Parse Time 7.69s (± 1.11%) 7.66s (± 0.91%) ~ 7.56s 7.74s p=0.378 n=6
Bind Time 2.48s (± 0.74%) 2.49s (± 0.57%) ~ 2.47s 2.51s p=0.515 n=6
Check Time 49.85s (± 0.56%) 49.73s (± 0.14%) ~ 49.63s 49.80s p=0.575 n=6
Emit Time 3.82s (± 3.81%) 3.86s (± 2.78%) ~ 3.71s 4.03s p=0.689 n=6
Total Time 63.86s (± 0.69%) 63.73s (± 0.25%) ~ 63.56s 64.02s p=1.000 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 258,026 258,058 +32 (+ 0.01%) ~ ~ p=0.001 n=6
Types 104,904 104,904 ~ ~ ~ p=1.000 n=6
Memory used 426,840k (± 0.01%) 426,930k (± 0.01%) +89k (+ 0.02%) 426,873k 427,005k p=0.045 n=6
Parse Time 4.13s (± 0.68%) 4.14s (± 0.51%) ~ 4.12s 4.18s p=0.085 n=6
Bind Time 1.62s (± 1.72%) 1.63s (± 0.92%) ~ 1.62s 1.66s p=0.293 n=6
Check Time 22.38s (± 0.40%) 22.37s (± 0.47%) ~ 22.26s 22.57s p=0.810 n=6
Emit Time 1.70s (± 2.25%) 1.67s (± 0.85%) ~ 1.65s 1.69s p=0.260 n=6
Total Time 29.82s (± 0.24%) 29.82s (± 0.34%) ~ 29.73s 30.01s p=0.629 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 35 ~ ~ ~ p=1.000 n=6
Symbols 224,565 224,597 +32 (+ 0.01%) ~ ~ p=0.001 n=6
Types 93,734 93,734 ~ ~ ~ p=1.000 n=6
Memory used 369,794k (± 0.03%) 369,899k (± 0.02%) ~ 369,786k 369,982k p=0.128 n=6
Parse Time 3.50s (± 0.56%) 3.52s (± 0.94%) ~ 3.47s 3.56s p=0.295 n=6
Bind Time 1.93s (± 0.78%) 1.94s (± 1.07%) ~ 1.90s 1.96s p=0.739 n=6
Check Time 19.36s (± 0.36%) 19.31s (± 0.31%) ~ 19.22s 19.39s p=0.228 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.80s (± 0.27%) 24.76s (± 0.27%) ~ 24.69s 24.85s p=0.421 n=6
vscode - node (v18.15.0, x64)
Errors 0 8 🔻+8 (+ ∞%) ~ ~ p=0.001 n=6
Symbols 2,840,561 2,848,298 +7,737 (+ 0.27%) ~ ~ p=0.001 n=6
Types 962,643 970,628 +7,985 (+ 0.83%) ~ ~ p=0.001 n=6
Memory used 3,013,602k (± 0.00%) 3,020,856k (± 0.00%) +7,254k (+ 0.24%) 3,020,811k 3,020,991k p=0.005 n=6
Parse Time 11.54s (± 0.29%) 11.58s (± 0.20%) +0.04s (+ 0.32%) 11.55s 11.61s p=0.043 n=6
Bind Time 3.59s (± 2.64%) 3.65s (± 0.14%) ~ 3.65s 3.66s p=0.352 n=6
Check Time 63.96s (± 2.33%) 63.51s (± 0.25%) ~ 63.27s 63.67s p=0.470 n=6
Emit Time 19.56s (± 6.90%) 20.08s (± 0.34%) ~ 19.95s 20.14s p=0.936 n=6
Total Time 98.65s (± 0.13%) 98.82s (± 0.14%) ~ 98.68s 98.98s p=0.054 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 266,048 266,388 +340 (+ 0.13%) ~ ~ p=0.001 n=6
Types 108,470 108,861 +391 (+ 0.36%) ~ ~ p=0.001 n=6
Memory used 410,805k (± 0.01%) 411,156k (± 0.01%) +351k (+ 0.09%) 411,094k 411,222k p=0.005 n=6
Parse Time 3.83s (± 0.51%) 3.85s (± 0.89%) ~ 3.80s 3.90s p=0.225 n=6
Bind Time 1.66s (± 0.76%) 1.66s (± 0.82%) ~ 1.65s 1.69s p=0.924 n=6
Check Time 16.97s (± 0.19%) 16.94s (± 0.21%) ~ 16.92s 17.01s p=0.157 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 22.46s (± 0.23%) 22.45s (± 0.23%) ~ 22.40s 22.54s p=1.000 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 2 🔻+2 (+ ∞%) ~ ~ p=0.001 n=6
Symbols 535,743 536,023 +280 (+ 0.05%) ~ ~ p=0.001 n=6
Types 182,738 183,144 +406 (+ 0.22%) ~ ~ p=0.001 n=6
Memory used 470,459k (± 0.01%) 470,791k (± 0.01%) +332k (+ 0.07%) 470,726k 470,889k p=0.005 n=6
Parse Time 2.65s (± 0.46%) 2.65s (± 0.48%) ~ 2.63s 2.67s p=0.599 n=6
Bind Time 1.00s (± 0.55%) 1.00s (± 0.41%) ~ 1.00s 1.01s p=0.054 n=6
Check Time 15.59s (± 0.36%) 15.53s (± 0.26%) ~ 15.48s 15.58s p=0.120 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 19.23s (± 0.32%) 19.18s (± 0.23%) ~ 19.12s 19.22s p=0.142 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

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,764ms (± 0.77%) 2,986ms (±11.28%) ~ 2,746ms 3,431ms p=0.336 n=6
Req 2 - geterr 6,832ms (±10.61%) 6,792ms (±10.02%) ~ 6,167ms 7,418ms p=0.689 n=6
Req 3 - references 404ms (±10.62%) 362ms (± 9.20%) ~ 342ms 429ms p=0.065 n=6
Req 4 - navto 331ms (± 7.48%) 298ms (± 8.95%) ~ 279ms 340ms p=0.051 n=6
Req 5 - completionInfo count 1,357 1,357 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 115ms (± 0.35%) 105ms (± 7.87%) 🟩-10ms (- 8.68%) 93ms 114ms p=0.004 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,937ms (± 1.01%) 2,941ms (± 0.73%) ~ 2,913ms 2,963ms p=0.630 n=6
Req 2 - geterr 5,163ms (±11.77%) 4,801ms (± 9.39%) ~ 4,606ms 5,722ms p=0.575 n=6
Req 3 - references 393ms (±10.40%) 406ms (±10.80%) ~ 359ms 449ms p=1.000 n=6
Req 4 - navto 310ms (±10.54%) 311ms (±11.36%) ~ 278ms 352ms p=0.935 n=6
Req 5 - completionInfo count 1,519 1,519 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 108ms (± 8.29%) 103ms (±13.04%) ~ 88ms 124ms p=0.419 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen 7,637ms (± 0.45%) 7,665ms (± 0.66%) ~ 7,612ms 7,761ms p=0.575 n=6
Req 2 - geterr 1,678ms (± 0.54%) 1,694ms (± 0.98%) ~ 1,670ms 1,713ms p=0.064 n=6
Req 3 - references 130ms (± 2.20%) 131ms (± 2.97%) ~ 128ms 138ms p=1.000 n=6
Req 4 - navto 591ms (± 1.50%) 593ms (± 2.03%) ~ 579ms 615ms p=0.810 n=6
Req 5 - completionInfo count 3,413 3,413 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 1,252ms (± 1.99%) 1,258ms (± 1.75%) ~ 1,225ms 1,286ms p=0.688 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstate-main-1-tsserver - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
tsc-startup - node (v18.15.0, x64)
Execution time 229.01ms (± 0.17%) 229.12ms (± 0.15%) +0.12ms (+ 0.05%) 226.96ms 232.80ms p=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 296.80ms (± 0.27%) 296.63ms (± 0.26%) -0.17ms (- 0.06%) 290.05ms 301.84ms p=0.000 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 236.87ms (± 0.14%) 236.85ms (± 0.16%) ~ 235.22ms 242.45ms p=0.237 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 287.85ms (± 0.28%) 287.68ms (± 0.29%) -0.17ms (- 0.06%) 280.74ms 294.40ms p=0.003 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot

Copy link
Copy Markdown
Contributor

Andrew Branch (@andrewbranch) Here are the results of running the top 400 repos comparing main and refs/pull/58678/merge:

Something interesting changed - please have a look.

Details

conwnet/github1s

extensions/github1s/tsconfig.json

drizzle-team/drizzle-orm

19 of 25 projects failed to build with the old tsc and were ignored

drizzle-orm/tsconfig.json

drizzle-orm/tsconfig.dts.json

drizzle-orm/tests/tsconfig.json

facebook/flipper

5 of 8 projects failed to build with the old tsc and were ignored

js/js-flipper/tsconfig.json

feathersjs/feathers

19 of 27 projects failed to build with the old tsc and were ignored

packages/generators/tsconfig.json

gcanti/fp-ts

4 of 5 projects failed to build with the old tsc and were ignored

tsconfig.build-es6.json

  • error TS2322: Type 'A' is not assignable to type 'Promise<Either<E, [ReadonlyNonEmptyArray<B>, S]>>'.
  • error TS2345: Argument of type 'Promise<Right<unknown> | Left<E> | Right<[NonEmptyArray<B>, S]>>' is not assignable to parameter of type 'Promise<Either<E, [NonEmptyArray<B>, S]>>'.
  • error TS2345: Argument of type '([b, s]: [any, any]) => any[]' is not assignable to parameter of type '(a: unknown) => any[]'.
  • error TS2322: Type 'A' is not assignable to type 'Promise<Either<E, ReadonlyNonEmptyArray<B>>>'.
  • error TS2345: Argument of type 'Promise<Left<E> | Right<NonEmptyArray<B>> | Right<NonEmptyArray<unknown>>>' is not assignable to parameter of type 'Promise<Either<E, NonEmptyArray<B>>>'.
  • error TS2322: Type 'A' is not assignable to type 'Promise<These<E, ReadonlyNonEmptyArray<B>>>'.
  • error TS2345: Argument of type 'Promise<Right<NonEmptyArray<unknown>> | Left<E> | Right<NonEmptyArray<B>> | Both<E, NonEmptyArray<B>> | Both<...>>' is not assignable to parameter of type 'Promise<These<E, NonEmptyArray<B>>>'.

graphile/crystal

5 of 10 projects failed to build with the old tsc and were ignored

tsconfig.json

grafast/ruru/tsconfig.json

invoke-ai/InvokeAI

invokeai/frontend/web/tsconfig.json

ionic-team/capacitor

1 of 3 projects failed to build with the old tsc and were ignored

cli/tsconfig.json

  • error TS2322: Type 'Promise<T | TResult1 | TResult2>' is not assignable to type 'Promise<TResult1 | TResult2>'.

ionic-team/ionic-framework

19 of 20 projects failed to build with the old tsc and were ignored

core/tsconfig.json

jhipster/generator-jhipster

tsconfig.types.json

tsconfig.spec.json

tsconfig.json

jupyterlab/jupyterlab

45 of 58 projects failed to build with the old tsc and were ignored

packages/ui-components/examples/simple-windowed-list/tsconfig.json

examples/filebrowser/src/tsconfig.json

examples/console/src/tsconfig.json

mattermost/mattermost

1 of 4 projects failed to build with the old tsc and were ignored

e2e-tests/cypress/tsconfig.json

microsoft/vscode

4 of 54 projects failed to build with the old tsc and were ignored

src/tsconfig.tsec.json

src/tsconfig.monaco.json

src/tsconfig.json

neoclide/coc.nvim

tsconfig.json

tiangolo/full-stack-fastapi-template

frontend/tsconfig.json

vercel/hyper

2 of 3 projects failed to build with the old tsc and were ignored

tsconfig.json

@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compiler cannot handle promise.then(null | undefined)

2 participants