Skip to content

Infer type parameters from indexes on those parameters - #53017

Closed
Mateusz Burzyński (Andarist) wants to merge 39 commits into
microsoft:mainfrom
Andarist:infer-concrete-properties-of-reverse-mapped-types
Closed

Infer type parameters from indexes on those parameters#53017
Mateusz Burzyński (Andarist) wants to merge 39 commits into
microsoft:mainfrom
Andarist:infer-concrete-properties-of-reverse-mapped-types

Conversation

@Andarist

Copy link
Copy Markdown
Contributor

closes#51612

@typescript-botTypeScript Bot (typescript-bot) added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Feb 28, 2023
@typescript-bot

Copy link
Copy Markdown
Contributor

The TypeScript team hasn't accepted the linked issue #51612. If you can get it accepted, this PR will have a better chance of being reviewed.

Comment threadsrc/compiler/checker.ts Outdated
Comment threadsrc/compiler/checker.ts Outdated
Comment threadsrc/compiler/checker.ts Outdated
Comment threadsrc/compiler/checker.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I had #20126 which was pretty functional a long time ago, which we basically only didn't take because nobody could be bothered to care about it without a backing issue (myself included), but that seems to be an even more general version of this (or at least relied on a similar partial inferencing mechanism), since these kinds of partial inferences that you combine later are applicable beyond reverse mapped types.

Comment threadsrc/compiler/checker.ts Outdated
Comment threadsrc/compiler/checker.ts Outdated
@AndaristMateusz Burzyński (Andarist) changed the title Infer reverse mapped types based on inferences made for its concrete propertiesInfer type parameters from indexes on those parametersApr 19, 2023
@typescript-bot

TypeScript Bot (typescript-bot) commented Dec 1, 2025

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
pack this✅ Started✅ Results
test top400✅ Started👀 Results
user test this✅ Started👀 Results
run dt✅ Started👀 Results
perf test this faster✅ Started👀 Results

@typescript-bot

TypeScript Bot (typescript-bot) commented Dec 1, 2025

Copy link
Copy Markdown
Contributor

Hey Jake Bailey (@jakebailey), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
"devDependencies": {
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/166633/artifacts?artifactName=tgz&fileId=E5F9CEBCCB3B4DBB52F1F9642B36C892BB89227CBD41EAD91C6DBFD5FA8129EC02&fileName=/typescript-6.0.0-insiders.20251201.tgz"
}
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@6.0.0-pr-53017-28".;

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Jake Bailey (@jakebailey), the results of running the DT tests are ready.

There were interesting changes:

Branch only errors:

Package: rdfjs__data-model
Error:

Error: /mnt/vss/_work/1/DefinitelyTyped/types/rdfjs__data-model/rdfjs__data-model-tests.ts
76:5 error TypeScript@local compile error: Unused '@ts-expect-error' directive @definitelytyped/expect
✖ 1 problem (1 error, 0 warnings)
at combineErrorsAndWarnings (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.34_typescript@6.0.0-dev.20251201/node_modules/@definitelytyped/dtslint/dist/index.js:199:28)
at runTests (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.34_typescript@6.0.0-dev.20251201/node_modules/@definitelytyped/dtslint/dist/index.js:191:20)

You can check the log here.

@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey) Here are the results of running the user tests with tsc comparing main and refs/pull/53017/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Git clone failed"

Otherwise...

Something interesting changed - please have a look.

Details

webpack

tsconfig.types.test.json

  • [NEW] error TS2345: Argument of type 'Comparator<Record<string | number | symbol, number>>' is not assignable to parameter of type '(a: { connection: ModuleGraphConnection; sourceOrder: number; rangeStart: number | undefined; defer?: boolean | undefined; }, b: { connection: ModuleGraphConnection; sourceOrder: number; rangeStart: number | undefined; defer?: boolean | undefined; }) => number'.

tsconfig.types.json

  • [NEW] error TS2345: Argument of type 'Comparator<Record<string | number | symbol, number>>' is not assignable to parameter of type '(a: { connection: ModuleGraphConnection; sourceOrder: number; rangeStart: number | undefined; defer?: boolean | undefined; }, b: { connection: ModuleGraphConnection; sourceOrder: number; rangeStart: number | undefined; defer?: boolean | undefined; }) => number'.

tsconfig.json

  • [NEW] error TS2345: Argument of type 'Comparator<Record<string | number | symbol, number>>' is not assignable to parameter of type '(a: { connection: ModuleGraphConnection; sourceOrder: number; rangeStart: number | undefined; defer?: boolean | undefined; }, b: { connection: ModuleGraphConnection; sourceOrder: number; rangeStart: number | undefined; defer?: boolean | undefined; }) => number'.

@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey)
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)
Errors11~~~p=1.000 n=6
Symbols62,37062,407+37 (+ 0.06%)~~p=0.001 n=6
Types50,38650,458+72 (+ 0.14%)~~p=0.001 n=6
Memory used193,848k (± 0.96%)195,223k (± 0.90%)+1,375k (+ 0.71%)192,768k196,435kp=0.031 n=6
Parse Time1.30s (± 0.79%)1.29s (± 0.76%)~1.28s1.31sp=0.091 n=6
Bind Time0.75s (± 0.54%)0.75s~~~p=0.405 n=6
Check Time9.90s (± 0.24%)9.97s (± 0.33%)+0.06s (+ 0.64%)9.90s9.99sp=0.028 n=6
Emit Time2.74s (± 0.80%)2.75s (± 0.36%)~2.74s2.76sp=0.324 n=6
Total Time14.69s (± 0.24%)14.76s (± 0.24%)+0.07s (+ 0.44%)14.69s14.78sp=0.015 n=6
angular-1 - node (v18.15.0, x64)
Errors22~~~p=1.000 n=6
Symbols956,047949,829-6,218 (- 0.65%)~~p=0.001 n=6
Types415,881411,890-3,991 (- 0.96%)~~p=0.001 n=6
Memory used1,255,005k (± 0.01%)1,246,583k (± 0.00%)-8,423k (- 0.67%)1,246,533k1,246,651kp=0.005 n=6
Parse Time6.54s (± 0.71%)6.54s (± 0.68%)~6.49s6.61sp=0.872 n=6
Bind Time1.96s (± 0.42%)1.96s (± 0.32%)~1.95s1.97sp=0.432 n=6
Check Time32.31s (± 0.23%)32.36s (± 0.36%)~32.19s32.48sp=0.377 n=6
Emit Time14.90s (± 0.15%)14.90s (± 0.27%)~14.83s14.95sp=0.746 n=6
Total Time55.70s (± 0.17%)55.76s (± 0.13%)~55.62s55.84sp=0.470 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,722,0882,720,094-1,994 (- 0.07%)~~p=0.001 n=6
Types937,484936,130-1,354 (- 0.14%)~~p=0.001 n=6
Memory used3,050,965k (± 0.00%)3,047,175k (± 0.00%)-3,790k (- 0.12%)3,047,019k3,047,309kp=0.005 n=6
Parse Time8.55s (± 0.19%)8.53s (± 0.20%)~8.51s8.55sp=0.121 n=6
Bind Time2.32s (± 0.79%)2.32s (± 0.65%)~2.29s2.33sp=1.000 n=6
Check Time93.09s (± 0.30%)92.55s (± 0.36%)-0.55s (- 0.59%)92.19s93.02sp=0.031 n=6
Emit Time0.31s (± 1.68%)0.31s (± 2.04%)~0.30s0.32sp=0.386 n=6
Total Time104.27s (± 0.26%)103.71s (± 0.33%)-0.56s (- 0.54%)103.35s104.16sp=0.030 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,251,5451,251,990+445 (+ 0.04%)~~p=0.001 n=6
Types259,756260,698+942 (+ 0.36%)~~p=0.001 n=6
Memory used2,514,131k (±11.84%)2,455,118k (± 6.07%)~2,393,577k2,759,564kp=0.066 n=6
Parse Time5.20s (± 1.01%)5.15s (± 1.05%)~5.05s5.20sp=0.471 n=6
Bind Time1.82s (± 1.70%)1.82s (± 1.08%)~1.80s1.85sp=1.000 n=6
Check Time35.45s (± 0.49%)35.34s (± 0.61%)~34.97s35.62sp=0.423 n=6
Emit Time2.97s (± 1.80%)2.98s (± 1.85%)~2.89s3.04sp=0.748 n=6
Total Time45.46s (± 0.39%)45.30s (± 0.50%)~44.90s45.57sp=0.297 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,251,5451,251,990+445 (+ 0.04%)~~p=0.001 n=6
Types259,756260,698+942 (+ 0.36%)~~p=0.001 n=6
Memory used3,067,155k (± 9.63%)3,068,699k (± 9.65%)+1,544k (+ 0.05%)2,463,786k3,190,055kp=0.045 n=6
Parse Time6.77s (± 1.87%)6.78s (± 0.45%)~6.72s6.81sp=0.873 n=6
Bind Time2.25s (± 0.54%)2.25s (± 0.67%)~2.23s2.27sp=0.687 n=6
Check Time43.13s (± 0.40%)43.23s (± 0.16%)~43.15s43.34sp=0.378 n=6
Emit Time3.52s (± 1.55%)3.53s (± 1.78%)~3.46s3.61sp=0.630 n=6
Total Time55.68s (± 0.60%)55.78s (± 0.15%)~55.64s55.87sp=0.575 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols264,177264,370+193 (+ 0.07%)~~p=0.001 n=6
Types103,979104,380+401 (+ 0.39%)~~p=0.001 n=6
Memory used443,207k (± 0.03%)443,453k (± 0.01%)+247k (+ 0.06%)443,409k443,506kp=0.005 n=6
Parse Time3.52s (± 0.31%)3.49s (± 0.93%)~3.46s3.54sp=0.250 n=6
Bind Time1.36s (± 1.20%)1.37s (± 0.75%)~1.36s1.39sp=0.241 n=6
Check Time19.18s (± 0.36%)19.16s (± 0.53%)~19.08s19.30sp=0.810 n=6
Emit Time1.54s (± 0.53%)1.54s (± 1.28%)~1.52s1.57sp=0.323 n=6
Total Time25.61s (± 0.25%)25.57s (± 0.29%)~25.50s25.67sp=0.296 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors7272~~~p=1.000 n=6
Symbols225,386225,487+101 (+ 0.04%)~~p=0.001 n=6
Types94,30494,669+365 (+ 0.39%)~~p=0.001 n=6
Memory used370,104k (± 0.05%)370,356k (± 0.02%)~370,241k370,476kp=0.066 n=6
Parse Time2.83s (± 0.69%)2.83s (± 0.66%)~2.79s2.84sp=0.869 n=6
Bind Time1.63s (± 1.31%)1.64s (± 0.92%)~1.62s1.66sp=0.401 n=6
Check Time16.52s (± 0.21%)16.64s (± 0.41%)+0.11s (+ 0.69%)16.53s16.73sp=0.013 n=6
Emit Time0.00s0.00s (±154.76%)~0.00s0.01sp=0.174 n=6
Total Time20.98s (± 0.11%)21.11s (± 0.35%)+0.13s (+ 0.60%)20.98s21.20sp=0.019 n=6
vscode - node (v18.15.0, x64)
Errors1111~~~p=1.000 n=6
Symbols4,070,5904,070,058-532 (- 0.01%)~~p=0.001 n=6
Types1,282,2141,281,724-490 (- 0.04%)~~p=0.001 n=6
Memory used3,856,455k (± 0.00%)3,855,629k (± 0.00%)-827k (- 0.02%)3,855,480k3,855,781kp=0.005 n=6
Parse Time15.68s (± 0.44%)15.67s (± 0.31%)~15.62s15.73sp=0.871 n=6
Bind Time5.28s (± 0.58%)5.27s (± 0.58%)~5.23s5.31sp=0.745 n=6
Check Time113.65s (± 3.60%)111.55s (± 0.92%)~110.13s113.31sp=0.575 n=6
Emit Time44.05s (±12.03%)39.02s (± 0.65%)~38.73s39.46sp=0.066 n=6
Total Time178.65s (± 3.34%)171.51s (± 0.57%)🟩-7.14s (- 4.00%)170.28s173.17sp=0.031 n=6
webpack - node (v18.15.0, x64)
Errors4041+1 (+ 2.50%)~~p=0.001 n=6
Symbols380,434379,240-1,194 (- 0.31%)~~p=0.001 n=6
Types166,705165,734-971 (- 0.58%)~~p=0.001 n=6
Memory used540,329k (± 0.02%)539,502k (± 0.03%)-827k (- 0.15%)539,220k539,741kp=0.005 n=6
Parse Time4.69s (± 0.35%)4.68s (± 0.40%)~4.65s4.70sp=0.466 n=6
Bind Time2.03s (± 0.72%)2.02s (± 0.60%)~2.01s2.04sp=0.408 n=6
Check Time22.92s (± 0.26%)22.91s (± 0.25%)~22.81s22.97sp=0.936 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time29.64s (± 0.21%)29.62s (± 0.24%)~29.51s29.71sp=0.470 n=6
xstate-main - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols690,397690,376-21 (- 0.00%)~~p=0.001 n=6
Types208,790209,009+219 (+ 0.10%)~~p=0.001 n=6
Memory used586,137k (± 0.03%)586,118k (± 0.03%)~585,944k586,308kp=0.810 n=6
Parse Time4.18s (± 0.84%)4.18s (± 0.51%)~4.14s4.20sp=0.809 n=6
Bind Time1.42s (± 0.53%)1.42s (± 1.50%)~1.40s1.45sp=1.000 n=6
Check Time20.75s (± 1.56%)20.59s (± 1.68%)~20.33s21.26sp=0.520 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time26.35s (± 1.14%)26.19s (± 1.41%)~25.91s26.91sp=0.298 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

Jake Bailey (@jakebailey) Here are the results of running the top 400 repos with tsc comparing main and refs/pull/53017/merge:

Something interesting changed - please have a look.

Details

tldraw/tldraw

30 of 34 projects failed to build with the old tsc and were ignored

templates/branching-chat/tsconfig.json

  • error TS2345: Argument of type '{ x: number; y: number; id: TLShapeId; typeName: "shape"; type: "node"; rotation: number; index: IndexKey; parentId: TLParentId; isLocked: boolean; opacity: TLOpacityType; props: { ...; }; meta: JsonObject; }' is not assignable to parameter of type 'null | undefined'.

@jakebailey

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) test it
TypeScript Bot (@typescript-bot) pack this

@typescript-bot

TypeScript Bot (typescript-bot) commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
pack this✅ Started✅ Results
test top400✅ Started✅ Results
user test this✅ Started👀 Results
run dt✅ Started✅ Results
perf test this faster✅ Started👀 Results

@typescript-bot

TypeScript Bot (typescript-bot) commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

Hey Jake Bailey (@jakebailey), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
"devDependencies": {
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/166648/artifacts?artifactName=tgz&fileId=A5C9819FA08C4C8EB063C5869BCF715A23EC7D7449F748DA8260A7323DB8A06D02&fileName=/typescript-6.0.0-insiders.20251202.tgz"
}
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@6.0.0-pr-53017-35".;

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Jake Bailey (@jakebailey), 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

