Skip to content

Do not infer yield* type from contextual TReturn - #58621

Merged
Ron Buckton (rbuckton) merged 2 commits into
mainfrom
fix57903
May 29, 2024
Merged

Do not infer yield* type from contextual TReturn#58621
Ron Buckton (rbuckton) merged 2 commits into
mainfrom
fix57903

Conversation

@rbuckton

@rbucktonRon Buckton (rbuckton) commented May 22, 2024

Copy link
Copy Markdown
Contributor

This changes the contextual type we produce for the operand to yield* so that we do not consider the TReturn type of the containing generator's return type as a source of inference since the TReturn of a generator has no bearing on the result of yield*. Instead, we substitute the contextual type for the entire yield* expression, e.g.:

interfacePoint{x: number;y: number;}declarefunction*g<U,UReturn>(getYield: ()=>U|undefined,getResult: ()=>UReturn,): Generator<U,UReturn,unknown>;asyncfunction*f(): AsyncGenerator</*T*/number,/*TReturn*/string,unknown>{constv1=yield*g(()=>/* a */,()=>/* b */);constv2: Point=yield*g(()=>/* c */,()=>/* d */);return"done";}

At (a), U should be inferred from T (i.e., number) since f will delegate yield from g.

At (b), UReturn should not be inferred from TReturn (i.e., string) since f does not delegate the return value of g. Since v1 is untyped, UReturn is inferred as unknown.

At (c), U should be inferred from T (i.e., number) since f will delegate yield from g.

At (d), UReturn should not be inferred from TReturn (i.e., string) since f does not delegate the return value of g. Since v2 has the type Point, UReturn is inferred as Point.

Fixes#57903

@rbuckton

Copy link
Copy Markdown
ContributorAuthor

TypeScript Bot (@typescript-bot) perf test
TypeScript Bot (@typescript-bot) run dt
TypeScript Bot (@typescript-bot) test top400
TypeScript Bot (@typescript-bot) test tsserver top100
TypeScript Bot (@typescript-bot) user test this
TypeScript Bot (@typescript-bot) user test tsserver

@typescript-bot

TypeScript Bot (typescript-bot) commented May 22, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
perf test✅ Started👀 Results
run dt✅ Started✅ Results
test top400✅ Started✅ Results
test tsserver top100✅ Started👀 Results
user test this✅ Started✅ Results
user test tsserver✅ Started✅ Results

@typescript-bot

Copy link
Copy Markdown
Contributor

Ron Buckton (@rbuckton) Here are the results of running the user tests comparing main and refs/pull/58621/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Unknown failure"

Otherwise...

Everything looks good!

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Ron Buckton (@rbuckton), 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

Ron Buckton (@rbuckton) Here are the results of running the user tests comparing main and refs/pull/58621/merge:

Everything looks good!

@typescript-bot

Copy link
Copy Markdown
Contributor

