/* @flow */ async function testAll() { /* This is a test case from https://github.com/facebook/flow/issues/1143 * which was previously an error due to Array's invariance and an improper * definition of Promise.all */ const x: Array> = []; const y: Promise> = Promise.all(x); const z: Array = await y; } async function testRace() { const x: Array> = []; const y: Promise = Promise.race(x); const z: ?string = await y; }