-
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 issue
Milestone
Description
🔎 Search Terms
RangeError: Maximum call stack size exceeded
isThisInTypeQuery
Regression
typeof crash
🕗 Version & Regression Information
Works in: v5.7.3, v5.8.3, v5.9.3 (Reports standard errors: TS2448, TS2345, etc.)
Crashes in: Nightly
⏯ Playground Link
💻 Code
unionOfDifferentReturnType1(true); // error in type of parameter
const unionOfDifferentReturnType1: {
(a: any): number;
} | {
(a: number): typeof Date;
};🙁 Actual behavior
.\ts-versions\nightly\node_modules\.bin\tsc.cmd .\unionTypeCallSignatures_6.ts
D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:123178
throw e;
^
RangeError: Maximum call stack size exceeded
at isThisIdentifier (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:16646:26)
at isThisInTypeQuery (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:16656:8)
at checkIdentifier (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:71968:9)
at checkExpressionWorker (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:80857:16)
at checkExpression (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:80800:32)
at checkExpressionWithTypeArguments (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:77806:182)
at getTypeFromTypeQueryNode (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:60457:20)
at getTypeFromTypeNodeWorker (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:63099:16)
at getTypeFromTypeNode (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:63055:41)
at getReturnTypeFromAnnotation (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:59715:14)
Node.js v22.19.0
🙂 Expected behavior
The compiler should not crash.
Additional information about the issue
No response
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 issue