microsoft / microsoft/TypeScript

Design Meeting Notes, 2026-06-23

未关闭
#63,674 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Design Notes
主要语言
Go
星标
111k
派生
14.3k
平均合并
2 天 4 小时
30 天内合并 PR
132

描述

isolatedDeclarations and Control Flow Analysis

https://github.com/microsoft/typescript-go/pull/4367

  • Want to be able to infer types for trivial expressions in isolatedDeclarations in a function block.
    • Specifically in discussion is if there are no return statements.
  • But what happpens when you have a never-returning call? That can cause a never.
  • Feels like anything with multiple statements in the body is questionable.
  • We could make a special-case for () => {}.
    • Probably enough to just say "just write void".
  • Feels bad to say we can't come up with a type for () => {}
    • Why? Feels like it's not a big deal?
    • Well it's even more trivial than a single expression being returned.
    • Sure, but the reason we added trivial expression inference was because people often have bigger structures of objects that are nested. So the triviality was not really about writing small expressions.
  • One reason why we didn't do it (we think) is that we don't want to close the door to ourselves on how void vs. undefined is inferred for no-return-expression functions.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先阅读 issue 讨论和链接的 pull request:microsoft/typescript-go#4367。明确 isolatedDeclarations 对没有 return 语句的函数体的预期行为,包括永不返回的调用,以及 void 与 undefined 之间的区别。当项目就行为和相应的实现范围达成一致时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript
领域
compilers
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。