Ron Buckton (@rbuckton)
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)
Errors3030~~~p=1.000 n=6
Symbols62,15462,154~~~p=1.000 n=6
Types50,24850,248~~~p=1.000 n=6
Memory used192,336k (± 0.09%)194,170k (± 1.04%)~192,170k196,113kp=0.378 n=6
Parse Time1.55s (± 1.85%)1.55s (± 1.45%)~1.52s1.57sp=0.513 n=6
Bind Time0.86s (± 0.60%)0.87s (± 1.13%)~0.86s0.88sp=0.140 n=6
Check Time11.34s (± 0.66%)11.30s (± 0.54%)~11.21s11.38sp=0.295 n=6
Emit Time3.16s (± 0.88%)3.15s (± 0.79%)~3.11s3.18sp=0.806 n=6
Total Time16.92s (± 0.35%)16.88s (± 0.34%)~16.80s16.95sp=0.173 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,110944,110~~~p=1.000 n=6
Types407,140407,140~~~p=1.000 n=6
Memory used1,222,004k (± 0.01%)1,222,037k (± 0.00%)~1,221,963k1,222,099kp=0.689 n=6
Parse Time8.08s (± 0.28%)8.10s (± 0.58%)~8.04s8.17sp=0.517 n=6
Bind Time2.24s (± 0.40%)2.24s (± 0.67%)~2.22s2.26sp=0.557 n=6
Check Time36.48s (± 0.41%)36.55s (± 0.61%)~36.19s36.82sp=0.574 n=6
Emit Time17.51s (± 0.86%)17.48s (± 0.46%)~17.38s17.60sp=0.689 n=6
Total Time64.30s (± 0.34%)64.37s (± 0.36%)~63.96s64.67sp=0.873 n=6
mui-docs - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols1,978,4041,978,404~~~p=1.000 n=6
Types882,046882,046~~~p=1.000 n=6
Memory used1,884,888k (± 0.00%)1,884,847k (± 0.00%)~1,884,783k1,884,925kp=0.471 n=6
Parse Time8.04s (± 0.36%)8.05s (± 0.38%)~8.00s8.09sp=0.373 n=6
Bind Time2.74s (± 0.86%)2.74s (± 0.67%)~2.71s2.75sp=0.666 n=6
Check Time71.34s (± 0.36%)71.24s (± 0.29%)~70.90s71.49sp=0.689 n=6
Emit Time0.17s (± 2.38%)0.17s~~~p=0.405 n=6
Total Time82.30s (± 0.32%)82.20s (± 0.23%)~81.90s82.38sp=1.000 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,223,2131,223,253+40 (+ 0.00%)~~p=0.001 n=6
Types260,184260,185+1 (+ 0.00%)~~p=0.001 n=6
Memory used2,338,927k (± 0.02%)2,339,364k (± 0.04%)~2,337,958k2,340,908kp=0.471 n=6
Parse Time6.00s (± 0.96%)6.03s (± 0.99%)~5.95s6.12sp=0.422 n=6
Bind Time2.26s (± 0.82%)2.27s (± 1.14%)~2.24s2.31sp=0.573 n=6
Check Time39.84s (± 0.59%)39.74s (± 0.33%)~39.54s39.90sp=0.471 n=6
Emit Time3.24s (± 0.63%)3.22s (± 3.22%)~3.06s3.33sp=1.000 n=6
Total Time51.37s (± 0.43%)51.26s (± 0.45%)~50.91s51.53sp=0.575 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,223,2131,223,253+40 (+ 0.00%)~~p=0.001 n=6
Types260,184260,185+1 (+ 0.00%)~~p=0.001 n=6
Memory used2,415,198k (± 0.02%)2,440,259k (± 2.55%)~2,414,160k2,567,345kp=0.575 n=6
Parse Time6.27s (± 1.15%)6.25s (± 1.04%)~6.13s6.30sp=0.810 n=6
Bind Time2.03s (± 1.19%)2.04s (± 0.67%)~2.02s2.05sp=1.000 n=6
Check Time40.27s (± 0.30%)40.30s (± 0.32%)~40.09s40.48sp=0.748 n=6
Emit Time3.21s (± 2.37%)3.15s (± 2.12%)~3.07s3.26sp=0.092 n=6
Total Time51.79s (± 0.29%)51.76s (± 0.19%)~51.63s51.90sp=1.000 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols257,698257,738+40 (+ 0.02%)~~p=0.001 n=6
Types104,910104,911+1 (+ 0.00%)~~p=0.001 n=6
Memory used426,633k (± 0.01%)426,421k (± 0.02%)-212k (- 0.05%)426,351k426,523kp=0.005 n=6
Parse Time3.36s (± 0.64%)3.36s (± 0.51%)~3.33s3.38sp=0.935 n=6
Bind Time1.32s (± 0.57%)1.33s (± 0.31%)+0.01s (+ 0.76%)1.32s1.33sp=0.029 n=6
Check Time17.86s (± 0.35%)17.95s (± 0.34%)~17.88s18.06sp=0.052 n=6
Emit Time1.36s (± 1.20%)1.35s (± 1.43%)~1.32s1.37sp=0.807 n=6
Total Time23.90s (± 0.31%)23.99s (± 0.30%)~23.91s24.11sp=0.078 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,575224,575~~~p=1.000 n=6
Types93,78593,785~~~p=1.000 n=6
Memory used369,980k (± 0.03%)369,883k (± 0.03%)~369,770k370,012kp=0.173 n=6
Parse Time2.34s (± 1.05%)2.34s (± 0.87%)~2.32s2.37sp=0.870 n=6
Bind Time1.32s (± 1.03%)1.34s (± 1.39%)~1.32s1.37sp=0.212 n=6
Check Time13.30s (± 0.25%)13.31s (± 0.28%)~13.28s13.38sp=0.809 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time16.97s (± 0.21%)17.00s (± 0.18%)~16.95s17.03sp=0.198 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,834,8182,834,818~~~p=1.000 n=6
Types960,647960,647~~~p=1.000 n=6
Memory used3,006,743k (± 0.00%)3,006,727k (± 0.00%)~3,006,693k3,006,793kp=0.689 n=6
Parse Time11.55s (± 0.29%)11.54s (± 0.32%)~11.51s11.59sp=0.742 n=6
Bind Time3.47s (± 0.28%)3.48s (± 0.31%)~3.47s3.49sp=0.246 n=6
Check Time66.20s (± 2.34%)66.34s (± 1.52%)~64.30s66.95sp=0.936 n=6
Emit Time17.20s (± 7.96%)17.08s (± 5.18%)~16.57s18.87sp=0.471 n=6
Total Time98.43s (± 0.25%)98.45s (± 0.22%)~98.21s98.71sp=0.810 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols266,087266,087~~~p=1.000 n=6
Types108,518108,518~~~p=1.000 n=6
Memory used410,928k (± 0.02%)410,879k (± 0.02%)~410,787k411,062kp=0.378 n=6
Parse Time4.75s (± 0.46%)4.75s (± 0.63%)~4.73s4.81sp=0.935 n=6
Bind Time2.07s (± 0.73%)2.08s (± 0.68%)~2.06s2.10sp=0.564 n=6
Check Time21.00s (± 0.44%)20.94s (± 0.51%)~20.80s21.10sp=0.378 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time27.82s (± 0.28%)27.78s (± 0.40%)~27.64s27.91sp=0.470 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols524,654524,654~~~p=1.000 n=6
Types178,920178,920~~~p=1.000 n=6
Memory used462,737k (± 0.03%)462,760k (± 0.02%)~462,603k462,873kp=0.936 n=6
Parse Time3.89s (± 0.14%)3.88s (± 0.42%)~3.86s3.90sp=0.360 n=6
Bind Time1.45s (± 1.55%)1.45s (± 1.19%)~1.42s1.47sp=1.000 n=6
Check Time22.40s (± 0.57%)22.58s (± 0.83%)+0.19s (+ 0.84%)22.24s22.81sp=0.045 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time27.73s (± 0.41%)27.91s (± 0.66%)+0.18s (+ 0.67%)27.59s28.16sp=0.045 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

tsserver

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen2,292ms (± 0.51%)2,300ms (± 0.55%)~2,278ms2,311msp=0.172 n=6
Req 2 - geterr5,168ms (± 0.33%)5,161ms (± 0.38%)~5,141ms5,183msp=0.748 n=6
Req 3 - references285ms (± 0.48%)284ms (± 0.35%)~282ms285msp=0.343 n=6
Req 4 - navto229ms (± 0.86%)229ms (± 1.18%)~225ms232msp=1.000 n=6
Req 5 - completionInfo count1,3571,357~~~p=1.000 n=6
Req 5 - completionInfo82ms (±10.11%)83ms (± 9.87%)~76ms93msp=0.804 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen3,576ms (± 0.44%)3,597ms (± 0.74%)~3,563ms3,631msp=0.128 n=6
Req 2 - geterr5,671ms (± 0.42%)5,697ms (± 0.30%)~5,677ms5,725msp=0.066 n=6
Req 3 - references446ms (± 0.45%)447ms (± 0.12%)~446ms447msp=0.802 n=6
Req 4 - navto341ms (± 1.48%)340ms (± 1.35%)~332ms345msp=1.000 n=6
Req 5 - completionInfo count1,5191,519~~~p=1.000 n=6
Req 5 - completionInfo110ms (± 7.44%)114ms (± 9.69%)~100ms124msp=1.000 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen5,130ms (± 0.45%)5,153ms (± 0.50%)~5,115ms5,176msp=0.128 n=6
Req 2 - geterr1,128ms (± 0.98%)1,128ms (± 1.28%)~1,113ms1,150msp=0.873 n=6
Req 3 - references94ms (± 2.51%)91ms (± 4.52%)~87ms96msp=0.559 n=6
Req 4 - navto455ms (± 0.40%)458ms (± 0.70%)~454ms462msp=0.064 n=6
Req 5 - completionInfo count3,4133,413~~~p=1.000 n=6
Req 5 - completionInfo868ms (± 0.85%)857ms (± 1.86%)~836ms873msp=0.198 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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

startup

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
tsc-startup - node (v18.15.0, x64)
Execution time188.19ms (± 0.22%)187.89ms (± 0.19%)-0.30ms (- 0.16%)186.18ms192.63msp=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time294.02ms (± 0.26%)294.10ms (± 0.28%)~287.03ms303.88msp=0.127 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time350.12ms (± 0.30%)350.23ms (± 0.30%)~342.31ms355.23msp=0.197 n=600
typescript-startup - node (v18.15.0, x64)
Execution time351.91ms (± 0.28%)352.22ms (± 0.30%)+0.31ms (+ 0.09%)343.88ms366.05msp=0.000 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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@rbucktonRon Buckton (rbuckton) changed the title Do not infer yield* type from contextual TReturnDo not infer yield* type from contextual TReturnMay 22, 2024
@typescript-bot

Copy link
Copy Markdown
Contributor

Ron Buckton (@rbuckton) Here are the results of running the top 200 repos comparing main and refs/pull/58621/merge:

Something interesting changed - please have a look.

Details

Server exited prematurely with code unknown and signal SIGABRT

Server exited prematurely with code unknown and signal SIGABRT

Affected repos

calcom/cal.com Raw error text: RepoResults7/calcom.cal.com.rawError.txt in the artifact folder
Replay commands: RepoResults7/calcom.cal.com.replay.txt in the artifact folder

Last few requests

{"seq":89,"type":"request","command":"navto","arguments":{"searchValue":"a1R","maxResultCount":256}}
{"seq":90,"type":"request","command":"updateOpen","arguments":{"changedFiles":[{"fileName":"@PROJECT_ROOT@/packages/trpc/index.ts","textChanges":[{"newText":" //comment","start":{"line":1,"offset":26},"end":{"line":1,"offset":26}}]}],"closedFiles":[],"openFiles":[]}}
{"seq":91,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":["@PROJECT_ROOT@/packages/types/Credential.d.ts"],"openFiles":[]}}
{"seq":92,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"@PROJECT_ROOT@/packages/prisma/seed-utils.ts","projectRootPath":"@PROJECT_ROOT@"}]}}

Repro steps

#!/bin/bash
git clone https://github.com/calcom/cal.com --recurse-submodules
git -C "./cal.com" reset --hard 26bd02bd9409123f50f3501471738da66554f558
yarn --cwd "/mnt/ts_downloads/base/cal.com" install --no-immutable --mode=skip-build
downloadUrl=$(curl -s "https://typescript.visualstudio.com/TypeScript/_apis/build/builds/161860/artifacts?artifactName=RepoResults7&api-version=7.0"| jq -r ".resource.downloadUrl")
wget -O RepoResults7.zip "$downloadUrl"
unzip -p RepoResults7.zip RepoResults7/calcom.cal.com.replay.txt > calcom.cal.com.replay.txt
npm install --no-save @typescript/server-replay

To run the repro:

# `npx tsreplay --help` to learn about helpful switches for debugging, logging, etc.
npx tsreplay ./cal.com ./calcom.cal.com.replay.txt <PATH_TO_tsserver.js>

Server exited prematurely with code unknown and signal SIGABRT

Server exited prematurely with code unknown and signal SIGABRT

Affected repos

elastic/kibana Raw error text: RepoResults14/elastic.kibana.rawError.txt in the artifact folder
Replay commands: RepoResults14/elastic.kibana.replay.txt in the artifact folder

Last few requests

{"seq":712,"type":"request","command":"completionInfo","arguments":{"file":"@PROJECT_ROOT@/x-pack/plugins/security_solution_serverless/public/types.ts","line":19,"offset":29,"includeExternalModuleExports":false,"triggerKind":1}}
{"seq":713,"type":"request","command":"references","arguments":{"file":"@PROJECT_ROOT@/x-pack/plugins/security_solution_serverless/public/types.ts","line":22,"offset":29}}
{"seq":714,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":["@PROJECT_ROOT@/x-pack/test/api_integration/services/slo.ts"],"openFiles":[]}}
{"seq":715,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"@PROJECT_ROOT@/x-pack/plugins/security/server/plugin.test.ts","projectRootPath":"@PROJECT_ROOT@"}]}}

Repro steps

#!/bin/bash
git clone https://github.com/elastic/kibana --recurse-submodules
git -C "./kibana" reset --hard 42afaa38a2bcd0fbbc331f3d391be81bbc1578e0
downloadUrl=$(curl -s "https://typescript.visualstudio.com/TypeScript/_apis/build/builds/161860/artifacts?artifactName=RepoResults14&api-version=7.0"| jq -r ".resource.downloadUrl")
wget -O RepoResults14.zip "$downloadUrl"
unzip -p RepoResults14.zip RepoResults14/elastic.kibana.replay.txt > elastic.kibana.replay.txt
npm install --no-save @typescript/server-replay

