title: How to use Flow with async/await, promises and thenables?
body: <p>Flow can do clever stuff like <a href="https://flow.org/try/#0C4TwDgpgBAsiMEMxQLxQOoQQa0WAPAHYCuAtgEYQBOANFAM7BUCWhA5gHwBQXAxgPaFGUfuQBWALljwkqKIQgB3DFlxIAFAEoA3D1FiAdPQjB1ARgBMAZjoBycgiq2dUAPSuR2PeKMn1twn5gWzsHJxd3KAAzABt+ZWoqfioAQi4gA" rel="nofollow noreferrer">this</a>:</p>
  
  <pre><code>type MyMap = WeakMap&lt;number, string&gt;;
  const obj: MyMap = new WeakMap();
  obj.set(123, 'bar'); // ok
  obj.set('not', 'bar'); // flow error!
  </code></pre>
  
  <p>But what about promises, thenables, and async/await?</p>
  
  <p>I was hoping it might be possible to do this kind of thing:</p>
  
  <pre><code>type AsyncMultiplier = (number) =&gt; Thenable&lt;number&gt;;
  
  const myTransform: AsyncMultiplier = async input =&gt; input * 2;
  
  (async () =&gt; {
    (await myTransform(2)) * 5; // should be ok
  
    // forgetting to await the result:
    myTransform(2) * 5; // should give a type error
  })();
  </code></pre>
  
  <p>Is there some way to get Flow to understand the semantics of <code>await</code>, thenables, etc?</p>