Async function with a typed result rejects a returned checked-dynamic promise
メンテナーはふだん 1 日以内に返信
@alantriesagain がすでに取り組んでいます。
2026年11月6日 から。
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- javascript, typescript
- 領域
- compilers
調査の方向性
The report provides a JavaScript reproduction and says the failure also occurs on main at commit 979a65246, but names no implementation files or tests. Start by tracing how typed async function returns and concise async arrow bodies handle checked-dynamic values, then find the related compiler tests. Done means both forms adopt returned promises with the stated turn order and settle other values without an extra turn.
索引モデルが issue の本文から書いたものです。
説明
Async function with a typed result rejects a returned checked-dynamic promise
An async function whose result is typed checks a returned checked-dynamic value against that type directly. When the value is a promise, JavaScript resolves the function's promise with that promise: the promise is adopted, not converted as a plain value.
In our model layer, uploadFiles takes a schema whose type does not map, so its call is checked-dynamic. return uploadFiles(...) from a typed async function failed at run time with expected object at $, got Promise. Node resolves the returned promise.
/** @returns {Promise<{ id: string }>} */
async function load() {
const opaque = (value) => value;
return opaque(Promise.resolve({ id: "a" }));
}
load().then((value) => console.log(value.id));
On 0.4.8, the compiled program throws Uncaught TypeError: expected object at $, got Promise; Node prints a. The same failure reproduces on main (979a65246).
The same rule should apply to concise async arrow bodies. A promise behind the dynamic value should be adopted with the turn order of a returned typed promise: the then job's turn, then its settlement, after every crossed finally and outside the function's own catch. Any other value should settle the function at once, with no extra turn.
I opened #TBD with a patch for both forms.
- 主要言語
- TypeScript
- スター
- 6.5k
- フォーク
- 212
- 平均マージ
- 13時間 2分
- マージ済み PR(30日)
- 798
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
vercel-labs/scriptc のほかの issue
-
Discarded negation of a void call rejects valid JavaScript対応中かも @MathurAditya724 が 1 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 1/100
vercel-labs/scriptc#3358 ·
メンテナーはふだん 1 日以内に返信
-
Optional JSDoc rejects mandatory JavaScript setter parameters対応中かも @MathurAditya724 が 1 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
vercel-labs/scriptc#3355 ·
メンテナーはふだん 1 日以内に返信
-
Correct JavaScript refusal descriptions for mutable bindings and missing properties対応中かも @MathurAditya724 が 1 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
vercel-labs/scriptc#3354 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
vercel-labs/scriptc#3330 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
vercel-labs/scriptc#3210 ·
メンテナーはふだん 1 日以内に返信
vercel-labs/scriptc の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
danielw-sudo/agentuto#63 ·
メンテナーはふだん 1 日以内に返信
-
idea-scout idea:341
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
jeanibarz/agent-notebook#341 ·
メンテナーはふだん 1 日以内に返信
-
documentation good first issue roadmap
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nightgauge/nightgauge#3077 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
LibreChat-AI/LibreChat#17915 ·
メンテナーはふだん 1 日以内に返信