Skip to content

Crash: RangeError: Maximum call stack size exceeded when destructuring undefined/unknown as identifiers in parameter list #63091

@na7ure-a

Description

@na7ure-a

🔎 Search Terms

"Maximum call stack size exceeded"

"isDeprecatedSymbol stack overflow"

"checkIdentifier stack overflow"

"destructuring undefined unknown crash"

🕗 Version & Regression Information

Tested Versions: 5.7.3, 5.8.3, 5.9.3 (Nightly)
Strict Mode: Only crashes with --strict enabled.

⏯ Playground Link

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

💻 Code

function ([undefined, unknown]: string | undefined = undefined)

🙁 Actual behavior

D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:123214
      throw e;
      ^

RangeError: Maximum call stack size exceeded
    at getCombinedNodeFlagsCached (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:90402:38)
    at isDeprecatedDeclaration (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:47562:15)
    at every (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:83:12)
    at isDeprecatedSymbol (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:47559:124)
    at checkIdentifierCalculateNodeCheckFlags (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:71962:9)
    at checkIdentifier (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:72001:5)
    at checkExpressionWorker (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:80883:16)
    at checkExpression (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:80826:32)
    at getTypeOfExpression (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:80767:18)
    at getTypeOfInitializer (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:69758:34)

🙂 Expected behavior

The compiler should not crash.

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions