microsoft / microsoft/TypeScript
Crash: TypeError: Cannot read properties of undefined (reading 'aliasSymbol') remains when using variadic tuple with (infer C)[] and constrained infer
- 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
aliasSymbol, inferFromTypes, variadic tuple, compiler crash
### 🕗 Version & Regression Information
Version: 5.7.3, 5.8.3, 5.9.3,nightly (Still crashing after PR for #63014 )
### ⏯ Playground Link
https://www.typescriptlang.org/zh/play/?target=7&ts=5.9.3#code/C4TwDgpgBAygrgIwCpzAHiQPigXikqCAD2AgDsATAZygG0AoKJqAOjYAoBLMgMwgCcoAYQCUtALoAaRszYtufQQCFCJctToBDMiElRtIcfXFQA-FBUAuKGQgA3AQG56oSPn6cA5p4G5YiFHRaAEY9ACZxTEcgA
### 💻 Code
```ts
type SubTup = T extends [
...(infer C)[],
...infer B extends [any, any]
] ? B : never;
type Trigger = SubTup<[1, 2]>;
```
### 🙁 Actual behavior
```
TypeError: Cannot read properties of undefined (reading 'aliasSymbol')
at inferFromTypes (D:\github\TypeScript\built\local\_tsc.js:68686:18)
at inferFromObjectTypes (D:\github\TypeScript\built\local\_tsc.js:69171:23)
at invokeOnce (D:\github\TypeScript\built\local\_tsc.js:68878:9)
at inferFromTypes (D:\github\TypeScript\built\local\_tsc.js:68840:11)
at inferTypes (D:\github\TypeScript\built\local\_tsc.js:68674:5)
at getConditionalType (D:\github\TypeScript\built\local\_tsc.js:62706:11)
at getConditionalTypeInstantiation (D:\github\TypeScript\built\local\_tsc.js:63695:307)
at instantiateTypeWorker (D:\github\TypeScript\built\local\_tsc.js:63798:14)
at instantiateTypeWithAlias (D:\github\TypeScript\built\local\_tsc.js:63735:20)
at getTypeAliasInstantiation (D:\github\TypeScript\built\local\_tsc.js:60300:52)
Node.js v22.19.0
```
### 🙂 Expected behavior
The compiler should not crash.
### Additional information about the issue
I noticed that while PR #63014 fixed some crashes related to variadic tuples, the compiler still crashes (ICE) when using a slightly different syntax.
Hướng dẫn đóng góp
Hướng nghiên cứu
Tái hiện đoạn mã variadic-tuple từ liên kết Playground hoặc trong compiler, sau đó lần theo stack qua built/local/_tsc.js, đặc biệt là inferFromTypes và inferFromObjectTypes. So sánh lỗi còn lại với PR #63014; được xem là hoàn tất khi ví dụ không còn tạo ra aliasSymbol TypeError hoặc làm compiler bị crash.
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
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 45/100