Open
Description
TypeScript Version: 3.8.0-dev.20191122
Code
- source code
interface PromiseAction extends Promise<Action> {}
type Action = {type: string} | PromiseAction;
const createFooAction = async (): Promise<Action> => {type: "foo"};
- tsconfig.json
{
"compilerOptions": {
"target": "es2017",
"allowSyntheticDefaultImports": true,
"module": "commonjs",
"moduleResolution": "node",
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strictNullChecks": true,
},
"include": ["src/**/*"]
}
Expected behavior:
succeed type check or raise some error
Actual behavior:
tsc crashes with RangeError: Maximum call stack size exceeded
$ npm run check
> @ check /Users/okamoto-k/sandbox
> tsc --noEmit
/Users/okamoto-k/sandbox/node_modules/typescript/lib/tsc.js:78686
throw e;
^
RangeError: Maximum call stack size exceeded
at getPromisedTypeOfPromise (/Users/okamoto-k/sandbox/node_modules/typescript/lib/tsc.js:49700:42)
at getAwaitedType (/Users/okamoto-k/sandbox/node_modules/typescript/lib/tsc.js:49758:32)
at getAwaitedType (/Users/okamoto-k/sandbox/node_modules/typescript/lib/tsc.js:49751:46)
at getAwaitedType (/Users/okamoto-k/sandbox/node_modules/typescript/lib/tsc.js:49767:35)
at getAwaitedType (/Users/okamoto-k/sandbox/node_modules/typescript/lib/tsc.js:49751:46)
at getAwaitedType (/Users/okamoto-k/sandbox/node_modules/typescript/lib/tsc.js:49767:35)
at getAwaitedType (/Users/okamoto-k/sandbox/node_modules/typescript/lib/tsc.js:49751:46)
at getAwaitedType (/Users/okamoto-k/sandbox/node_modules/typescript/lib/tsc.js:49767:35)
at getAwaitedType (/Users/okamoto-k/sandbox/node_modules/typescript/lib/tsc.js:49751:46)
at getAwaitedType (/Users/okamoto-k/sandbox/node_modules/typescript/lib/tsc.js:49767:35)
Related Issues:
I couldn't find it.