To run the repro:

# `npx tsreplay --help` to learn about helpful switches for debugging, logging, etc.
npx tsreplay ./kibana ./elastic.kibana.replay.txt <PATH_TO_tsserver.js>

@typescript-bot

Copy link
Copy Markdown
Contributor

Ron Buckton (@rbuckton) Here are the results of running the top 400 repos comparing main and refs/pull/58621/merge:

Everything looks good!

@rbuckton

Copy link
Copy Markdown
ContributorAuthor

Ron Buckton (@rbuckton) Here are the results of running the top 200 repos comparing main and refs/pull/58621/merge:

Something interesting changed - please have a look.

It doesn't seem like the crash is related? If I run the repro locally I have the same result with or without this change. I'll try running it again in case it was a quirk.

TypeScript Bot (@typescript-bot) test tsserver top100

@typescript-bot

TypeScript Bot (typescript-bot) commented May 23, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
test tsserver top100✅ Started👀 Results

@rbuckton

Copy link
Copy Markdown
ContributorAuthor

Temporarily reverting change to validate crash.

TypeScript Bot (@typescript-bot) test tsserver top100
TypeScript Bot (@typescript-bot) user test tsserver

@typescript-bot

TypeScript Bot (typescript-bot) commented May 23, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
test tsserver top100✅ Started👀 Results
user test tsserver✅ Started✅ Results

@jakebailey

Copy link
Copy Markdown
Member

The server tests have issues; I don't think they properly detect old/new crashes like the tsc tests yet.

@typescript-bot

Copy link
Copy Markdown
Contributor

Ron Buckton (@rbuckton) Here are the results of running the user tests comparing main and refs/pull/58621/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Unknown failure"

Otherwise...

Everything looks good!

@typescript-bot

Copy link
Copy Markdown
Contributor

Ron Buckton (@rbuckton) Here are the results of running the top 200 repos comparing main and refs/pull/58621/merge:

Something interesting changed - please have a look.

Details

⚠️ Old server errors ⚠️

Timed out after 600000 ms
Timed out after 600000 ms

Repos no longer reporting the error

Server exited prematurely with code unknown and signal SIGABRT

Server exited prematurely with code unknown and signal SIGABRT

Affected repos

backstage/backstage Raw error text: RepoResults8/backstage.backstage.rawError.txt in the artifact folder
Replay commands: RepoResults8/backstage.backstage.replay.txt in the artifact folder

Last few requests

{"seq":109,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/scripts/assemble-manifest.js","line":62,"offset":51}}
{"seq":110,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/scripts/assemble-manifest.js","line":76,"offset":1}}
{"seq":111,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":["@PROJECT_ROOT@/scripts/prepare-release.js"],"openFiles":[]}}
{"seq":112,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"@PROJECT_ROOT@/plugins/search-backend-module-catalog/config.d.ts","projectRootPath":"@PROJECT_ROOT@"}]}}

Repro steps

#!/bin/bash
git clone https://github.com/backstage/backstage --recurse-submodules
git -C "./backstage" reset --hard 024b530575d5d9d4d28d53db56d245d81a8c413c
# Install packages (exact steps are below, but it might be easier to follow the repo readme)
yarn --cwd "/mnt/ts_downloads/base/backstage" install --no-immutable --mode=skip-build
yarn --cwd "/mnt/ts_downloads/base/backstage/storybook" install --no-immutable --mode=skip-build
yarn --cwd "/mnt/ts_downloads/base/backstage/microsite" install --no-immutable --mode=skip-build
downloadUrl=$(curl -s "https://typescript.visualstudio.com/TypeScript/_apis/build/builds/161880/artifacts?artifactName=RepoResults8&api-version=7.0"| jq -r ".resource.downloadUrl")
wget -O RepoResults8.zip "$downloadUrl"
unzip -p RepoResults8.zip RepoResults8/backstage.backstage.replay.txt > backstage.backstage.replay.txt
npm install --no-save @typescript/server-replay

To run the repro:

# `npx tsreplay --help` to learn about helpful switches for debugging, logging, etc.
npx tsreplay ./backstage ./backstage.backstage.replay.txt <PATH_TO_tsserver.js>

Server exited prematurely with code unknown and signal SIGABRT

Server exited prematurely with code unknown and signal SIGABRT

Affected repos

