<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨 Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section! Please help us by doing the following steps before logging an issue: * Search: https://github.com/Microsoft/TypeScript/search?type=Issues * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ Please fill in the *entire* template below. --> <!-- Please try to reproduce the issue with the latest published version. It may have already been fixed. For npm: `typescript@next` This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly --> **TypeScript Version:** 3.7.2 <!-- Search terms you tried before logging this (so others can find this issue more easily) --> **Search Terms:** generics readonly Promise.all **Code** ```json { "compilerOptions": { "target": "es2015", "module": "commonjs", "strictNullChecks": true, "esModuleInterop": true, } } ``` ```ts 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` **Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior --> https://www.typescriptlang.org/play/index.html?noImplicitAny=false&strictFunctionTypes=false&strictPropertyInitialization=false&strictBindCallApply=false&noImplicitThis=false&noImplicitReturns=false&esModuleInterop=false&ssl=1&ssc=1&pln=8&pc=1#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXwA8BGACgEoAueABRhwFssBnEAHlWXoCMQYA+ANwAoUJFgIU6bHkIAmclVoNmbDt17wAPvA4QIgoUJJQmAT3Txy8ALx94AbyEBIMHiYZ4AbSgAaeFwBdG3goAHcoLA8lRhYAOig9Ek9icj8CeTIAsmEnLERLKHhWeCIyB3gAXyEKsnJhIA **Related Issues:** <!-- Did you find other bugs that looked similar? -->
TypeScript Version: 3.7.2
Search Terms:
generics readonly Promise.all
Code
{ "compilerOptions": { "target": "es2015", "module": "commonjs", "strictNullChecks": true, "esModuleInterop": true, } }Expected behavior:
type of
ashould benumberActual behavior:
type of
aisnumber | nullPlayground Link:
https://www.typescriptlang.org/play/index.html?noImplicitAny=false&strictFunctionTypes=false&strictPropertyInitialization=false&strictBindCallApply=false&noImplicitThis=false&noImplicitReturns=false&esModuleInterop=false&ssl=1&ssc=1&pln=8&pc=1#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXwA8BGACgEoAueABRhwFssBnEAHlWXoCMQYA+ANwAoUJFgIU6bHkIAmclVoNmbDt17wAPvA4QIgoUJJQmAT3Txy8ALx94AbyEBIMHiYZ4AbSgAaeFwBdG3goAHcoLA8lRhYAOig9Ek9icj8CeTIAsmEnLERLKHhWeCIyB3gAXyEKsnJhIA
Related Issues: