Promise.all result is treated as possibly undefined, widening mapped rows
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 47/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- javascript, typescript
- 领域
- compilers
调研方向
Start with the optional-read analysis that assigns facts to Promise.all results, then inspect the TypeScript and JavaScript corpus cases async-early-return-promise-all.ts and async-early-return-promise-all.js. Compare their SC9001 failures with the reported passing cases 4948 and 4956, and check the Promise.allSettled behavior. Done means the reported Promise.all cases compile without the internal errors while Promise.allSettled remains conservative.
由索引模型根据 Issue 内容生成。
描述
Promise.all result is treated as possibly undefined, widening mapped rows
The optional-read analysis assumes that any Promise.all result can hold undefined. That fact lands on the element ABI of the array the result is stored in. After
rows = await Promise.all(rows.map((row) => load(row, includes)));
every array of that element type counted as possibly holding undefined. The map callback's parameter widened, the parameter of load widened with it, and an early return row made load return Promise<Row | undefined>. The callback's return became Promise<Row> | undefined, which nothing converts to, and the build failed with SC2003. In JavaScript the site was deferred, and a computed-key write through a loop binding over the result then failed validation.
A typed promise settles with a value of its own type. Every conversion into it checks the value, and the element ABI already records whether that type admits undefined. The Promise.all result therefore holds undefined only where an entry is a hole or undefined. Promise.allSettled keeps the conservative fact.
On 0.4.8, the TypeScript and JavaScript forms in our corpus (async-early-return-promise-all.ts and async-early-return-promise-all.js) still fail with SC9001 internal compiler errors around %recordValue and a bare null at row[field] = null. The separate JavaScript array and indexOf precision programs (4948 and 4956) now pass. The same failures reproduce on main (979a65246).
I opened #TBD with a patch for the Promise.all fact.
- 主要语言
- TypeScript
- 星标
- 6.5k
- 派生
- 212
- 平均合并
- 13 小时 6 分钟
- 30 天内合并 PR
- 799
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
vercel-labs/scriptc 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 45/100
vercel-labs/scriptc#3416 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
vercel-labs/scriptc#3415 ·
维护者通常 1 天内回复
-
readline: named stdin/stdout imports not recognized as createInterface input/output可能已有人在做 @espetro 今天认领。 未关闭
难度 3/5 1-2 天 新手友好度 25/100
vercel-labs/scriptc#3414 ·
维护者通常 1 天内回复
-
@types/node collides with scriptc-node-fallback.d.ts in projects without tsconfig.json可能已有人在做 @espetro 今天认领。 未关闭
难度 4/5 1-2 天 新手友好度 20/100
vercel-labs/scriptc#3413 ·
维护者通常 1 天内回复
-
island: ESM module with 'module.exports' named export loses its default export across the boundary可能已有人在做 @espetro 今天认领。 未关闭
难度 4/5 3-5 天 新手友好度 25/100
vercel-labs/scriptc#3412 ·
维护者通常 1 天内回复
查看 vercel-labs/scriptc 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
prime-radiant-inc/evener#5901 ·
维护者通常 1 天内回复
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
Bug: Batcher binds the texture that opens a new batch twice (one draw call per element with maxBatchableTextures = 1)可能已有人在做 @darzarzycki 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 2 天内回复
-
area:study-data p2-high ready-for-agent type:chore
难度 2/5 1-3 小时 新手友好度 78/100
fderuiter/deruiter.dev#3706 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
nicobailon/pi-subagents#3242 ·
维护者通常 1 天内回复