calcom/cal.com Raw error text: RepoResults7/calcom.cal.com.rawError.txt in the artifact folder
Replay commands: RepoResults7/calcom.cal.com.replay.txt in the artifact folder

Last few requests

{"seq":89,"type":"request","command":"navto","arguments":{"searchValue":"a1R","maxResultCount":256}}
{"seq":90,"type":"request","command":"updateOpen","arguments":{"changedFiles":[{"fileName":"@PROJECT_ROOT@/packages/trpc/index.ts","textChanges":[{"newText":" //comment","start":{"line":1,"offset":26},"end":{"line":1,"offset":26}}]}],"closedFiles":[],"openFiles":[]}}
{"seq":91,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":["@PROJECT_ROOT@/packages/types/Credential.d.ts"],"openFiles":[]}}
{"seq":92,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"@PROJECT_ROOT@/packages/prisma/seed-utils.ts","projectRootPath":"@PROJECT_ROOT@"}]}}

Repro steps

#!/bin/bash
git clone https://github.com/calcom/cal.com --recurse-submodules
git -C "./cal.com" reset --hard 01933e5c15ec62949a6d74942a7b75a73e3da76b
yarn --cwd "/mnt/ts_downloads/base/cal.com" install --no-immutable --mode=skip-build
downloadUrl=$(curl -s "https://typescript.visualstudio.com/TypeScript/_apis/build/builds/161880/artifacts?artifactName=RepoResults7&api-version=7.0"| jq -r ".resource.downloadUrl")
wget -O RepoResults7.zip "$downloadUrl"
unzip -p RepoResults7.zip RepoResults7/calcom.cal.com.replay.txt > calcom.cal.com.replay.txt
npm install --no-save @typescript/server-replay

To run the repro:

# `npx tsreplay --help` to learn about helpful switches for debugging, logging, etc.
npx tsreplay ./cal.com ./calcom.cal.com.replay.txt <PATH_TO_tsserver.js>

@typescript-bot

Copy link
Copy Markdown
Contributor

Ron Buckton (@rbuckton) Here are the results of running the top 200 repos comparing main and refs/pull/58621/merge:

Something interesting changed - please have a look.

Details

Server exited prematurely with code unknown and signal SIGABRT

Server exited prematurely with code unknown and signal SIGABRT

Affected repos

backstage/backstage Raw error text: RepoResults8/backstage.backstage.rawError.txt in the artifact folder
Replay commands: RepoResults8/backstage.backstage.replay.txt in the artifact folder

Last few requests

{"seq":109,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/scripts/assemble-manifest.js","line":62,"offset":51}}
{"seq":110,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/scripts/assemble-manifest.js","line":76,"offset":1}}
{"seq":111,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":["@PROJECT_ROOT@/scripts/prepare-release.js"],"openFiles":[]}}
{"seq":112,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"@PROJECT_ROOT@/plugins/search-backend-module-catalog/config.d.ts","projectRootPath":"@PROJECT_ROOT@"}]}}

Repro steps

#!/bin/bash
git clone https://github.com/backstage/backstage --recurse-submodules
git -C "./backstage" reset --hard 024b530575d5d9d4d28d53db56d245d81a8c413c
# Install packages (exact steps are below, but it might be easier to follow the repo readme)
yarn --cwd "/mnt/ts_downloads/base/backstage" install --no-immutable --mode=skip-build
yarn --cwd "/mnt/ts_downloads/base/backstage/storybook" install --no-immutable --mode=skip-build
yarn --cwd "/mnt/ts_downloads/base/backstage/microsite" install --no-immutable --mode=skip-build
downloadUrl=$(curl -s "https://typescript.visualstudio.com/TypeScript/_apis/build/builds/161881/artifacts?artifactName=RepoResults8&api-version=7.0"| jq -r ".resource.downloadUrl")
wget -O RepoResults8.zip "$downloadUrl"
unzip -p RepoResults8.zip RepoResults8/backstage.backstage.replay.txt > backstage.backstage.replay.txt
npm install --no-save @typescript/server-replay

To run the repro:

# `npx tsreplay --help` to learn about helpful switches for debugging, logging, etc.
npx tsreplay ./backstage ./backstage.backstage.replay.txt <PATH_TO_tsserver.js>

Server exited prematurely with code unknown and signal SIGABRT

Server exited prematurely with code unknown and signal SIGABRT

Affected repos

calcom/cal.com Raw error text: RepoResults7/calcom.cal.com.rawError.txt in the artifact folder
Replay commands: RepoResults7/calcom.cal.com.replay.txt in the artifact folder

