Stack overflow related to "getting" awaited, recursive union type #42948
Labels
Bug
A bug in TypeScript
Fix Available
A PR has been opened for this issue
Rescheduled
This issue was previously scheduled to an earlier milestone
Milestone
Bug Report
Hit a stack overflow that seems like a member of this family of previously reported + solved issue.
🔎 Search Terms
stack limit
mapType
getAwaitedType
getAwaitedTypeWorker
🕗 Version & Regression Information
Seems to have existed since ~3.7 when the
type
keyword began to support self references. The playground link is for the nightly. I had to open the dev tools to see the actual crash message in the playground.⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
🙂 Expected behavior
In hindsight that code is pretty sadistically self-referential, but I didn't expect to hit an overflow limit. Ideally the code sample should check without any issue. Alternatively, some warning to indicate which lines of code are involved in process crash would be plenty; this type of nightmare-recursion should be an edge case, and there's a decent workaround. This edited sample is fine for the same range of versions from 3.7 to the nightly build:
Thanks in advance for taking a look 😄
The text was updated successfully, but these errors were encountered: