microsoft / microsoft/TypeScript
Design Meeting Notes, 2026-06-23
Đang mở
Chưa có ai nhận issue này.
Design Notes
- Ngôn ngữ chính
- Go
- Star
- 111k
- Fork
- 14.3k
- Merge trung bình
- 2 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 132
Mô tả
isolatedDeclarations and Control Flow Analysis
https://github.com/microsoft/typescript-go/pull/4367
- Want to be able to infer types for trivial expressions in
isolatedDeclarationsin 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 anever. - 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".
- Probably enough to just say "just write
- 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
voidvs.undefinedis inferred for no-return-expression functions.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách đọc phần thảo luận của issue và pull request được liên kết, microsoft/typescript-go#4367. Làm rõ hành vi dự kiến của isolatedDeclarations đối với các thân hàm không có câu lệnh return, bao gồm các lệnh gọi không bao giờ trả về và sự phân biệt giữa void và undefined. Công việc được xem là hoàn tất khi dự án đã thống nhất hành vi và phạm vi triển khai tương ứng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- typescript
- Lĩnh vực
- compilers
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100