Last few requests

{"seq":89,"type":"request","command":"navto","arguments":{"searchValue":"a1R","maxResultCount":256}}
{"seq":90,"type":"request","command":"updateOpen","arguments":{"changedFiles":[{"fileName":"@PROJECT_ROOT@/packages/trpc/index.ts","textChanges":[{"newText":" //comment","start":{"line":1,"offset":26},"end":{"line":1,"offset":26}}]}],"closedFiles":[],"openFiles":[]}}
{"seq":91,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":["@PROJECT_ROOT@/packages/types/Credential.d.ts"],"openFiles":[]}}
{"seq":92,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"@PROJECT_ROOT@/packages/prisma/seed-utils.ts","projectRootPath":"@PROJECT_ROOT@"}]}}

Repro steps

#!/bin/bash
git clone https://github.com/calcom/cal.com --recurse-submodules
git -C "./cal.com" reset --hard 01933e5c15ec62949a6d74942a7b75a73e3da76b
yarn --cwd "/mnt/ts_downloads/base/cal.com" install --no-immutable --mode=skip-build
downloadUrl=$(curl -s "https://typescript.visualstudio.com/TypeScript/_apis/build/builds/161881/artifacts?artifactName=RepoResults7&api-version=7.0"| jq -r ".resource.downloadUrl")
wget -O RepoResults7.zip "$downloadUrl"
unzip -p RepoResults7.zip RepoResults7/calcom.cal.com.replay.txt > calcom.cal.com.replay.txt
npm install --no-save @typescript/server-replay

To run the repro:

# `npx tsreplay --help` to learn about helpful switches for debugging, logging, etc.
npx tsreplay ./cal.com ./calcom.cal.com.replay.txt <PATH_TO_tsserver.js>

Server exited prematurely with code unknown and signal SIGABRT

Server exited prematurely with code unknown and signal SIGABRT

Affected repos

elastic/kibana Raw error text: RepoResults14/elastic.kibana.rawError.txt in the artifact folder
Replay commands: RepoResults14/elastic.kibana.replay.txt in the artifact folder

Last few requests

{"seq":2070,"type":"request","command":"completionInfo","arguments":{"file":"@PROJECT_ROOT@/x-pack/plugins/serverless_search/public/application/elasticsearch.tsx","line":15,"offset":40,"includeExternalModuleExports":false,"triggerKind":1}}
{"seq":2071,"type":"request","command":"completionEntryDetails","arguments":{"file":"@PROJECT_ROOT@/x-pack/plugins/serverless_search/public/application/elasticsearch.tsx","line":15,"offset":40,"entryNames":["@kbn/shared-ux-router"]}}
{"seq":2072,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":["@PROJECT_ROOT@/x-pack/test/alerting_api_integration/common/lib/task_manager_utils.ts"],"openFiles":[]}}
{"seq":2073,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"@PROJECT_ROOT@/x-pack/plugins/security_solution_serverless/public/navigation/management_cards.ts","projectRootPath":"@PROJECT_ROOT@"}]}}

Repro steps

#!/bin/bash
git clone https://github.com/elastic/kibana --recurse-submodules
git -C "./kibana" reset --hard 2ec4ec362d21fe03d04d53181fa0a8f7da888eb5
downloadUrl=$(curl -s "https://typescript.visualstudio.com/TypeScript/_apis/build/builds/161881/artifacts?artifactName=RepoResults14&api-version=7.0"| jq -r ".resource.downloadUrl")
wget -O RepoResults14.zip "$downloadUrl"
unzip -p RepoResults14.zip RepoResults14/elastic.kibana.replay.txt > elastic.kibana.replay.txt
npm install --no-save @typescript/server-replay

To run the repro:

# `npx tsreplay --help` to learn about helpful switches for debugging, logging, etc.
npx tsreplay ./kibana ./elastic.kibana.replay.txt <PATH_TO_tsserver.js>

@rbuckton

Copy link
Copy Markdown
ContributorAuthor

The crashes seem to be unrelated as they're still happening even after reverting the change.

@rbuckton

Copy link
Copy Markdown
ContributorAuthor

TypeScript Bot (@typescript-bot) test tsserver top100

@typescript-bot

TypeScript Bot (typescript-bot) commented May 29, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
test tsserver top100✅ Started👀 Results

: getIterationTypeOfGeneratorFunctionReturnType(IterationTypeKind.Yield, contextualReturnType, isAsyncGenerator);
if (node.asteriskToken) {
const iterationTypes = getIterationTypesOfGeneratorFunctionReturnType(contextualReturnType, isAsyncGenerator);
const yieldType = iterationTypes?.yieldType ?? silentNeverType;

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.

Why do we fall back to silentNeverType?

@rbucktonRon Buckton (rbuckton)May 29, 2024

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.

We need to fall back to something we do not infer from, and a generator that doesn't yield otherwise infers a T of never. silentNeverType is non-inferable, so it seemed like the correct choice.

@typescript-bot

Copy link
Copy Markdown
Contributor

Ron Buckton (@rbuckton) Here are the results of running the top 200 repos comparing main and refs/pull/58621/merge:

Something interesting changed - please have a look.

Details

Server exited prematurely with code unknown and signal SIGABRT

Server exited prematurely with code unknown and signal SIGABRT

Affected repos

calcom/cal.com Raw error text: RepoResults7/calcom.cal.com.rawError.txt in the artifact folder
Replay commands: RepoResults7/calcom.cal.com.replay.txt in the artifact folder

Last few requests

{"seq":656,"type":"request","command":"navtree","arguments":{"file":"@PROJECT_ROOT@/packages/features/get-cal-video-reference.test.ts"}}
{"seq":657,"type":"request","command":"navbar","arguments":{"file":"@PROJECT_ROOT@/packages/features/get-cal-video-reference.test.ts"}}
{"seq":658,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":["@PROJECT_ROOT@/packages/lib/CloseCom.ts"],"openFiles":[]}}
{"seq":659,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"@PROJECT_ROOT@/packages/debugging/index.tsx","projectRootPath":"@PROJECT_ROOT@"}]}}

Repro steps

#!/bin/bash
git clone https://github.com/calcom/cal.com --recurse-submodules
git -C "./cal.com" reset --hard 5f082e11f8c82478d3e0ffbb23c65e28bc1f08d4
yarn --cwd "/mnt/ts_downloads/base/cal.com" install --no-immutable --mode=skip-build
downloadUrl=$(curl -s "https://typescript.visualstudio.com/TypeScript/_apis/build/builds/161974/artifacts?artifactName=RepoResults7&api-version=7.0"| jq -r ".resource.downloadUrl")
wget -O RepoResults7.zip "$downloadUrl"
unzip -p RepoResults7.zip RepoResults7/calcom.cal.com.replay.txt > calcom.cal.com.replay.txt
npm install --no-save @typescript/server-replay

To run the repro:

# `npx tsreplay --help` to learn about helpful switches for debugging, logging, etc.
npx tsreplay ./cal.com ./calcom.cal.com.replay.txt <PATH_TO_tsserver.js>

@rbuckton
Ron Buckton (rbuckton) deleted the fix57903 branch May 29, 2024 22:05
Jonathan Skeate (skeate) added a commit to skeate/TypeScript that referenced this pull request Jun 1, 2024
* upstream/main: (37 commits)
Added NoTruncation flag to completions (microsoft#58719)
Clone node to remove location even when it has been modified if needed (microsoft#58706)
Properly account for `this` argument in intersection apparent type caching (microsoft#58677)
Fix: Include Values of Script Extensions for Unicode Property Value Expressions in Regular Expressions (microsoft#58615)
In `reScanSlashToken` use `charCodeChecked` not `codePointChecked` (microsoft#58727)
Shorten error spans for errors reported on constructor declarations (microsoft#58061)
Mark file as skips typechecking if it contains ts-nocheck (microsoft#58593)
Fixed an issue with broken `await using` declarations in `for of` loops (microsoft#56466)
Do not expand type references in keyof and index access (microsoft#58715)
Improve the performance of isolatedDeclarations quickfix (microsoft#58722)
Unwrap `NoInfer` types when narrowing (microsoft#58292)
Recover from type reuse errors by falling back to inferred type printing (microsoft#58720)
Fixing self import (microsoft#58718)
Enable JS emit for noCheck and noCheck for transpileModule (microsoft#58364)
Revert PR 55371 (microsoft#58702)
Update dependencies (microsoft#58639)
Fix baselines after PR 58621 (microsoft#58705)
Do not infer `yield*` type from contextual `TReturn` (microsoft#58621)
`await using` normative changes (microsoft#58624)
Handling statements from a known source file (microsoft#58679)
...
@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

Author: TeamFor Milestone BugPRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improper Type Inference in Async Generator Callback

4 participants

@rbuckton@typescript-bot@jakebailey@gabritto