Jake Bailey (@jakebailey) Here are the results of running the user tests with tsc comparing main and refs/pull/53017/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Git clone failed"

Otherwise...

Something interesting changed - please have a look.

Details

webpack

tsconfig.types.test.json

  • [NEW] error TS2345: Argument of type 'Comparator<Record<string | number | symbol, number>>' is not assignable to parameter of type '(a: { connection: ModuleGraphConnection; sourceOrder: number; rangeStart: number | undefined; defer?: boolean | undefined; }, b: { connection: ModuleGraphConnection; sourceOrder: number; rangeStart: number | undefined; defer?: boolean | undefined; }) => number'.

tsconfig.types.json

  • [NEW] error TS2345: Argument of type 'Comparator<Record<string | number | symbol, number>>' is not assignable to parameter of type '(a: { connection: ModuleGraphConnection; sourceOrder: number; rangeStart: number | undefined; defer?: boolean | undefined; }, b: { connection: ModuleGraphConnection; sourceOrder: number; rangeStart: number | undefined; defer?: boolean | undefined; }) => number'.

tsconfig.json

  • [NEW] error TS2345: Argument of type 'Comparator<Record<string | number | symbol, number>>' is not assignable to parameter of type '(a: { connection: ModuleGraphConnection; sourceOrder: number; rangeStart: number | undefined; defer?: boolean | undefined; }, b: { connection: ModuleGraphConnection; sourceOrder: number; rangeStart: number | undefined; defer?: boolean | undefined; }) => number'.

@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey)
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)
Errors11~~~p=1.000 n=6
Symbols62,37062,403+33 (+ 0.05%)~~p=0.001 n=6
Types50,38650,442+56 (+ 0.11%)~~p=0.001 n=6
Memory used194,531k (± 0.99%)194,025k (± 0.93%)~192,782k196,389kp=0.810 n=6
Parse Time1.30s (± 0.75%)1.30s (± 0.76%)~1.29s1.31sp=0.604 n=6
Bind Time0.75s0.75s~~~p=1.000 n=6
Check Time9.90s (± 0.44%)9.94s (± 0.19%)~9.92s9.97sp=0.066 n=6
Emit Time2.74s (± 0.67%)2.76s (± 0.59%)~2.74s2.78sp=0.254 n=6
Total Time14.69s (± 0.24%)14.75s (± 0.19%)+0.05s (+ 0.37%)14.70s14.78sp=0.028 n=6
angular-1 - node (v18.15.0, x64)
Errors22~~~p=1.000 n=6
Symbols956,047949,827-6,220 (- 0.65%)~~p=0.001 n=6
Types415,881411,866-4,015 (- 0.97%)~~p=0.001 n=6
Memory used1,255,082k (± 0.00%)1,246,560k (± 0.00%)-8,521k (- 0.68%)1,246,491k1,246,618kp=0.005 n=6
Parse Time6.52s (± 0.68%)6.55s (± 0.78%)~6.49s6.62sp=0.468 n=6
Bind Time1.97s (± 0.41%)1.96s (± 0.21%)~1.96s1.97sp=0.248 n=6
Check Time32.46s (± 0.40%)32.41s (± 0.26%)~32.30s32.53sp=0.689 n=6
Emit Time14.91s (± 0.29%)14.88s (± 0.31%)~14.81s14.95sp=0.195 n=6
Total Time55.85s (± 0.33%)55.79s (± 0.10%)~55.73s55.87sp=0.630 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,722,0792,720,085-1,994 (- 0.07%)~~p=0.001 n=6
Types937,469936,103-1,366 (- 0.15%)~~p=0.001 n=6
Memory used3,050,889k (± 0.00%)3,047,126k (± 0.00%)-3,763k (- 0.12%)3,047,047k3,047,190kp=0.005 n=6
Parse Time8.55s (± 0.18%)8.53s (± 0.21%)-0.03s (- 0.33%)8.50s8.55sp=0.023 n=6
Bind Time2.31s (± 0.65%)2.33s (± 0.45%)~2.31s2.34sp=0.215 n=6
Check Time92.71s (± 0.58%)92.79s (± 0.34%)~92.45s93.21sp=0.748 n=6
Emit Time0.31s (± 2.44%)0.31s (± 2.41%)~0.30s0.32sp=0.487 n=6
Total Time103.88s (± 0.52%)103.95s (± 0.31%)~103.57s104.35sp=0.936 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,251,5451,251,833+288 (+ 0.02%)~~p=0.001 n=6
Types259,756260,040+284 (+ 0.11%)~~p=0.001 n=6
Memory used2,760,412k (±14.45%)3,003,980k (± 9.89%)~2,396,775k3,126,796kp=0.173 n=6
Parse Time6.58s (± 1.38%)6.66s (± 1.33%)~6.49s6.73sp=0.128 n=6
Bind Time2.27s (± 2.44%)2.22s (± 1.27%)~2.19s2.27sp=0.229 n=6
Check Time43.17s (± 0.71%)43.06s (± 0.39%)~42.84s43.27sp=0.810 n=6
Emit Time3.61s (± 5.04%)3.54s (± 2.20%)~3.43s3.64sp=0.687 n=6
Total Time55.61s (± 0.58%)55.47s (± 0.32%)~55.21s55.67sp=0.689 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,251,5451,251,833+288 (+ 0.02%)~~p=0.001 n=6
Types259,756260,040+284 (+ 0.11%)~~p=0.001 n=6
Memory used2,459,510k (± 0.03%)2,460,361k (± 0.02%)~2,459,655k2,460,665kp=0.066 n=6
Parse Time5.34s (± 0.65%)5.32s (± 0.33%)~5.29s5.34sp=0.173 n=6
Bind Time1.87s (± 1.04%)1.87s (± 0.44%)~1.87s1.89sp=0.242 n=6
Check Time35.55s (± 0.39%)35.65s (± 0.35%)~35.51s35.80sp=0.298 n=6
Emit Time3.03s (± 1.68%)3.05s (± 1.25%)~2.99s3.09sp=0.470 n=6
Total Time45.82s (± 0.43%)45.90s (± 0.31%)~45.72s46.09sp=0.471 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols264,177264,286+109 (+ 0.04%)~~p=0.001 n=6
Types103,979104,036+57 (+ 0.05%)~~p=0.001 n=6
Memory used443,187k (± 0.01%)443,359k (± 0.01%)+173k (+ 0.04%)443,314k443,434kp=0.005 n=6
Parse Time3.50s (± 0.52%)3.50s (± 0.78%)~3.46s3.54sp=0.871 n=6
Bind Time1.37s (± 1.07%)1.36s (± 1.20%)~1.35s1.39sp=0.512 n=6
Check Time19.20s (± 0.32%)19.14s (± 0.41%)~19.02s19.24sp=0.297 n=6
Emit Time1.53s (± 1.45%)1.54s (± 0.27%)~1.53s1.54sp=0.227 n=6
Total Time25.60s (± 0.31%)25.54s (± 0.34%)~25.42s25.66sp=0.230 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors7272~~~p=1.000 n=6
Symbols225,386225,406+20 (+ 0.01%)~~p=0.001 n=6
Types94,30494,345+41 (+ 0.04%)~~p=0.001 n=6
Memory used370,150k (± 0.05%)370,328k (± 0.06%)~370,107k370,652kp=0.173 n=6
Parse Time2.85s (± 0.97%)2.86s (± 0.88%)~2.81s2.88sp=0.746 n=6
Bind Time1.65s (± 1.00%)1.64s (± 1.05%)~1.61s1.66sp=0.934 n=6
Check Time16.61s (± 0.22%)16.74s (± 0.29%)+0.13s (+ 0.78%)16.68s16.80sp=0.005 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time21.10s (± 0.18%)21.24s (± 0.26%)+0.14s (+ 0.66%)21.14s21.30sp=0.008 n=6
vscode - node (v18.15.0, x64)
Errors1111~~~p=1.000 n=6
Symbols4,072,5064,071,974-532 (- 0.01%)~~p=0.001 n=6
Types1,282,5871,282,093-494 (- 0.04%)~~p=0.001 n=6
Memory used3,857,921k (± 0.00%)3,857,026k (± 0.00%)-895k (- 0.02%)3,856,814k3,857,269kp=0.005 n=6
Parse Time15.72s (± 0.72%)15.67s (± 0.45%)~15.56s15.75sp=0.375 n=6
Bind Time5.30s (± 1.34%)5.38s (± 2.43%)~5.28s5.55sp=0.147 n=6
Check Time111.56s (± 2.60%)113.89s (± 3.41%)~110.78s121.61sp=0.128 n=6
Emit Time38.94s (± 0.37%)43.08s (±14.98%)~38.68s54.87sp=0.689 n=6
Total Time171.51s (± 1.74%)178.02s (± 5.63%)~170.62s197.33sp=0.066 n=6
webpack - node (v18.15.0, x64)
Errors4041+1 (+ 2.50%)~~p=0.001 n=6
Symbols380,455379,261-1,194 (- 0.31%)~~p=0.001 n=6
Types166,708165,539-1,169 (- 0.70%)~~p=0.001 n=6
Memory used540,399k (± 0.01%)539,428k (± 0.02%)-971k (- 0.18%)539,215k539,551kp=0.005 n=6
Parse Time4.68s (± 0.37%)4.68s (± 0.43%)~4.66s4.71sp=0.682 n=6
Bind Time2.03s (± 1.00%)2.04s (± 1.63%)~1.99s2.07sp=0.677 n=6
Check Time22.97s (± 0.27%)22.92s (± 0.39%)~22.82s23.05sp=0.295 n=6
Emit Time0.00s (±244.70%)0.00s~~~p=0.405 n=6
Total Time29.69s (± 0.24%)29.64s (± 0.30%)~29.50s29.75sp=0.369 n=6
xstate-main - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols690,447690,412-35 (- 0.01%)~~p=0.001 n=6
Types208,639208,767+128 (+ 0.06%)~~p=0.001 n=6
Memory used586,297k (± 0.01%)586,450k (± 0.02%)+153k (+ 0.03%)586,293k586,537kp=0.025 n=6
Parse Time4.16s (± 0.67%)4.18s (± 0.94%)~4.15s4.26sp=0.225 n=6
Bind Time1.42s (± 1.31%)1.39s (± 1.08%)~1.38s1.42sp=0.050 n=6
Check Time21.07s (± 1.75%)20.67s (± 1.69%)-0.40s (- 1.91%)20.46s21.38sp=0.045 n=6
Emit Time0.00s (±244.70%)0.00s (±154.76%)~0.00s0.01sp=0.595 n=6
Total Time26.65s (± 1.43%)26.25s (± 1.48%)~26.02s27.04sp=0.078 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

