Skip to content

fix(checker): stop a panic on an invalid thenable yield in an async generator - #1091

Merged
camc314 merged 3 commits into
mainfrom
fix/async-generator-missing-yield-type
Nov 25, 2026
Merged

camc314 merged 3 commits into
mainfrom
fix/async-generator-missing-yield-type

Conversation

@camc314

@camc314 camc314 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Inferring the return type of an unannotated async generator unwrapped the awaited type of each yielded value. A thenable that is not a valid promise has no awaited type, so tsrs panicked instead of reporting the error.

async function* g() {
    yield { then() {} };
}

tsgo reports TS1321 and infers AsyncGenerator<never, void, unknown>. tsrs panicked with called Option::unwrap() on a None value and exited 5. The same happened for the TS1062 (self-referencing then) and TS1322 (yield* of an async iterable of thenables) forms.

Go appends the nil awaited type to the yield types. A union of that one constituent is nil, so the yield type falls back to never; beside another yield, Go's union dereferences the nil and pinned tsgo panics. Skipping the missing type matches tsgo wherever it does not crash and otherwise infers the yield type from the other yields. The regression fixture pins the tsgo cases; a CLI test covers the case where tsgo panics.

yield* of a sync iterable of thenables still panics in both compilers, from a separate missing diagnostic message, and is left out of this change.

Copilot AI balanced review requested due to automatic review settings November 25, 2026 14:55
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: βœ… Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
πŸ“ Code Review βœ… Completed 2026-11-25T14:57:20.358950Z 168b73f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with πŸ‘€ while any review is running, comments if it has suggestions, and reacts with πŸ‘ once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@camc314
camc314 enabled auto-merge November 25, 2026 14:59
@camc314
camc314 added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 47d7e41 Nov 25, 2026
20 checks passed
@camc314
camc314 deleted the fix/async-generator-missing-yield-type branch November 25, 2026 15:09
@codspeed

codspeed Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

Warning

oxc-project has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 8, 2026 to keep using CodSpeed.

1 warning

⚠️ 4 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

βœ… 8 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing fix/async-generator-missing-yield-type (168b73f) with main (1e17a12)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@github-actions

Copy link
Copy Markdown
Contributor

Performance change vs main

Workflow run Β· main 1e17a12ba178 β†’ PR merge a1dd6f75bbde (head 168b73f68734)

Clef gate: Clef estimated 31.4% default and single-threaded wall time, 33.5% peak RSS, 50.3% single-threaded instruction count impact probability.

Release builds in fast mode (TSRS_FAST=1) with Hyperfine 2 hardware counters. After warming each binary, alternating main/PR pairs measure wall time at both the fast preset's default checker count and with --singleThreaded, with ten pairs per configuration by default. Instructions come from the single-threaded runs; peak RSS comes from the default-count runs.
Incremental runs start with fresh build info before every invocation; check runs disable incremental compilation.

Project Mode Single-thread wall time Ξ” Single-thread instructions Ξ” Default wall time Ξ” Default peak RSS Ξ”
vscode check +1.5% -0.001% -5.7% -0.1%
vscode incremental -0.3% +0.002% -3.4% 0.0%
xstate-main check -0.2% -0.001% +3.7% +0.6%
xstate-main incremental -0.2% -0.002% +7.3% -0.1%
webpack check +0.5% -0.001% +0.7% -0.4%
webpack incremental +1.6% 0.000% -1.5% -0.4%
mui-docs check -0.2% +0.004% -1.0% +0.6%
mui-docs incremental +1.5% -0.002% +0.3% 0.0%
Compiler check +1.9% 0.000% +0.1% 0.0%
Compiler incremental -0.9% -0.001% -0.8% +0.1%
Compiler-Unions check +0.6% 0.000% -1.3% +0.6%
Compiler-Unions incremental +0.1% 0.000% -1.7% +0.1%
cal-diy check +0.7% -0.002% -0.2% +0.9%
cal-diy incremental -1.1% +0.007% +0.1% -0.1%
formbricks-web check +1.1% 0.000% -0.8% 0.0%
formbricks-web incremental -0.3% 0.000% -5.5% -0.1%
supabase-studio check -1.1% +0.001% +0.8% 0.0%
supabase-studio incremental 0.0% -0.006% +1.8% -0.1%
t3code-server check +0.4% +0.003% +1.8% +0.6%
t3code-server incremental +0.4% -0.001% -1.4% 0.0%
mikro-orm check -2.0% -0.001% +0.1% +0.3%
mikro-orm incremental +0.5% +0.001% +1.8% -0.3%
next-packages-next check -0.2% 0.000% -0.8% +0.3%
next-packages-next incremental -0.6% +0.001% -1.1% +0.3%
next-root check +4.1% +0.001% -3.4% +0.3%
next-root incremental +0.2% 0.000% +1.0% +0.1%
storybook check -0.1% 0.000% -1.3% 0.0%
storybook incremental +0.5% +0.005% -5.7% +0.1%
nuxt check -1.4% -0.002% +6.1% +0.1%
nuxt incremental +0.8% +0.001% +1.8% -0.2%
playwright check -1.6% -0.001% -1.3% -1.2%
playwright incremental -5.7% -0.001% +4.9% -0.2%
drizzle-orm check +0.9% +0.002% -1.1% +0.9%
drizzle-orm incremental -0.2% -0.002% -0.1% 0.0%
typeorm check +0.3% -0.001% -1.8% -0.1%
typeorm incremental -0.9% +0.001% +7.2% -0.7%
date-fns check +3.6% +0.009% +3.3% +0.5%
date-fns incremental -2.9% -0.001% -1.1% +0.4%

Negative means the PR used less; positive means it used more. Deltas are medians of paired PR/main ratios for wall time and instructions. Single-threaded runs reduce scheduling noise; shared CI machines can still add noise to wall time.

Measured medians (main β†’ PR)
Project Mode Single-thread wall time (s) Single-thread instructions Default wall time (s) Default peak RSS (MiB)
vscode check 10.484 β†’ 10.623 82,266,709,659.5 β†’ 82,266,002,161.5 2.054 β†’ 2.005 1841.9 β†’ 1841.0
vscode incremental 9.721 β†’ 9.644 84,683,049,913 β†’ 84,684,837,218.5 1.729 β†’ 1.679 2162.5 β†’ 2161.7
xstate-main check 0.554 β†’ 0.552 5,566,867,470.5 β†’ 5,566,750,345.5 0.141 β†’ 0.147 241.8 β†’ 243.1
xstate-main incremental 0.959 β†’ 0.774 5,728,559,282 β†’ 5,728,458,735 0.291 β†’ 0.316 244.7 β†’ 244.6
webpack check 1.107 β†’ 1.120 10,885,627,122 β†’ 10,885,485,224.5 0.225 β†’ 0.223 405.8 β†’ 404.1
webpack incremental 1.031 β†’ 1.052 11,109,574,832.5 β†’ 11,109,320,473.5 0.267 β†’ 0.268 405.0 β†’ 403.6
mui-docs check 2.399 β†’ 2.405 33,106,984,782 β†’ 33,110,144,040.5 0.952 β†’ 0.956 1227.0 β†’ 1234.0
mui-docs incremental 2.714 β†’ 2.786 34,463,832,918 β†’ 34,465,277,852 1.127 β†’ 1.150 1161.0 β†’ 1161.1
Compiler check 0.164 β†’ 0.172 1,775,524,999.5 β†’ 1,775,530,797.5 0.074 β†’ 0.074 77.8 β†’ 77.8
Compiler incremental 0.150 β†’ 0.150 1,789,936,991.5 β†’ 1,789,924,503.5 0.065 β†’ 0.064 79.7 β†’ 79.8
Compiler-Unions check 0.234 β†’ 0.234 3,053,246,553.5 β†’ 3,053,254,651.5 0.109 β†’ 0.108 81.0 β†’ 81.5
Compiler-Unions incremental 0.197 β†’ 0.197 3,064,788,913 β†’ 3,064,778,804 0.093 β†’ 0.092 85.2 β†’ 85.3
cal-diy check 2.637 β†’ 2.654 28,974,928,577 β†’ 28,974,342,620.5 0.864 β†’ 0.871 1347.2 β†’ 1359.4
cal-diy incremental 3.203 β†’ 3.119 30,595,417,901.5 β†’ 30,597,154,443 1.145 β†’ 1.141 1267.1 β†’ 1266.2
formbricks-web check 8.568 β†’ 8.712 37,089,126,326 β†’ 37,088,819,559 1.969 β†’ 1.952 1582.1 β†’ 1582.2
formbricks-web incremental 4.012 β†’ 4.094 39,693,030,642 β†’ 39,692,912,610.5 1.245 β†’ 1.217 1625.4 β†’ 1623.9
supabase-studio check 5.266 β†’ 5.344 40,824,447,647.5 β†’ 40,824,146,866.5 1.105 β†’ 1.138 1307.7 β†’ 1308.1
supabase-studio incremental 4.524 β†’ 4.680 43,772,456,323 β†’ 43,772,135,125.5 1.278 β†’ 1.274 1364.7 β†’ 1363.9
t3code-server check 3.866 β†’ 3.663 41,058,481,213.5 β†’ 41,059,831,154 1.795 β†’ 1.798 1438.8 β†’ 1448.1
t3code-server incremental 9.015 β†’ 9.065 41,583,717,220.5 β†’ 41,582,848,512.5 2.542 β†’ 2.335 1307.3 β†’ 1307.6
mikro-orm check 5.646 β†’ 5.599 44,485,260,718 β†’ 44,484,718,835.5 0.968 β†’ 0.993 1281.2 β†’ 1285.1
mikro-orm incremental 4.961 β†’ 5.141 44,795,448,238 β†’ 44,796,052,439 1.249 β†’ 1.267 1260.4 β†’ 1256.8
next-packages-next check 1.600 β†’ 1.584 17,406,307,889 β†’ 17,406,290,984 0.379 β†’ 0.380 560.7 β†’ 562.5
next-packages-next incremental 1.946 β†’ 1.940 17,732,579,658 β†’ 17,732,784,300.5 0.531 β†’ 0.525 563.0 β†’ 564.6
next-root check 1.734 β†’ 1.771 13,996,312,162 β†’ 13,996,452,991.5 0.346 β†’ 0.337 430.2 β†’ 431.6
next-root incremental 1.370 β†’ 1.400 14,458,762,635.5 β†’ 14,458,783,243.5 0.339 β†’ 0.346 471.7 β†’ 472.4
storybook check 0.776 β†’ 0.780 8,867,569,956 β†’ 8,867,608,646 0.197 β†’ 0.197 397.1 β†’ 397.0
storybook incremental 0.879 β†’ 0.885 9,192,985,012.5 β†’ 9,195,843,227 0.269 β†’ 0.263 374.5 β†’ 375.0
nuxt check 1.105 β†’ 1.087 8,501,903,119 β†’ 8,501,754,105.5 0.248 β†’ 0.263 390.7 β†’ 391.1
nuxt incremental 0.969 β†’ 0.949 8,904,638,745 β†’ 8,904,700,664 0.255 β†’ 0.248 392.0 β†’ 391.3
playwright check 0.787 β†’ 0.764 7,403,415,555.5 β†’ 7,403,295,506.5 0.194 β†’ 0.189 366.1 β†’ 361.5
playwright incremental 1.006 β†’ 0.949 7,576,836,666.5 β†’ 7,576,815,699.5 0.241 β†’ 0.242 340.3 β†’ 339.7
drizzle-orm check 0.573 β†’ 0.583 5,948,671,144.5 β†’ 5,948,898,556.5 0.187 β†’ 0.191 380.9 β†’ 384.3
drizzle-orm incremental 0.647 β†’ 0.645 6,120,502,206 β†’ 6,120,388,627.5 0.195 β†’ 0.198 345.8 β†’ 345.7
typeorm check 0.631 β†’ 0.630 6,398,434,318 β†’ 6,398,361,381 0.138 β†’ 0.136 226.8 β†’ 226.5
typeorm incremental 0.798 β†’ 0.826 6,776,038,599 β†’ 6,776,201,172 0.208 β†’ 0.221 234.6 β†’ 232.9
date-fns check 0.544 β†’ 0.555 3,351,946,350.5 β†’ 3,352,180,143.5 0.107 β†’ 0.110 153.0 β†’ 153.7
date-fns incremental 0.405 β†’ 0.398 3,589,756,902.5 β†’ 3,590,105,494 0.198 β†’ 0.193 163.4 β†’ 163.9

tsrs-lint

Release tsrs-lint linting each project's source files with all 61 rules. After a warmup run of each binary, alternating main/PR pairs (10 per mode) measure wall time, CPU time and peak RSS with TSRS_FAST unset and with TSRS_FAST=1.

Project Mode Wall time Ξ” CPU time Ξ” Peak RSS Ξ” Diagnostics (main β†’ PR)
webpack default +2.8% -2.1% 0.0% 35405, identical
webpack TSRS_FAST=1 +0.1% +2.4% -0.2% 35405, identical
drizzle-orm default -1.1% +1.0% +0.3% 7057, identical
drizzle-orm TSRS_FAST=1 +2.3% -4.9% -0.1% 7057, identical
xstate-main default -4.7% -4.4% +0.4% 6489, identical
xstate-main TSRS_FAST=1 +2.2% -1.1% +0.8% 6489, identical

Negative means the PR used less. Wall and CPU time deltas are medians of paired PR/main ratios; peak RSS compares medians.

Measured lint medians (main β†’ PR)
Project Mode Wall time (s) CPU time (s) Peak RSS (MiB)
webpack default 0.586 β†’ 0.590 3.135 β†’ 3.164 464.2 β†’ 464.2
webpack TSRS_FAST=1 0.571 β†’ 0.574 2.933 β†’ 2.945 464.0 β†’ 463.1
drizzle-orm default 0.418 β†’ 0.390 2.113 β†’ 2.030 403.6 β†’ 404.7
drizzle-orm TSRS_FAST=1 0.426 β†’ 0.400 2.154 β†’ 2.044 403.5 β†’ 403.1
xstate-main default 0.601 β†’ 0.566 2.573 β†’ 2.449 342.3 β†’ 343.5
xstate-main TSRS_FAST=1 0.539 β†’ 0.531 2.389 β†’ 2.409 340.2 β†’ 343.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants