-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already createdFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
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:
tonivj5, apexskier, ikokostya and kohlmannj
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already createdFix AvailableA PR has been opened for this issueA PR has been opened for this issue