Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not infer yield* type from contextual TReturn #58621

Merged
merged 2 commits into from
May 29, 2024
Merged

Do not infer yield* type from contextual TReturn #58621

merged 2 commits into from
May 29, 2024

Conversation

rbuckton
Copy link
Member

@rbuckton rbuckton commented May 22, 2024

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.:

interface Point {
  x: number;
  y: number;
}

declare function* g<U, UReturn>(
  getYield: () => U | undefined,
  getResult: () => UReturn,
): Generator<U, UReturn, unknown>;

async function* f(): AsyncGenerator</*T*/ number, /*TReturn*/ string, unknown> {

  const v1 = yield* g(
    () => /* a */,
    () => /* b */
  );
  
  const v2: 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

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels May 22, 2024
@rbuckton
Copy link
Member Author

@typescript-bot perf test
@typescript-bot run dt
@typescript-bot test top400
@typescript-bot test tsserver top100
@typescript-bot user test this
@typescript-bot user test tsserver

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 22, 2024

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

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

@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
Collaborator

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

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@typescript-bot
Copy link
Collaborator

@rbuckton
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 30 30 ~ ~ ~ p=1.000 n=6
Symbols 62,154 62,154 ~ ~ ~ p=1.000 n=6
Types 50,248 50,248 ~ ~ ~ p=1.000 n=6
Memory used 192,336k (± 0.09%) 194,170k (± 1.04%) ~ 192,170k 196,113k p=0.378 n=6
Parse Time 1.55s (± 1.85%) 1.55s (± 1.45%) ~ 1.52s 1.57s p=0.513 n=6
Bind Time 0.86s (± 0.60%) 0.87s (± 1.13%) ~ 0.86s 0.88s p=0.140 n=6
Check Time 11.34s (± 0.66%) 11.30s (± 0.54%) ~ 11.21s 11.38s p=0.295 n=6
Emit Time 3.16s (± 0.88%) 3.15s (± 0.79%) ~ 3.11s 3.18s p=0.806 n=6
Total Time 16.92s (± 0.35%) 16.88s (± 0.34%) ~ 16.80s 16.95s p=0.173 n=6
angular-1 - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 944,110 944,110 ~ ~ ~ p=1.000 n=6
Types 407,140 407,140 ~ ~ ~ p=1.000 n=6
Memory used 1,222,004k (± 0.01%) 1,222,037k (± 0.00%) ~ 1,221,963k 1,222,099k p=0.689 n=6
Parse Time 8.08s (± 0.28%) 8.10s (± 0.58%) ~ 8.04s 8.17s p=0.517 n=6
Bind Time 2.24s (± 0.40%) 2.24s (± 0.67%) ~ 2.22s 2.26s p=0.557 n=6
Check Time 36.48s (± 0.41%) 36.55s (± 0.61%) ~ 36.19s 36.82s p=0.574 n=6
Emit Time 17.51s (± 0.86%) 17.48s (± 0.46%) ~ 17.38s 17.60s p=0.689 n=6
Total Time 64.30s (± 0.34%) 64.37s (± 0.36%) ~ 63.96s 64.67s p=0.873 n=6
mui-docs - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 1,978,404 1,978,404 ~ ~ ~ p=1.000 n=6
Types 882,046 882,046 ~ ~ ~ p=1.000 n=6
Memory used 1,884,888k (± 0.00%) 1,884,847k (± 0.00%) ~ 1,884,783k 1,884,925k p=0.471 n=6
Parse Time 8.04s (± 0.36%) 8.05s (± 0.38%) ~ 8.00s 8.09s p=0.373 n=6
Bind Time 2.74s (± 0.86%) 2.74s (± 0.67%) ~ 2.71s 2.75s p=0.666 n=6
Check Time 71.34s (± 0.36%) 71.24s (± 0.29%) ~ 70.90s 71.49s p=0.689 n=6
Emit Time 0.17s (± 2.38%) 0.17s ~ ~ ~ p=0.405 n=6
Total Time 82.30s (± 0.32%) 82.20s (± 0.23%) ~ 81.90s 82.38s p=1.000 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,223,213 1,223,253 +40 (+ 0.00%) ~ ~ p=0.001 n=6
Types 260,184 260,185 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,338,927k (± 0.02%) 2,339,364k (± 0.04%) ~ 2,337,958k 2,340,908k p=0.471 n=6
Parse Time 6.00s (± 0.96%) 6.03s (± 0.99%) ~ 5.95s 6.12s p=0.422 n=6
Bind Time 2.26s (± 0.82%) 2.27s (± 1.14%) ~ 2.24s 2.31s p=0.573 n=6
Check Time 39.84s (± 0.59%) 39.74s (± 0.33%) ~ 39.54s 39.90s p=0.471 n=6
Emit Time 3.24s (± 0.63%) 3.22s (± 3.22%) ~ 3.06s 3.33s p=1.000 n=6
Total Time 51.37s (± 0.43%) 51.26s (± 0.45%) ~ 50.91s 51.53s p=0.575 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,223,213 1,223,253 +40 (+ 0.00%) ~ ~ p=0.001 n=6
Types 260,184 260,185 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,415,198k (± 0.02%) 2,440,259k (± 2.55%) ~ 2,414,160k 2,567,345k p=0.575 n=6
Parse Time 6.27s (± 1.15%) 6.25s (± 1.04%) ~ 6.13s 6.30s p=0.810 n=6
Bind Time 2.03s (± 1.19%) 2.04s (± 0.67%) ~ 2.02s 2.05s p=1.000 n=6
Check Time 40.27s (± 0.30%) 40.30s (± 0.32%) ~ 40.09s 40.48s p=0.748 n=6
Emit Time 3.21s (± 2.37%) 3.15s (± 2.12%) ~ 3.07s 3.26s p=0.092 n=6
Total Time 51.79s (± 0.29%) 51.76s (± 0.19%) ~ 51.63s 51.90s p=1.000 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 257,698 257,738 +40 (+ 0.02%) ~ ~ p=0.001 n=6
Types 104,910 104,911 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 426,633k (± 0.01%) 426,421k (± 0.02%) -212k (- 0.05%) 426,351k 426,523k p=0.005 n=6
Parse Time 3.36s (± 0.64%) 3.36s (± 0.51%) ~ 3.33s 3.38s p=0.935 n=6
Bind Time 1.32s (± 0.57%) 1.33s (± 0.31%) +0.01s (+ 0.76%) 1.32s 1.33s p=0.029 n=6
Check Time 17.86s (± 0.35%) 17.95s (± 0.34%) ~ 17.88s 18.06s p=0.052 n=6
Emit Time 1.36s (± 1.20%) 1.35s (± 1.43%) ~ 1.32s 1.37s p=0.807 n=6
Total Time 23.90s (± 0.31%) 23.99s (± 0.30%) ~ 23.91s 24.11s p=0.078 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 35 ~ ~ ~ p=1.000 n=6
Symbols 224,575 224,575 ~ ~ ~ p=1.000 n=6
Types 93,785 93,785 ~ ~ ~ p=1.000 n=6
Memory used 369,980k (± 0.03%) 369,883k (± 0.03%) ~ 369,770k 370,012k p=0.173 n=6
Parse Time 2.34s (± 1.05%) 2.34s (± 0.87%) ~ 2.32s 2.37s p=0.870 n=6
Bind Time 1.32s (± 1.03%) 1.34s (± 1.39%) ~ 1.32s 1.37s p=0.212 n=6
Check Time 13.30s (± 0.25%) 13.31s (± 0.28%) ~ 13.28s 13.38s p=0.809 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 16.97s (± 0.21%) 17.00s (± 0.18%) ~ 16.95s 17.03s p=0.198 n=6
vscode - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,834,818 2,834,818 ~ ~ ~ p=1.000 n=6
Types 960,647 960,647 ~ ~ ~ p=1.000 n=6
Memory used 3,006,743k (± 0.00%) 3,006,727k (± 0.00%) ~ 3,006,693k 3,006,793k p=0.689 n=6
Parse Time 11.55s (± 0.29%) 11.54s (± 0.32%) ~ 11.51s 11.59s p=0.742 n=6
Bind Time 3.47s (± 0.28%) 3.48s (± 0.31%) ~ 3.47s 3.49s p=0.246 n=6
Check Time 66.20s (± 2.34%) 66.34s (± 1.52%) ~ 64.30s 66.95s p=0.936 n=6
Emit Time 17.20s (± 7.96%) 17.08s (± 5.18%) ~ 16.57s 18.87s p=0.471 n=6
Total Time 98.43s (± 0.25%) 98.45s (± 0.22%) ~ 98.21s 98.71s p=0.810 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 266,087 266,087 ~ ~ ~ p=1.000 n=6
Types 108,518 108,518 ~ ~ ~ p=1.000 n=6
Memory used 410,928k (± 0.02%) 410,879k (± 0.02%) ~ 410,787k 411,062k p=0.378 n=6
Parse Time 4.75s (± 0.46%) 4.75s (± 0.63%) ~ 4.73s 4.81s p=0.935 n=6
Bind Time 2.07s (± 0.73%) 2.08s (± 0.68%) ~ 2.06s 2.10s p=0.564 n=6
Check Time 21.00s (± 0.44%) 20.94s (± 0.51%) ~ 20.80s 21.10s p=0.378 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 27.82s (± 0.28%) 27.78s (± 0.40%) ~ 27.64s 27.91s p=0.470 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 524,654 524,654 ~ ~ ~ p=1.000 n=6
Types 178,920 178,920 ~ ~ ~ p=1.000 n=6
Memory used 462,737k (± 0.03%) 462,760k (± 0.02%) ~ 462,603k 462,873k p=0.936 n=6
Parse Time 3.89s (± 0.14%) 3.88s (± 0.42%) ~ 3.86s 3.90s p=0.360 n=6
Bind Time 1.45s (± 1.55%) 1.45s (± 1.19%) ~ 1.42s 1.47s p=1.000 n=6
Check Time 22.40s (± 0.57%) 22.58s (± 0.83%) +0.19s (+ 0.84%) 22.24s 22.81s p=0.045 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 27.73s (± 0.41%) 27.91s (± 0.66%) +0.18s (+ 0.67%) 27.59s 28.16s p=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)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,292ms (± 0.51%) 2,300ms (± 0.55%) ~ 2,278ms 2,311ms p=0.172 n=6
Req 2 - geterr 5,168ms (± 0.33%) 5,161ms (± 0.38%) ~ 5,141ms 5,183ms p=0.748 n=6
Req 3 - references 285ms (± 0.48%) 284ms (± 0.35%) ~ 282ms 285ms p=0.343 n=6
Req 4 - navto 229ms (± 0.86%) 229ms (± 1.18%) ~ 225ms 232ms p=1.000 n=6
Req 5 - completionInfo count 1,357 1,357 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 82ms (±10.11%) 83ms (± 9.87%) ~ 76ms 93ms p=0.804 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 3,576ms (± 0.44%) 3,597ms (± 0.74%) ~ 3,563ms 3,631ms p=0.128 n=6
Req 2 - geterr 5,671ms (± 0.42%) 5,697ms (± 0.30%) ~ 5,677ms 5,725ms p=0.066 n=6
Req 3 - references 446ms (± 0.45%) 447ms (± 0.12%) ~ 446ms 447ms p=0.802 n=6
Req 4 - navto 341ms (± 1.48%) 340ms (± 1.35%) ~ 332ms 345ms p=1.000 n=6
Req 5 - completionInfo count 1,519 1,519 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 110ms (± 7.44%) 114ms (± 9.69%) ~ 100ms 124ms p=1.000 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen 5,130ms (± 0.45%) 5,153ms (± 0.50%) ~ 5,115ms 5,176ms p=0.128 n=6
Req 2 - geterr 1,128ms (± 0.98%) 1,128ms (± 1.28%) ~ 1,113ms 1,150ms p=0.873 n=6
Req 3 - references 94ms (± 2.51%) 91ms (± 4.52%) ~ 87ms 96ms p=0.559 n=6
Req 4 - navto 455ms (± 0.40%) 458ms (± 0.70%) ~ 454ms 462ms p=0.064 n=6
Req 5 - completionInfo count 3,413 3,413 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 868ms (± 0.85%) 857ms (± 1.86%) ~ 836ms 873ms p=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)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
tsc-startup - node (v18.15.0, x64)
Execution time 188.19ms (± 0.22%) 187.89ms (± 0.19%) -0.30ms (- 0.16%) 186.18ms 192.63ms p=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 294.02ms (± 0.26%) 294.10ms (± 0.28%) ~ 287.03ms 303.88ms p=0.127 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 350.12ms (± 0.30%) 350.23ms (± 0.30%) ~ 342.31ms 355.23ms p=0.197 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 351.91ms (± 0.28%) 352.22ms (± 0.30%) +0.31ms (+ 0.09%) 343.88ms 366.05ms p=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)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@rbuckton rbuckton changed the title Do not infer yield* type from contextual TReturn Do not infer yield* type from contextual TReturn May 22, 2024
@typescript-bot
Copy link
Collaborator

@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
Collaborator

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

Everything looks good!

@rbuckton
Copy link
Member Author

@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 test tsserver top100

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 23, 2024

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

Command Status Results
test tsserver top100 ✅ Started 👀 Results

@rbuckton
Copy link
Member Author

Temporarily reverting change to validate crash.

@typescript-bot test tsserver top100
@typescript-bot user test tsserver

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 23, 2024

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

Command Status Results
test tsserver top100 ✅ Started 👀 Results
user test tsserver ✅ Started ✅ Results

@jakebailey
Copy link
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
Collaborator

@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
Collaborator

@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
Collaborator

@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
Member Author

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

@rbuckton
Copy link
Member Author

@typescript-bot test tsserver top100

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 29, 2024

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

Command Status Results
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
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?

Copy link
Member Author

@rbuckton rbuckton May 29, 2024

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
Collaborator

@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 rbuckton merged commit 718d798 into main May 29, 2024
54 checks passed
@rbuckton rbuckton deleted the fix57903 branch May 29, 2024 22:05
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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs 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