Microsoft/TypeScript

[5.5 regression] "Maximum call stack size exceeded" when serializing nested self-referencing class expressions

開放

#59,600 建立於 2024年8月12日

 (0 則留言) (0 個反應) (0 位負責人)TypeScript (13,395 個分叉)batch import
BugDomain: Declaration EmitHelp Wanted

倉庫指標

星標
 (108,860 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

🔎 Search Terms

dts declaration serializing class expression self-referencing nested

🕗 Version & Regression Information

  • This changed between versions 5.4.x and 5.5.x

⏯ Playground Link

https://www.typescriptlang.org/play/?ts=5.6.0-dev.20240812#code/MYewdgzgLgBAgjAvDYAbAhhC8A8AVAPhgG8AoGFACwEtUATAQgC4YBJSKdMYAUzwE8ADjxxQhPEADN4AOgBC+AgQDc5GNHRRqwGHKQoMWXYpJqKg9ACceYKMxh5VFAL6rXpIA

💻 Code

const A = class A<T> {
  child!: InstanceType<typeof A.B<T>>;
  static B = class B<T> {
    parent!: T;
  };
};

🙁 Actual behavior

it crashes

🙂 Expected behavior

it shouldn't crash 😉

Additional information about the issue

No response

貢獻者指南