Skip to content

Allow non-generic return types to be read from single generic call signatures - #54477

Merged
Nathan Shively-Sanders (sandersn) merged 5 commits into
microsoft:mainfrom
Andarist:non-generic-return-types-avoid-circularity
Nov 29, 2023
Merged

Allow non-generic return types to be read from single generic call signatures#54477
Nathan Shively-Sanders (sandersn) merged 5 commits into
microsoft:mainfrom
Andarist:non-generic-return-types-avoid-circularity

Conversation

@Andarist

Copy link
Copy Markdown
Contributor

This PR permits circular references in some return types of generic call signatures - something that is already allowed in non-generic call signatures.

If the return type doesn't depend on type variables then the same thing can be allowed for it (including cases with instantiated return types not depending on type variables).

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

Copy link
Copy Markdown
Contributor

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@@ -0,0 +1,53 @@
// @strict: true

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

test case reduced from https://github.com/Thinkmill/graphql-ts

interestingly, this one also depends on a quite recent change from #53246

Comment on lines +7 to +11
declare function fn2<T>(): (cb: () => any) => (a: T) => void;
const res2 = fn2()(() => res2);

declare function fn3<T>(): <T2>(cb: (arg: T2) => any) => (a: T) => void;
const res3 = fn3()(() => res3);

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

The only diff between those 2 is the T2 type parameter. The fn2 case works today but the fn3 doesn't - even though its return type doesn't actually depend on T2.

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.

How does fn3 fail? It looks like inference still fails, given that res3: (a: unknown) => void -- but I'm not sure, and I don't see how to observe what's inferred for T2. Maybe the return type of fn3 should be (a: T) => T2 in the test?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

How does fn3 fail?

We end up with: "'res3' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.(7022)"

It looks like inference still fails, given that res3: (a: unknown) => void

It doesn't exactly fail, it's just that there are no inference candidates here so the constraint is used and that's unknown. This isn't meant to be used as a compelling use case for this PR, just a super minimal repro. The better motivating example is showcased in circularReferenceInReturnType2.ts.

I don't see how to observe what's inferred for T2.

It's just unknown. I re-checked this with console.log(typeToString(inference.typeParameter), typeToString(inference.inferredType)) before exiting getInferredType.

Maybe the return type of fn3 should be (a: T) => T2 in the test?

That's not good here because that reintroduces the circularity because the return type starts to depend on a type parameter again.

@sandersn

Copy link
Copy Markdown
Member

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 19, 2023

Copy link
Copy Markdown
Contributor

Heya Nathan Shively-Sanders (@sandersn), I've started to run the extended test suite on this PR at 3b17f59. You can monitor the build here.

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 19, 2023

Copy link
Copy Markdown
Contributor

Heya Nathan Shively-Sanders (@sandersn), I've started to run the diff-based user code test suite (tsserver) on this PR at 3b17f59. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 19, 2023

Copy link
Copy Markdown
Contributor

Heya Nathan Shively-Sanders (@sandersn), I've started to run the perf test suite on this PR at 3b17f59. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 19, 2023

Copy link
Copy Markdown
Contributor

Heya Nathan Shively-Sanders (@sandersn), I've started to run the diff-based user code test suite on this PR at 3b17f59. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 19, 2023

Copy link
Copy Markdown
Contributor

Heya Nathan Shively-Sanders (@sandersn), I've started to run the diff-based top-repos suite (tsserver) on this PR at 3b17f59. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 19, 2023

Copy link
Copy Markdown
Contributor

Heya Nathan Shively-Sanders (@sandersn), I've started to run the diff-based top-repos suite on this PR at 3b17f59. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 19, 2023

Copy link
Copy Markdown
Contributor

Heya Nathan Shively-Sanders (@sandersn), I've started to run the parallelized Definitely Typed test suite on this PR at 3b17f59. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 19, 2023

Copy link
Copy Markdown
Contributor

Heya Nathan Shively-Sanders (@sandersn), I've started to run the tarball bundle task on this PR at 3b17f59. You can monitor the build here.

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 19, 2023

Copy link
Copy Markdown
Contributor

Hey Nathan Shively-Sanders (@sandersn), 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/155528/artifacts?artifactName=tgz&fileId=CD5569389C68C626CC981FFA7D53848AD8D9738C271476309818945184221E5502&fileName=/typescript-5.2.0-insiders.20230619.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@5.2.0-pr-54477-10".;

Comment threadsrc/compiler/checker.ts
Comment threadtests/baselines/reference/arrayFrom.types
Comment on lines +7 to +11
declare function fn2<T>(): (cb: () => any) => (a: T) => void;
const res2 = fn2()(() => res2);

declare function fn3<T>(): <T2>(cb: (arg: T2) => any) => (a: T) => void;
const res3 = fn3()(() => res3);

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.

How does fn3 fail? It looks like inference still fails, given that res3: (a: unknown) => void -- but I'm not sure, and I don't see how to observe what's inferred for T2. Maybe the return type of fn3 should be (a: T) => T2 in the test?

@typescript-bot

Copy link
Copy Markdown
Contributor

Nathan Shively-Sanders (@sandersn) Here are the results of running the user test suite comparing main and refs/pull/54477/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Unknown failure"
  • 1 instance of "Package install failed"

Otherwise...

Something interesting changed - please have a look.

Details

rxjs-src

/mnt/ts_downloads/rxjs-src/build.sh

  • [NEW] error TS2428: All declarations of 'WeakMap' must have identical type parameters.
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
  • [MISSING] error TS2428: All declarations of 'WeakMap' must have identical type parameters.
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)

@typescript-bot

Copy link
Copy Markdown
Contributor

Nathan Shively-Sanders (@sandersn) Here are the results of running the user test suite comparing main and refs/pull/54477/merge:

Everything looks good!

@typescript-bot

Copy link
Copy Markdown
Contributor

Nathan Shively-Sanders (@sandersn)
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - main..54477
Metricmain54477DeltaBestWorstp-value
Angular - node (v18.10.0, x64)
Memory used366,176k (± 0.01%)366,130k (± 0.01%)-47k (- 0.01%)366,090k366,186kp=0.031 n=6
Parse Time3.41s (± 0.34%)3.40s (± 0.80%)~3.38s3.43sp=0.869 n=6
Bind Time1.11s (± 0.94%)1.12s (± 0.88%)~1.10s1.13sp=0.547 n=6
Check Time8.80s (± 0.37%)8.82s (± 0.61%)~8.76s8.89sp=0.570 n=6
Emit Time7.41s (± 0.46%)7.44s (± 0.53%)~7.39s7.50sp=0.169 n=6
Total Time20.73s (± 0.21%)20.78s (± 0.38%)~20.69s20.88sp=0.419 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used191,799k (± 1.18%)190,859k (± 0.03%)~190,749k190,900kp=0.378 n=6
Parse Time1.51s (± 0.50%)1.51s (± 1.11%)~1.50s1.54sp=0.730 n=6
Bind Time0.77s (± 0.97%)0.77s (± 0.00%)~0.77s0.77sp=0.598 n=6
Check Time9.51s (± 0.79%)9.46s (± 0.27%)~9.44s9.50sp=0.468 n=6
Emit Time2.76s (± 1.62%)2.74s (± 1.16%)~2.70s2.79sp=0.629 n=6
Total Time14.54s (± 0.59%)14.48s (± 0.35%)~14.42s14.55sp=0.148 n=6
Monaco - node (v18.10.0, x64)
Memory used346,613k (± 0.01%)346,641k (± 0.01%)~346,596k346,686kp=0.173 n=6
Parse Time2.58s (± 0.53%)2.58s (± 0.57%)~2.56s2.60sp=0.934 n=6
Bind Time1.00s (± 0.51%)1.00s (± 0.41%)~0.99s1.00sp=0.114 n=6
Check Time7.15s (± 0.32%)7.16s (± 0.54%)~7.11s7.22sp=0.571 n=6
Emit Time4.22s (± 0.24%)4.24s (± 0.94%)~4.19s4.29sp=0.293 n=6
Total Time14.95s (± 0.29%)14.98s (± 0.45%)~14.90s15.08sp=0.521 n=6
TFS - node (v18.10.0, x64)
Memory used300,653k (± 0.00%)300,654k (± 0.01%)~300,618k300,682kp=1.000 n=6
Parse Time2.06s (± 1.50%)2.06s (± 1.08%)~2.03s2.09sp=0.870 n=6
Bind Time1.13s (± 0.72%)1.14s (± 0.66%)~1.13s1.15sp=0.082 n=6
Check Time6.64s (± 0.43%)6.65s (± 0.70%)~6.60s6.72sp=0.625 n=6
Emit Time3.86s (± 0.61%)3.86s (± 0.68%)~3.83s3.89sp=0.808 n=6
Total Time13.69s (± 0.28%)13.71s (± 0.25%)~13.66s13.76sp=0.686 n=6
material-ui - node (v18.10.0, x64)
Memory used481,044k (± 0.00%)481,035k (± 0.01%)~480,998k481,084kp=0.630 n=6
Parse Time3.10s (± 0.17%)3.10s (± 0.60%)~3.08s3.13sp=0.933 n=6
Bind Time0.90s (± 0.57%)0.91s (± 1.13%)~0.90s0.93sp=0.070 n=6
Check Time16.85s (± 0.60%)16.85s (± 0.59%)~16.76s17.04sp=0.810 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time20.86s (± 0.46%)20.87s (± 0.58%)~20.76s21.10sp=0.872 n=6
xstate - node (v18.10.0, x64)
Memory used563,199k (± 0.03%)563,183k (± 0.03%)~562,930k563,342kp=0.810 n=6
Parse Time3.83s (± 0.35%)3.82s (± 0.59%)~3.80s3.85sp=0.805 n=6
Bind Time1.61s (± 0.65%)1.62s (± 0.91%)~1.60s1.64sp=0.413 n=6
Check Time2.79s (± 0.64%)2.78s (± 0.83%)~2.75s2.81sp=0.573 n=6
Emit Time0.08s (± 0.00%)0.08s (± 0.00%)~0.08s0.08sp=1.000 n=6
Total Time8.32s (± 0.38%)8.31s (± 0.24%)~8.28s8.33sp=0.373 n=6
Angular - node (v16.17.1, x64)
Memory used365,533k (± 0.01%)365,523k (± 0.01%)~365,470k365,583kp=0.688 n=6
Parse Time3.56s (± 0.15%)3.55s (± 0.47%)~3.53s3.57sp=0.666 n=6
Bind Time1.18s (± 0.54%)1.18s (± 0.64%)~1.17s1.19sp=0.718 n=6
Check Time9.60s (± 0.56%)9.64s (± 0.46%)~9.59s9.71sp=0.147 n=6
Emit Time7.90s (± 0.52%)7.95s (± 0.40%)+0.05s (+ 0.70%)7.91s8.00sp=0.024 n=6
Total Time22.24s (± 0.38%)22.33s (± 0.31%)~22.20s22.38sp=0.066 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used193,676k (± 0.92%)193,170k (± 0.72%)~192,552k195,999kp=0.689 n=6
Parse Time1.58s (± 1.35%)1.60s (± 1.58%)~1.55s1.62sp=0.164 n=6
Bind Time0.83s (± 0.62%)0.82s (± 0.92%)~0.81s0.83sp=0.247 n=6
Check Time10.15s (± 1.03%)10.21s (± 1.13%)~10.07s10.42sp=0.422 n=6
Emit Time3.00s (± 1.20%)2.98s (± 0.46%)~2.96s2.99sp=0.166 n=6
Total Time15.56s (± 0.62%)15.61s (± 0.63%)~15.48s15.78sp=0.574 n=6
Monaco - node (v16.17.1, x64)
Memory used345,863k (± 0.00%)345,886k (± 0.00%)+24k (+ 0.01%)345,867k345,903kp=0.013 n=6
Parse Time2.73s (± 0.60%)2.73s (± 0.60%)~2.72s2.76sp=1.000 n=6
Bind Time1.08s (± 0.91%)1.08s (± 0.97%)~1.07s1.10sp=0.547 n=6
Check Time7.83s (± 0.51%)7.90s (± 0.73%)+0.06s (+ 0.81%)7.82s7.99sp=0.044 n=6
Emit Time4.43s (± 0.47%)4.46s (± 0.85%)~4.40s4.50sp=0.195 n=6
Total Time16.08s (± 0.35%)16.17s (± 0.58%)~16.06s16.31sp=0.092 n=6
TFS - node (v16.17.1, x64)
Memory used300,002k (± 0.01%)299,984k (± 0.01%)~299,956k300,010kp=0.335 n=6
Parse Time2.17s (± 0.79%)2.15s (± 0.48%)~2.14s2.17sp=0.121 n=6
Bind Time1.23s (± 1.11%)1.23s (± 1.22%)~1.21s1.25sp=0.932 n=6
Check Time7.31s (± 0.35%)7.30s (± 0.57%)~7.27s7.38sp=0.258 n=6
Emit Time4.37s (± 1.06%)4.33s (± 0.48%)~4.31s4.36sp=0.256 n=6
Total Time15.07s (± 0.41%)15.02s (± 0.38%)~14.98s15.13sp=0.198 n=6
material-ui - node (v16.17.1, x64)
Memory used480,336k (± 0.01%)480,290k (± 0.00%)~480,263k480,314kp=0.173 n=6
Parse Time3.26s (± 0.51%)3.25s (± 0.45%)~3.24s3.28sp=0.247 n=6
Bind Time0.94s (± 0.43%)0.94s (± 0.55%)~0.93s0.94sp=0.595 n=6
Check Time17.86s (± 0.52%)17.89s (± 1.01%)~17.69s18.23sp=0.809 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time22.06s (± 0.43%)22.08s (± 0.88%)~21.88s22.45sp=1.000 n=6
xstate - node (v16.17.1, x64)
Memory used560,637k (± 0.03%)560,573k (± 0.01%)~560,506k560,627kp=0.873 n=6
Parse Time3.99s (± 0.41%)3.99s (± 0.46%)~3.97s4.01sp=0.517 n=6
Bind Time1.75s (± 0.48%)1.75s (± 0.78%)~1.73s1.77sp=0.672 n=6
Check Time3.06s (± 0.41%)3.07s (± 0.43%)~3.05s3.09sp=0.413 n=6
Emit Time0.09s (± 0.00%)0.09s (± 0.00%)~0.09s0.09sp=1.000 n=6
Total Time8.90s (± 0.35%)8.90s (± 0.08%)~8.89s8.91sp=0.870 n=6
Angular - node (v14.21.3, x64)
Memory used359,562k (± 0.01%)359,616k (± 0.01%)~359,577k359,671kp=0.173 n=6
Parse Time3.67s (± 0.76%)3.67s (± 0.38%)~3.64s3.68sp=0.807 n=6
Bind Time1.22s (± 0.67%)1.22s (± 0.33%)~1.22s1.23sp=0.206 n=6
Check Time10.06s (± 0.36%)10.08s (± 0.52%)~10.02s10.17sp=0.747 n=6
Emit Time8.33s (± 1.01%)8.29s (± 0.25%)~8.27s8.32sp=0.573 n=6
Total Time23.27s (± 0.51%)23.25s (± 0.27%)~23.16s23.34sp=0.936 n=6
Compiler-Unions - node (v14.21.3, x64)
Memory used188,480k (± 0.69%)187,922k (± 0.02%)~187,865k187,965kp=0.128 n=6
Parse Time1.61s (± 0.32%)1.61s (± 0.32%)~1.60s1.61sp=1.000 n=6
Bind Time0.84s (± 0.61%)0.85s (± 0.61%)~0.84s0.85sp=0.311 n=6
Check Time10.31s (± 0.49%)10.32s (± 0.28%)~10.28s10.36sp=1.000 n=6
Emit Time3.14s (± 1.50%)3.12s (± 0.92%)~3.08s3.16sp=0.332 n=6
Total Time15.91s (± 0.49%)15.90s (± 0.30%)~15.82s15.96sp=0.470 n=6
Monaco - node (v14.21.3, x64)
Memory used341,056k (± 0.00%)341,043k (± 0.00%)~341,028k341,058kp=0.054 n=6
Parse Time2.80s (± 0.57%)2.79s (± 0.74%)~2.77s2.82sp=0.934 n=6
Bind Time1.11s (± 0.80%)1.11s (± 0.37%)~1.10s1.11sp=0.787 n=6
Check Time8.23s (± 0.56%)8.21s (± 0.69%)~8.18s8.32sp=0.292 n=6
Emit Time4.69s (± 0.55%)4.68s (± 0.81%)~4.64s4.73sp=0.871 n=6
Total Time16.82s (± 0.45%)16.80s (± 0.29%)~16.73s16.86sp=0.810 n=6
TFS - node (v14.21.3, x64)
Memory used295,151k (± 0.00%)295,154k (± 0.00%)~295,138k295,163kp=0.575 n=6
Parse Time2.39s (± 0.61%)2.40s (± 0.86%)~2.37s2.42sp=0.742 n=6
Bind Time1.07s (± 1.50%)1.07s (± 0.00%)~1.07s1.07sp=0.121 n=6
Check Time7.63s (± 0.36%)7.64s (± 0.30%)~7.61s7.67sp=0.807 n=6
Emit Time4.33s (± 0.60%)4.35s (± 0.95%)~4.29s4.39sp=0.467 n=6
Total Time15.43s (± 0.14%)15.45s (± 0.43%)~15.37s15.53sp=0.471 n=6
material-ui - node (v14.21.3, x64)
Memory used475,882k (± 0.01%)475,898k (± 0.00%)~475,874k475,911kp=0.575 n=6
Parse Time3.32s (± 0.80%)3.34s (± 0.41%)~3.32s3.35sp=0.371 n=6
Bind Time1.00s (± 0.75%)1.01s (± 0.54%)~1.00s1.01sp=0.476 n=6
Check Time18.85s (± 0.77%)18.80s (± 0.32%)~18.71s18.87sp=0.748 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time23.17s (± 0.69%)23.14s (± 0.26%)~23.07s23.21sp=0.936 n=6
xstate - node (v14.21.3, x64)
Memory used549,643k (± 0.00%)549,647k (± 0.00%)~549,630k549,672kp=0.687 n=6
Parse Time4.22s (± 0.30%)4.24s (± 0.55%)~4.21s4.27sp=0.183 n=6
Bind Time1.67s (± 0.31%)1.67s (± 0.31%)~1.66s1.67sp=1.000 n=6
Check Time3.16s (± 0.55%)3.15s (± 0.55%)~3.13s3.17sp=0.413 n=6
Emit Time0.09s (± 0.00%)0.09s (± 0.00%)~0.09s0.09sp=1.000 n=6
Total Time9.13s (± 0.27%)9.15s (± 0.30%)~9.11s9.19sp=0.466 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.21.3, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.21.3, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.21.3, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.21.3, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.21.3, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.21.3, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.21.3, x64)
BenchmarkNameIterations
Current544776
Baselinemain6

TSServer

Comparison Report - main..54477
Metricmain54477DeltaBestWorstp-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,543ms (± 0.70%)2,536ms (± 0.40%)~2,524ms2,554msp=0.575 n=6
Req 2 - geterr5,539ms (± 0.40%)5,596ms (± 0.60%)+58ms (+ 1.04%)5,546ms5,634msp=0.020 n=6
Req 3 - references338ms (± 1.17%)337ms (± 0.31%)~336ms338msp=1.000 n=6
Req 4 - navto287ms (± 0.48%)286ms (± 0.36%)~284ms287msp=0.391 n=6
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)~1,3561,356p=1.000 n=6
Req 5 - completionInfo85ms (± 0.96%)84ms (± 1.22%)~83ms86msp=0.546 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,639ms (± 0.92%)2,636ms (± 1.06%)~2,589ms2,668msp=0.810 n=6
Req 2 - geterr4,283ms (± 0.32%)4,302ms (± 0.39%)~4,282ms4,323msp=0.106 n=6
Req 3 - references349ms (± 0.49%)349ms (± 0.47%)~347ms351msp=0.507 n=6
Req 4 - navto286ms (± 1.05%)286ms (± 0.62%)~284ms289msp=0.935 n=6
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)~1,5181,518p=1.000 n=6
Req 5 - completionInfo64ms (± 4.17%)66ms (± 6.14%)~62ms70msp=0.800 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen3,086ms (± 0.33%)3,078ms (± 0.27%)~3,063ms3,087msp=0.199 n=6
Req 2 - geterr1,550ms (± 0.81%)1,562ms (± 1.19%)~1,541ms1,591msp=0.230 n=6
Req 3 - references112ms (± 1.87%)112ms (± 1.31%)~110ms114msp=0.625 n=6
Req 4 - navto358ms (± 0.41%)358ms (± 0.39%)~356ms360msp=0.870 n=6
Req 5 - completionInfo count2,864 (± 0.00%)2,864 (± 0.00%)~2,8642,864p=1.000 n=6
Req 5 - completionInfo369ms (± 2.18%)370ms (± 2.47%)~362ms385msp=0.747 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,647ms (± 0.33%)2,642ms (± 0.70%)~2,618ms2,661msp=0.810 n=6
Req 2 - geterr5,994ms (± 0.46%)6,054ms (± 0.52%)+60ms (+ 1.00%)6,020ms6,108msp=0.005 n=6
Req 3 - references353ms (± 0.64%)352ms (± 0.46%)~350ms354msp=0.683 n=6
Req 4 - navto288ms (± 2.06%)289ms (± 1.66%)~282ms296msp=0.625 n=6
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)~1,3561,356p=1.000 n=6
Req 5 - completionInfo91ms (± 2.13%)92ms (± 2.47%)~87ms93msp=0.197 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,827ms (± 0.63%)2,830ms (± 0.48%)~2,818ms2,856msp=0.936 n=6
Req 2 - geterr4,656ms (± 0.37%)4,655ms (± 0.31%)~4,644ms4,682msp=0.873 n=6
Req 3 - references363ms (± 0.53%)364ms (± 0.47%)~362ms367msp=0.368 n=6
Req 4 - navto283ms (± 0.70%)283ms (± 0.50%)~281ms285msp=0.803 n=6
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)~1,5181,518p=1.000 n=6
Req 5 - completionInfo67ms (± 0.94%)67ms (± 0.77%)~67ms68msp=0.386 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen3,220ms (± 0.56%)3,216ms (± 0.34%)~3,196ms3,228msp=1.000 n=6
Req 2 - geterr1,728ms (± 0.96%)1,724ms (± 0.68%)~1,712ms1,738msp=0.748 n=6
Req 3 - references126ms (± 7.00%)122ms (± 0.73%)~121ms123msp=0.157 n=6
Req 4 - navto343ms (± 1.26%)343ms (± 1.02%)~338ms348msp=1.000 n=6
Req 5 - completionInfo count2,864 (± 0.00%)2,864 (± 0.00%)~2,8642,864p=1.000 n=6
Req 5 - completionInfo409ms (± 1.40%)410ms (± 0.74%)~408ms416msp=0.808 n=6
Compiler-UnionsTSServer - node (v14.21.3, x64)
Req 1 - updateOpen2,776ms (± 0.25%)2,792ms (± 0.34%)+17ms (+ 0.59%)2,779ms2,803msp=0.016 n=6
Req 2 - geterr6,174ms (± 0.33%)6,197ms (± 0.66%)~6,155ms6,251msp=0.521 n=6
Req 3 - references364ms (± 0.38%)364ms (± 0.53%)~361ms366msp=0.737 n=6
Req 4 - navto288ms (± 0.36%)288ms (± 0.41%)~287ms290msp=0.801 n=6
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)~1,3561,356p=1.000 n=6
Req 5 - completionInfo102ms (± 2.77%)100ms (± 1.64%)~98ms102msp=0.253 n=6
CompilerTSServer - node (v14.21.3, x64)
Req 1 - updateOpen2,971ms (± 0.44%)2,976ms (± 0.29%)~2,964ms2,986msp=0.419 n=6
Req 2 - geterr4,542ms (± 0.65%)4,557ms (± 0.62%)~4,504ms4,586msp=0.378 n=6
Req 3 - references373ms (± 0.89%)371ms (± 0.49%)~369ms374msp=0.569 n=6
Req 4 - navto297ms (± 0.41%)298ms (± 0.61%)~296ms300msp=0.410 n=6
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)~1,5181,518p=1.000 n=6
Req 5 - completionInfo78ms (± 2.91%)76ms (± 0.99%)~75ms77msp=0.195 n=6
xstateTSServer - node (v14.21.3, x64)
Req 1 - updateOpen3,470ms (± 0.59%)3,453ms (± 1.35%)~3,386ms3,497msp=0.873 n=6
Req 2 - geterr1,839ms (± 0.51%)1,834ms (± 0.34%)~1,823ms1,841msp=0.575 n=6
Req 3 - references152ms (± 7.11%)140ms (± 4.05%)~133ms150msp=0.106 n=6
Req 4 - navto406ms (± 1.62%)404ms (± 1.16%)~400ms412msp=0.747 n=6
Req 5 - completionInfo count2,864 (± 0.00%)2,864 (± 0.00%)~2,8642,864p=1.000 n=6
Req 5 - completionInfo439ms (± 1.26%)434ms (± 3.84%)~404ms447msp=0.872 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.21.3, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.21.3, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.21.3, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.21.3, x64)
BenchmarkNameIterations
Current544776
Baselinemain6

Startup

Comparison Report - main..54477
Metricmain54477DeltaBestWorstp-value
tsc-startup - node (v16.17.1, x64)
Execution time141.34ms (± 0.18%)141.75ms (± 0.28%)+0.42ms (+ 0.30%)140.47ms145.79msp=0.000 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time220.31ms (± 0.19%)220.27ms (± 0.20%)-0.04ms (- 0.02%)219.13ms227.93msp=0.036 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time221.79ms (± 0.17%)221.56ms (± 0.17%)-0.23ms (- 0.10%)220.55ms226.80msp=0.000 n=600
typescript-startup - node (v16.17.1, x64)
Execution time203.61ms (± 0.17%)203.39ms (± 0.16%)-0.22ms (- 0.11%)202.65ms208.48msp=0.000 n=600
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • tsc-startup - node (v16.17.1, x64)
  • tsserver-startup - node (v16.17.1, x64)
  • tsserverlibrary-startup - node (v16.17.1, x64)
  • typescript-startup - node (v16.17.1, x64)
BenchmarkNameIterations
Current544776
Baselinemain6

Developer Information:

Download Benchmark

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Nathan Shively-Sanders (@sandersn), 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

Nathan Shively-Sanders (@sandersn) Here are the results of running the top-repos suite comparing main and refs/pull/54477/merge:

Everything looks good!

1 similar comment
@typescript-bot

Copy link
Copy Markdown
Contributor

Nathan Shively-Sanders (@sandersn) Here are the results of running the top-repos suite comparing main and refs/pull/54477/merge:

Everything looks good!

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.

Since this isn't a bug fix, let's hold this till right at the beginning of 5.3 to give us plenty of time to watch for problems.

@sandersn
Nathan Shively-Sanders (sandersn) merged commit afffad4 into microsoft:mainNov 29, 2023
Nathan Shively-Sanders (sandersn) added a commit to sandersn/TypeScript that referenced this pull request Jan 24, 2024
Discovered in microsoft#57117
The implementation should not `couldContainTypeVariables`--it's not
intended a fast path, and should not be used in places where its
unreliability can be observed.
The tests stay, but with a note added that they should pass but do not.
@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

For Uncommitted BugPR for untriaged, rejected, closed or missing bug

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants

@Andarist@typescript-bot@sandersn@rbuckton