Closed
Description
TypeScript Version: 3.7.2
Search Terms:
generics readonly Promise.all
Code
{
"compilerOptions": {
"target": "es2015",
"module": "commonjs",
"strictNullChecks": true,
"esModuleInterop": true,
}
}
declare function x1(): Promise<number>;
declare function x2(): Promise<number | null>;
(async () => {
const [a, b] = await Promise.all([x1(), x2()]);
if (a < 1) { }
})();
Expected behavior:
type of a
should be number
Actual behavior:
type of a
is number | null
Related Issues: