Skip to content

Conversation

Andarist
Copy link
Contributor

fixes #61203

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Feb 19, 2025
@Andarist
Copy link
Contributor Author

@jakebailey could you run tests here? I was quie surprised that almost nothing has changed in the existing tests with this change 😅

@jakebailey
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 19, 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

Hey @jakebailey, the results of running the DT tests are ready.

There were interesting changes:

Branch only errors:

Package: underscore
Error:

Error: 
/mnt/vss/_work/1/DefinitelyTyped/types/underscore/underscore-tests.ts
  3012:5  error  TypeScript@local expected type to be:
  { [x: string]: string; }
got:
  { [x: string]: string; [x: number]: string; [x: symbol]: string; }                                              @definitelytyped/expect
  3013:5  error  TypeScript@local expected type to be:
  { [x: string]: string; }
got:
  { [x: string]: string; [x: number]: string; [x: symbol]: string; }                                              @definitelytyped/expect
  3014:5  error  TypeScript@local expected type to be:
  ChainType<{ [x: string]: string; }, string>
got:
  ChainType<{ [x: string]: string; [x: number]: string; [x: symbol]: string; }, string>        @definitelytyped/expect
  3022:5  error  TypeScript@local expected type to be:
  { [x: string]: boolean; }
got:
  { [x: string]: boolean; [x: number]: boolean; [x: symbol]: boolean; }                                          @definitelytyped/expect
  3023:5  error  TypeScript@local expected type to be:
  { [x: string]: boolean; }
got:
  { [x: string]: boolean; [x: number]: boolean; [x: symbol]: boolean; }                                          @definitelytyped/expect
  3024:5  error  TypeScript@local expected type to be:
  ChainType<{ [x: string]: boolean; }, boolean>
got:
  ChainType<{ [x: string]: boolean; [x: number]: boolean; [x: symbol]: boolean; }, boolean>  @definitelytyped/expect
  3032:5  error  TypeScript@local expected type to be:
  { [x: string]: any; }
got:
  { [x: string]: any; [x: number]: any; [x: symbol]: any; }                                                          @definitelytyped/expect
  3033:5  error  TypeScript@local expected type to be:
  { [x: string]: any; }
got:
  { [x: string]: any; [x: number]: any; [x: symbol]: any; }                                                          @definitelytyped/expect
  3034:5  error  TypeScript@local expected type to be:
  ChainType<{ [x: string]: any; }, any>
got:
  ChainType<{ [x: string]: any; [x: number]: any; [x: symbol]: any; }, any>                          @definitelytyped/expect
  3042:5  error  TypeScript@local expected type to be:
  { [x: string]: any; }
got:
  { [x: string]: any; [x: number]: any; [x: symbol]: any; }                                                          @definitelytyped/expect
  3043:5  error  TypeScript@local expected type to be:
  { [x: string]: any; }
got:
  { [x: string]: any; [x: number]: any; [x: symbol]: any; }                                                          @definitelytyped/expect
  3044:5  error  TypeScript@local expected type to be:
  ChainType<{ [x: string]: any; }, any>
got:
  ChainType<{ [x: string]: any; [x: number]: any; [x: symbol]: any; }, any>                          @definitelytyped/expect