@Andarist
Mateusz Burzyński (Andarist)force-pushed the infer-concrete-properties-of-reverse-mapped-types branch from d603445 to ced3cc1CompareDecember 2, 2025 18:40
@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey) Here are the results of running the top 400 repos with tsc comparing main and refs/pull/53017/merge:

Everything looks good!

@Andarist

Mateusz Burzyński (Andarist) commented Dec 5, 2025

Copy link
Copy Markdown
ContributorAuthor

As to the webpack break - I think it's acceptable, see my write up about it here

@typescript-bot

Copy link
Copy Markdown
Contributor

With 6.0 out as the final release vehicle for this codebase, we're closing all PRs that don't fit the merge criteria for post-6.0 patches. If you think this was a mistake and this PR fits the post-6.0 patch criteria, please post to the 6.0 iteration issue with details (specifically, which PR and which patch criteria it satisfies).

Next steps for PRs:

  • For crash bugfixes or language service improvements, PRs are currently accepted at the typescript-go repo
  • Changes to type system behavior should wait until after 7.0, at which point mainline TypeScript development will resume in this repository with the Go codebase
  • Library file updates (lib.d.ts etc) continue to live in this repo or the DOM Generator repo as appropriate

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Backlog BugPRs that fix a backlog bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Improve reverse mapped types inference by creating candidates from concrete index types

8 participants

@Andarist@typescript-bot@jakebailey@jcalz@weswigham@sandersn@ahejlsberg@RyanCavanaugh