Skip to content

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Sep 2, 2025

fixes #62380

@@ -190,8 +190,8 @@ test("windows-process-tree", async () => {
> : ^^^^^^^^^^^^
>"windows-process-tree" : "windows-process-tree"
> : ^^^^^^^^^^^^^^^^^^^^^^
>async () => { return new Promise((resolve, reject) => { getProcessTree(123, (tree) => { if (tree) { resolve(); } else { reject(new Error("windows-process-tree")); } }); });} : () => Promise<void>
> : ^^^^^^^^^^^^^^^^^^^
>async () => { return new Promise((resolve, reject) => { getProcessTree(123, (tree) => { if (tree) { resolve(); } else { reject(new Error("windows-process-tree")); } }); });} : (this: Context) => Promise<void>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

assigned this parameter in an arrow isn't anything new, it can happen with other context-sensitive arguments with this signature: TS playground

Comment on lines 37060 to 37063
if (!node.typeArguments && checkMode & CheckMode.SkipContextSensitive && isContextSensitive(node)) {
skippedGenericFunction(node, checkMode);
return resolvingSignature;
}
Copy link
Contributor Author

@Andarist Andarist Sep 2, 2025

Choose a reason for hiding this comment

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

This PR is put together quickly - as an experiment. I didn't think through how those new codepaths that call skippedGenericFunction and return resolvingSignature might affect existing code.

The existing test suite doesn't immediately show this is a terrible idea though. It would be nice if an extended test suite could be ran for this experiment. cc @jakebailey

EDIT:// actually... the self-check fails here so it's probably not worth running the extended test suite at this point

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jakebailey could you run tests here now? I kinda fully expect this PR to be garbage and break things but I'd like to get some test cases from the compiler usage in the wild that could be included in the in-repo test suite

@Andarist
Copy link
Contributor Author

Andarist commented Sep 2, 2025

self-check repro: TS playground

@jakebailey
Copy link
Member

@typescript-bot test it
@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 3, 2025

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

Command Status Results
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
Copy link
Collaborator

typescript-bot commented Sep 3, 2025

Hey @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/165981/artifacts?artifactName=tgz&fileId=07F25A9EE0CA3527CFFB96B8B50D152E78864D37F9DF0FE1226DEE125038733A02&fileName=/typescript-6.0.0-insiders.20250903.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-62381-3".;

@typescript-bot
Copy link
Collaborator

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

There were interesting changes:

Branch only errors:

Package: screeps
Error:

Error: 
/mnt/vss/_work/1/DefinitelyTyped/types/screeps/screeps-tests.ts
  676:28  error  TypeScript@local compile error: 
Property 'getDirectionTo' does not exist on type 'ConstructionSite<BuildableStructureConstant> | Creep | PowerCreep | StructureController | ... 28 more ... | StructureWall'.
  Property 'getDirectionTo' does not exist on type 'ConstructionSite<BuildableStructureConstant>'  @definitelytyped/expect

✖ 1 problem (1 error, 0 warnings)

    at combineErrorsAndWarnings (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.33_typescript@6.0.0-dev.20250903/node_modules/@definitelytyped/dtslint/dist/index.js:199:28)
    at runTests (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.33_typescript@6.0.0-dev.20250903/node_modules/@definitelytyped/dtslint/dist/index.js:191: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/62381/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

effect

tsconfig.json

tsconfig.build.json

fp-ts

tsconfig.eslint.json

puppeteer

packages/puppeteer-core/tsconfig.json

@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,370 62,379 +9 (+ 0.01%) ~ ~ p=0.001 n=6
Types 50,386 50,389 +3 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 193,536k (± 0.77%) 193,650k (± 0.75%) +113k (+ 0.06%) 192,954k 196,610k p=0.045 n=6
Parse Time 1.30s (± 1.25%) 1.30s (± 0.63%) ~ 1.29s 1.31s p=0.865 n=6
Bind Time 0.73s 0.73s ~ ~ ~ p=1.000 n=6
Check Time 9.76s (± 0.17%) 9.76s (± 0.33%) ~ 9.72s 9.80s p=0.806 n=6
Emit Time 2.74s (± 0.79%) 2.73s (± 0.89%) ~ 2.70s 2.77s p=0.466 n=6
Total Time 14.54s (± 0.19%) 14.52s (± 0.24%) ~ 14.49s 14.57s p=0.419 n=6
angular-1 - node (v18.15.0, x64)
Errors 1 1 ~ ~ ~ p=1.000 n=6
Symbols 948,914 949,807 +893 (+ 0.09%) ~ ~ p=0.001 n=6
Types 410,884 411,070 +186 (+ 0.05%) ~ ~ p=0.001 n=6
Memory used 1,246,651k (± 0.00%) 1,247,062k (± 0.01%) +412k (+ 0.03%) 1,246,956k 1,247,142k p=0.005 n=6
Parse Time 6.51s (± 0.40%) 6.48s (± 0.42%) ~ 6.45s 6.51s p=0.126 n=6
Bind Time 1.87s (± 0.59%) 1.87s (± 0.40%) ~ 1.86s 1.88s p=1.000 n=6
Check Time 32.12s (± 0.26%) 32.31s (± 0.57%) ~ 32.10s 32.53s p=0.128 n=6
Emit Time 14.83s (± 0.71%) 14.83s (± 0.33%) ~ 14.77s 14.89s p=0.629 n=6
Total Time 55.34s (± 0.31%) 55.49s (± 0.40%) ~ 55.25s 55.76s p=0.199 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,545,910 2,548,719 +2,809 (+ 0.11%) ~ ~ p=0.001 n=6
Types 902,549 905,184 +2,635 (+ 0.29%) ~ ~ p=0.001 n=6
Memory used 2,830,882k (± 0.00%) 2,831,979k (± 0.00%) +1,097k (+ 0.04%) 2,831,906k 2,832,096k p=0.005 n=6
Parse Time 8.76s (± 0.24%) 8.77s (± 0.38%) ~ 8.73s 8.82s p=0.571 n=6
Bind Time 2.24s (± 0.78%) 2.23s (± 0.47%) ~ 2.21s 2.24s p=0.219 n=6
Check Time 87.02s (± 1.70%) 87.48s (± 1.76%) ~ 85.46s 89.23s p=0.378 n=6
Emit Time 0.30s (± 4.01%) 0.30s (± 1.79%) ~ 0.30s 0.31s p=0.441 n=6
Total Time 98.32s (± 1.52%) 98.78s (± 1.56%) ~ 96.73s 100.54s p=0.471 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,236,922 1,237,002 +80 (+ 0.01%) ~ ~ p=0.001 n=6
Types 259,638 259,678 +40 (+ 0.02%) ~ ~ p=0.001 n=6
Memory used 2,447,715k (± 6.08%) 2,569,085k (±11.81%) ~ 2,387,281k 3,113,573k p=0.173 n=6
Parse Time 5.18s (± 0.70%) 5.23s (± 1.20%) ~ 5.17s 5.33s p=0.170 n=6
Bind Time 1.81s (± 1.09%) 1.81s (± 0.81%) ~ 1.78s 1.82s p=0.365 n=6
Check Time 35.11s (± 0.41%) 35.06s (± 0.82%) ~ 34.49s 35.25s p=0.873 n=6
Emit Time 2.96s (± 2.88%) 2.99s (± 1.11%) ~ 2.94s 3.03s p=0.872 n=6
Total Time 45.05s (± 0.47%) 45.08s (± 0.61%) ~ 44.59s 45.38s p=0.810 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,236,922 1,237,002 +80 (+ 0.01%) ~ ~ p=0.001 n=6
Types 259,638 259,678 +40 (+ 0.02%) ~ ~ p=0.001 n=6
Memory used 3,060,348k (± 9.64%) 3,060,475k (± 9.65%) ~ 2,457,302k 3,181,444k p=0.575 n=6
Parse Time 8.52s (± 1.44%) 8.51s (± 0.93%) ~ 8.36s 8.58s p=0.378 n=6
Bind Time 2.70s (± 2.23%) 2.69s (± 1.17%) ~ 2.63s 2.72s p=0.809 n=6
Check Time 52.70s (± 0.46%) 52.68s (± 0.69%) ~ 52.00s 53.01s p=1.000 n=6
Emit Time 4.37s (± 1.67%) 4.35s (± 1.76%) ~ 4.21s 4.43s p=0.575 n=6
Total Time 68.28s (± 0.49%) 68.22s (± 0.64%) ~ 67.42s 68.67s p=0.810 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 262,416 262,436 +20 (+ 0.01%) ~ ~ p=0.001 n=6
Types 103,917 103,921 +4 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 441,670k (± 0.01%) 441,771k (± 0.01%) +101k (+ 0.02%) 441,721k 441,825k p=0.008 n=6
Parse Time 3.53s (± 1.09%) 3.58s (± 1.57%) ~ 3.53s 3.67s p=0.196 n=6
Bind Time 1.33s (± 1.11%) 1.33s (± 1.02%) ~ 1.31s 1.35s p=0.568 n=6
Check Time 18.93s (± 0.37%) 18.95s (± 0.20%) ~ 18.90s 18.99s p=0.335 n=6
Emit Time 1.53s (± 1.07%) 1.53s (± 0.36%) ~ 1.52s 1.53s p=1.000 n=6
Total Time 25.31s (± 0.39%) 25.39s (± 0.29%) ~ 25.31s 25.52s p=0.173 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 72 72 ~ ~ ~ p=1.000 n=6
Symbols 225,367 225,384 +17 (+ 0.01%) ~ ~ p=0.001 n=6
Types 94,290 94,287 -3 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 371,225k (± 0.05%) 371,256k (± 0.03%) ~ 371,141k 371,395k p=0.173 n=6
Parse Time 3.61s (± 1.01%) 3.58s (± 0.62%) ~ 3.55s 3.61s p=0.145 n=6
Bind Time 1.96s (± 1.75%) 1.96s (± 0.60%) ~ 1.94s 1.97s p=0.627 n=6
Check Time 20.36s (± 0.43%) 20.37s (± 0.45%) ~ 20.20s 20.47s p=0.873 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 25.94s (± 0.50%) 25.91s (± 0.33%) ~ 25.75s 25.99s p=0.687 n=6
vscode - node (v18.15.0, x64)
Errors 1 1 ~ ~ ~ p=1.000 n=6
Symbols 3,883,104 3,887,692 +4,588 (+ 0.12%) ~ ~ p=0.001 n=6
Types 1,223,583 1,226,954 +3,371 (+ 0.28%) ~ ~ p=0.001 n=6
Memory used 3,708,405k (± 0.01%) 3,711,159k (± 0.01%) +2,754k (+ 0.07%) 3,710,821k 3,711,478k p=0.005 n=6
Parse Time 18.78s (± 0.32%) 18.82s (± 0.53%) ~ 18.74s 19.00s p=0.810 n=6
Bind Time 6.00s (± 0.82%) 5.97s (± 0.41%) ~ 5.93s 6.00s p=0.228 n=6
Check Time 124.89s (± 2.86%) 127.36s (± 4.66%) ~ 121.67s 136.80s p=0.575 n=6
Emit Time 42.28s (± 9.47%) 44.02s (±21.46%) ~ 36.91s 62.32s p=0.936 n=6
Total Time 191.96s (± 2.06%) 196.16s (± 7.07%) ~ 187.40s 223.90s p=0.810 n=6
webpack - node (v18.15.0, x64)
Errors 37 37 ~ ~ ~ p=1.000 n=6
Symbols 361,681 361,817 +136 (+ 0.04%) ~ ~ p=0.001 n=6
Types 159,185 159,230 +45 (+ 0.03%) ~ ~ p=0.001 n=6
Memory used 519,054k (± 0.06%) 518,766k (± 0.03%) ~ 518,595k 518,982k p=0.109 n=6
Parse Time 4.64s (± 0.46%) 4.62s (± 0.37%) -0.02s (- 0.50%) 4.60s 4.64s p=0.049 n=6
Bind Time 1.91s (± 1.87%) 1.90s (± 0.61%) ~ 1.89s 1.92s p=0.686 n=6
Check Time 22.11s (± 1.14%) 22.39s (± 1.06%) ~ 21.95s 22.67s p=0.115 n=6
Emit Time 0.00s 0.00s (±244.70%) ~ 0.00s 0.01s p=0.405 n=6
Total Time 28.66s (± 0.71%) 28.91s (± 0.79%) ~ 28.49s 29.19s p=0.065 n=6
xstate-main - node (v18.15.0, x64)
Errors 30 33 🔻+3 (+10.00%) ~ ~ p=0.001 n=6
Symbols 668,461 671,219 +2,758 (+ 0.41%) ~ ~ p=0.001 n=6
Types 200,558 201,991 +1,433 (+ 0.71%) ~ ~ p=0.001 n=6
Memory used 573,894k (± 0.03%) 574,547k (± 0.02%) +653k (+ 0.11%) 574,403k 574,739k p=0.005 n=6
Parse Time 4.29s (± 0.50%) 4.28s (± 0.48%) ~ 4.25s 4.30s p=0.677 n=6
Bind Time 1.33s (± 0.88%) 1.32s (± 1.27%) ~ 1.30s 1.34s p=0.183 n=6
Check Time 20.27s (± 1.84%) 20.50s (± 1.84%) ~ 20.09s 20.87s p=0.066 n=6
Emit Time 0.00s 0.00s (±244.70%) ~ 0.00s 0.01s p=0.405 n=6
Total Time 25.89s (± 1.49%) 26.11s (± 1.51%) ~ 25.69s 26.49s p=0.092 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/62381/merge:

Something interesting changed - please have a look.

Details

actualbudget/actual

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

tsconfig.json

colinhacks/zod

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

packages/zod/tsconfig.test.json

microsoft/vscode

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

extensions/git/tsconfig.json

recharts/recharts

tsconfig.json

test/tsconfig.json

storybook/tsconfig.json

reduxjs/reselect

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

typescript_test/tsconfig.json

type-tests/tsconfig.json

@Andarist
Copy link
Contributor Author

Andarist commented Sep 4, 2025

Repros:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Context sensitive inference fails with class instance
3 participants