✖ 12 problems (12 errors, 0 warnings)

    at combineErrorsAndWarnings (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@[email protected][email protected]/node_modules/@definitelytyped/dtslint/dist/index.js:194:28)
    at runTests (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@[email protected][email protected]/node_modules/@definitelytyped/dtslint/dist/index.js:186:20)

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/61224/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 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 196,597k (± 0.04%) 193,650k (± 0.79%) ~ 192,683k 196,774k p=0.066 n=6
Parse Time 1.61s (± 1.23%) 1.59s (± 1.56%) ~ 1.55s 1.62s p=0.513 n=6
Bind Time 0.87s (± 0.93%) 0.87s (± 0.86%) ~ 0.86s 0.88s p=0.729 n=6
Check Time 11.83s (± 0.92%) 11.74s (± 0.47%) ~ 11.69s 11.82s p=0.199 n=6
Emit Time 3.30s (± 2.29%) 3.40s (± 3.83%) ~ 3.30s 3.57s p=0.198 n=6
Total Time 17.61s (± 0.89%) 17.61s (± 0.95%) ~ 17.42s 17.87s p=1.000 n=6
angular-1 - node (v18.15.0, x64)
Errors 37 37 ~ ~ ~ p=1.000 n=6
Symbols 948,488 948,574 +86 (+ 0.01%) ~ ~ p=0.001 n=6
Types 411,006 411,017 +11 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 1,224,193k (± 0.00%) 1,224,223k (± 0.00%) ~ 1,224,170k 1,224,305k p=0.471 n=6
Parse Time 6.67s (± 0.26%) 6.64s (± 0.81%) ~ 6.54s 6.69s p=0.368 n=6
Bind Time 1.89s (± 0.52%) 1.88s (± 0.71%) ~ 1.87s 1.90s p=0.136 n=6
Check Time 31.76s (± 0.33%) 31.85s (± 0.43%) ~ 31.71s 32.06s p=0.298 n=6
Emit Time 15.27s (± 0.14%) 15.20s (± 0.57%) ~ 15.11s 15.35s p=0.065 n=6
Total Time 55.59s (± 0.18%) 55.56s (± 0.20%) ~ 55.42s 55.70s p=0.689 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,347,891 2,347,891 ~ ~ ~ p=1.000 n=6
Types 845,644 845,708 +64 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 2,120,269k (± 0.00%) 2,120,391k (± 0.00%) +122k (+ 0.01%) 2,120,320k 2,120,530k p=0.005 n=6
Parse Time 7.27s (± 0.28%) 7.25s (± 0.14%) ~ 7.24s 7.27s p=0.180 n=6
Bind Time 2.46s (± 0.48%) 2.46s (± 0.48%) ~ 2.44s 2.47s p=1.000 n=6
Check Time 72.40s (± 0.29%) 72.81s (± 0.76%) ~ 72.01s 73.39s p=0.230 n=6
Emit Time 0.15s (± 2.75%) 0.15s (± 3.77%) ~ 0.14s 0.15s p=0.282 n=6
Total Time 82.28s (± 0.25%) 82.67s (± 0.68%) ~ 81.86s 83.24s p=0.336 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,228,510 1,228,510 ~ ~ ~ p=1.000 n=6
Types 266,960 266,960 ~ ~ ~ p=1.000 n=6
Memory used 2,358,847k (± 0.03%) 2,358,445k (± 0.02%) ~ 2,357,939k 2,359,162k p=0.298 n=6
Parse Time 5.20s (± 0.87%) 5.19s (± 1.22%) ~ 5.11s 5.26s p=0.810 n=6
Bind Time 1.78s (± 1.03%) 1.78s (± 0.90%) ~ 1.76s 1.80s p=0.807 n=6
Check Time 35.23s (± 0.17%) 35.20s (± 0.35%) ~ 35.09s 35.43s p=0.298 n=6
Emit Time 2.98s (± 0.86%) 2.97s (± 1.16%) ~ 2.93s 3.01s p=0.298 n=6
Total Time 45.19s (± 0.16%) 45.14s (± 0.36%) ~ 44.91s 45.36s p=0.574 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,228,510 1,228,510 ~ ~ ~ p=1.000 n=6
Types 266,960 266,960 ~ ~ ~ p=1.000 n=6
Memory used 2,426,103k (± 0.02%) 2,425,721k (± 0.01%) ~ 2,425,351k 2,426,025k p=0.199 n=6
Parse Time 5.48s (± 0.58%) 5.48s (± 0.60%) ~ 5.46s 5.53s p=1.000 n=6
Bind Time 1.80s (± 1.51%) 1.78s (± 0.90%) ~ 1.77s 1.81s p=0.310 n=6
Check Time 35.36s (± 0.22%) 35.34s (± 0.38%) ~ 35.10s 35.48s p=0.936 n=6
Emit Time 3.06s (± 1.98%) 3.02s (± 1.00%) ~ 2.98s 3.06s p=0.199 n=6
Total Time 45.70s (± 0.19%) 45.62s (± 0.40%) ~ 45.27s 45.77s p=0.521 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 262,816 262,816 ~ ~ ~ p=1.000 n=6
Types 106,833 106,833 ~ ~ ~ p=1.000 n=6
Memory used 440,533k (± 0.01%) 440,486k (± 0.01%) ~ 440,402k 440,584k p=0.173 n=6
Parse Time 3.54s (± 0.70%) 3.52s (± 0.73%) ~ 3.48s 3.56s p=0.252 n=6
Bind Time 1.31s (± 0.89%) 1.30s (± 0.63%) ~ 1.29s 1.31s p=0.271 n=6
Check Time 18.93s (± 0.43%) 18.92s (± 0.51%) ~ 18.78s 19.06s p=0.936 n=6
Emit Time 1.50s (± 1.24%) 1.52s (± 0.54%) ~ 1.51s 1.53s p=0.192 n=6
Total Time 25.28s (± 0.44%) 25.26s (± 0.39%) ~ 25.13s 25.42s p=0.808 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,448k (± 0.04%) 371,289k (± 0.01%) -160k (- 0.04%) 371,229k 371,386k p=0.020 n=6
Parse Time 2.93s (± 0.50%) 2.89s (± 1.11%) ~ 2.86s 2.95s p=0.052 n=6
Bind Time 1.61s (± 1.60%) 1.60s (± 1.78%) ~ 1.57s 1.65s p=0.421 n=6
Check Time 16.47s (± 0.23%) 16.43s (± 0.32%) ~ 16.34s 16.48s p=0.127 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 21.02s (± 0.27%) 20.92s (± 0.36%) -0.10s (- 0.48%) 20.77s 20.97s p=0.044 n=6
vscode - node (v18.15.0, x64)
Errors 1 1 ~ ~ ~ p=1.000 n=6
Symbols 3,220,554 3,220,553 -1 (- 0.00%) ~ ~ p=0.001 n=6
Types 1,092,683 1,092,693 +10 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 3,294,582k (± 0.01%) 3,294,523k (± 0.01%) ~ 3,294,149k 3,294,800k p=0.810 n=6
Parse Time 14.23s (± 0.25%) 14.33s (± 0.47%) +0.10s (+ 0.70%) 14.23s 14.41s p=0.029 n=6
Bind Time 4.59s (± 0.77%) 4.60s (± 0.83%) ~ 4.56s 4.65s p=0.934 n=6
Check Time 88.94s (± 1.48%) 88.03s (± 0.96%) ~ 87.06s 89.46s p=0.128 n=6
Emit Time 24.55s (± 8.10%) 27.23s (± 2.28%) ~ 25.97s 27.57s p=0.093 n=6
Total Time 132.32s (± 2.35%) 134.19s (± 0.37%) ~ 133.41s 134.76s p=0.093 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 293,866 293,866 ~ ~ ~ p=1.000 n=6
Types 119,617 119,617 ~ ~ ~ p=1.000 n=6
Memory used 447,200k (± 0.02%) 447,134k (± 0.02%) ~ 447,014k 447,213k p=0.109 n=6
Parse Time 4.07s (± 1.76%) 4.09s (± 0.99%) ~ 4.05s 4.16s p=0.421 n=6
Bind Time 1.76s (± 1.32%) 1.77s (± 1.34%) ~ 1.74s 1.81s p=1.000 n=6
Check Time 18.78s (± 0.59%) 18.71s (± 0.38%) ~ 18.63s 18.82s p=0.230 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.62s (± 0.59%) 24.56s (± 0.31%) ~ 24.45s 24.64s p=0.575 n=6
xstate-main - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 558,084 558,084 ~ ~ ~ p=1.000 n=6
Types 186,415 186,419 +4 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 495,035k (± 0.04%) 495,000k (± 0.04%) ~ 494,575k 495,154k p=0.689 n=6
Parse Time 3.41s (± 0.84%) 3.41s (± 0.47%) ~ 3.39s 3.43s p=0.742 n=6
Bind Time 1.19s (± 1.15%) 1.19s (± 0.63%) ~ 1.18s 1.20s p=0.672 n=6
Check Time 19.67s (± 1.66%) 19.72s (± 2.63%) ~ 19.47s 20.77s p=0.688 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.27s (± 1.39%) 24.31s (± 2.11%) ~ 24.04s 25.35s p=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)
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/61224/merge:

