microsoft / microsoft/TypeScript
TS2589 regression in 6.0: implements without type parameters causes excessive type instantiation when property uses concrete generic type
Chưa có ai nhận issue này.
- 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ả
🔎 Search Terms
Type instantiation is excessively deep and possibly infinite.
🕗 Version & Regression Information
- This changed between versions 5.9.3 and 6.0.2
⏯ Playground Link
💻 Code
import type { RouterLocation, WebComponentInterface } from "@vaadin/router";
type RouteExt = { section?: string };
// TS2589 on the class declaration below.
// Fix: replace `WebComponentInterface` with `WebComponentInterface<RouteExt>`.
//
// Note: the error only triggers because `location` is typed with a concrete type
// parameter (`RouterLocation<RouteExt>`). Using `RouterLocation` without a type
// parameter does not trigger it.
export class MyElement extends HTMLElement implements WebComponentInterface {
location?: RouterLocation<RouteExt>;
}
🙁 Actual behavior
I get this error:
Type instantiation is excessively deep and possibly infinite.
But the information isn't very useful to know what to do exactly in this case.
🙂 Expected behavior
Ideally no error, otherwise some more pointers about how to fix this.
Additional information about the issue
When running with --extendedDiagnostics:
typescript 5.9.3:
Files: 259
Types: 203241
Instantiations: 2593860
typescript 6.0.2:
Files: 259
Types: 217322
Instantiations: 5379836
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 với Playground được liên kết và so sánh TypeScript 5.9.3 với 6.0.2 bằng --extendedDiagnostics, tập trung vào khai báo implements và thuộc tính RouterLocation cụ thể. Truy vết đường dẫn khởi tạo kiểu chịu trách nhiệm cho TS2589 và xác thực kết quả dựa trên reproduction được cung cấp; được xem là hoàn tất khi ví dụ không còn báo lỗi hoặc cung cấp hướng dẫn có tính khả thi hơn.
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
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100