title: Flowtype error when trying to get object value via dynamic key
body: <p>I have a code that receives an object, iterates its keys and performs different actions based on particular key presence in another config object.</p>
  
  <p>Here's an abstract example:</p>
  
  <pre><code>type InputObject = {
    foo: number,
    bar: number,
    baz: number,
  };
  
  const multipliers = {
    bar: 3,
  };
  
  function processData(data: InputObject) {
    Object.keys(data).forEach(key =&gt; {
      const value = data[key];
  
      if (Object.keys(multipliers).indexOf(key) !== -1) {
        console.log(value * multipliers[key]);
      } else {
        console.log(value);
      }
    });
  }
  </code></pre>
  
  <p>If I check this code with <code>flow check</code> command it gives the following errors:</p>
  
  <blockquote>
    <p>Cannot get multipliers[key] because:<br>
    • property baz is missing in object literal [1].<br>
    • property foo is missing in object literal [1].</p>
  </blockquote>
  
  <p>Why Flow doesn't understand that <code>multipliers[key]</code> is executed only if <code>key</code> exists in <code>multipliers</code>?
  Is there any way to fix the errors by changing type annotations without changing the code?</p>