Something interesting changed - please have a look.

Details

nextauthjs/next-auth

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

packages/adapter-drizzle/tsconfig.json

  • error TS2345: Argument of type 'SqlFlavorOptions & MySqlDatabase<MySqlQueryResultHKT, PreparedQueryHKTBase, Record<string, unknown>, TablesRelationalConfig>' is not assignable to parameter of type 'MySqlDatabase<MySqlQueryResultHKT, PreparedQueryHKTBase, any, ExtractTablesWithRelations<any>>'.
  • error TS2345: Argument of type 'SqlFlavorOptions & PgDatabase<PgQueryResultHKT, Record<string, unknown>, TablesRelationalConfig>' is not assignable to parameter of type 'PgDatabase<PgQueryResultHKT, any, ExtractTablesWithRelations<any>>'.
  • error TS2345: Argument of type 'SqlFlavorOptions & BaseSQLiteDatabase<"sync" | "async", unknown, Record<string, unknown>, TablesRelationalConfig>' is not assignable to parameter of type 'BaseSQLiteDatabase<"sync" | "async", any, any, ExtractTablesWithRelations<any>>'.

react-navigation/react-navigation

9 of 14 projects failed to build with the old tsc and were ignored

tsconfig.json

example/tsconfig.json

@Copilot Copilot AI review requested due to automatic review settings August 25, 2025 08:40
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses issue #61203 by revising how TypeScript handles mapped types with any and keyof any constraints. The fix ensures that mapped types over any properly include all valid index key types (string, number, and symbol) rather than just string keys.

  • Updates the type checker logic to handle any types in mapped type key iteration
  • Modifies property name handling for mapped types with any constraints
  • Simplifies index key type determination by removing special any handling

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/cases/conformance/types/mapped/mappedTypeWithAny.ts Adds test cases demonstrating the fixed behavior for mapped types with keyof any constraints
tests/baselines/reference/mappedTypeWithAny.types Updates type inference baselines to show proper string/number/symbol support for keyof any
tests/baselines/reference/mappedTypeWithAny.symbols Updates symbol resolution baselines for the new test cases
tests/baselines/reference/mappedTypeWithAny.js Updates compiled JavaScript output baselines
tests/baselines/reference/mappedTypeWithAny.errors.txt Updates error reporting baselines (no new errors expected)
src/compiler/checker.ts Core compiler logic changes to properly handle any types in mapped type iteration
Comments suppressed due to low confidence (1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Status: Not started
Development

Successfully merging this pull request may close these issues.

Sometimes, keyof any is string
3 participants