-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
🔎 Search Terms
addTypesToUnion stack overflow
getUnionTypeWorker crash
keyof missing type crash
Internal Compiler Error destructuring
🕗 Version & Regression Information
v5.7.3 / v5.8.3 / v5.9.3 / Nightly: Crashes(This crash only occurs when the --strict flag is enabled.)
⏯ Playground Link
💻 Code
const { c, d, e, f, g }: keyof = {
...{
...{
...{
c: 0,
},
d: 0
},
e: 0
},
f
};🙁 Actual behavior
.\ts-versions\nightly\node_modules\.bin\tsc.cmd --strict .\mutated\destructuringSpread_mutated_batch15.ts
D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:123166
throw e;
^
RangeError: Maximum call stack size exceeded
at addTypesToUnion (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:61209:27)
at getUnionTypeWorker (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:61385:22)
at getUnionType (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:61381:12)
at mapType (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:69885:37)
at getApparentTypeOfContextualType (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:73263:28)
at checkObjectLiteral (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:73978:28)
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:80794:32)
at checkObjectLiteral (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:74062:37)
at checkExpressionWorker (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:80883:16)
Node.js v22.19.0
🙂 Expected behavior
The compiler should report a syntax error and not crash.
Additional information about the issue
No response
Copilot
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this