microsoft / microsoft/TypeScript

RangeError: Maximum call stack size exceeded in getTypeFromTypeNode when resolving recursive tuple rest with intersection

Đang mở
#63,040 2 bình luận 0 reaction 1 người được giao Xem trên GitHub

@ahejlsberg đang làm issue này rồi.

Từ ngày 3/2/2026.

Bug Domain: check: Type Circularity
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

RangeError: Maximum call stack size exceeded

getTypeFromTypeNode

getImpliedConstraint

Recursive tuple rest

Intersection type crash

🕗 Version & Regression Information

Crashes in 5.7.3, 5.8.3, 5.9.3, and Nightly.

⏯ Playground Link

https://www.typescriptlang.org/zh/play/?target=7&ts=6.0.0-dev.20260203#code/C4TwDgpgBAysBOBLAdgcwCrwhAgveAhiDgM7oCuYANhADzoB8UAvFABTpQQAewEyAExJQA2gDoJKAGYR4UAEoBdKAH5REsXCRpM2PIWJlKNWvIbKAXFGQQAbrKgBKKADIoAIwD2nmgWRA

💻 Code
type StringTreeArrayAsTuple<T> = (T extends [...infer R] ? [...StringTreeArrayAsTuple<R>] : never ) & boolean
🙁 Actual behavior
 .\ts-versions\nightly\node_modules\.bin\tsc.cmd     interfaceDoesNotDependOnBaseTypes_enriched_deep_mutated_batch6.ts         
D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:123178
      throw e;
      ^

RangeError: Maximum call stack size exceeded
    at getTypeFromTypeReference (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:60415:36)                                                                                        
    at getTypeFromTypeNodeWorker (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:63093:16)                                                                                       
    at getTypeFromTypeNode (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:63055:41)                                                                                             
    at getImpliedConstraint (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:60310:182)                                                                                           
    at getConditionalFlowTypeOfType (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:60321:28)                                                                                    
    at getTypeFromTypeNode (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:63055:12)                                                                                             
    at getTypeFromRestTypeNode (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:63026:12)                                                                                         
    at getTypeFromTypeNodeWorker (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:63120:16)                                                                                       
    at getTypeFromTypeNode (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:63055:41)                                                                                             
    at map (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:196:19)                                                                                                               

🙂 Expected behavior

The compiler should not crash.

Additional information about the issue

No response

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.