Flow type for optional field in an object
<p>In the following code (<a href="https://flow.org/try/#0C4TwDgpgBAShDOYD2A7e0C8UDeAoKBUEATsQFxQD88wxAligOYDc+hAJgIbCcUDyAIwBWEAMbBWAX1wAzAK4pxdVFAA2EJsAAWACgAeASgpxEqdDjbEIwOcRQ4oXHlArZJUSVNy51m3QEYABgMgA" rel="noreferrer">Try Flow</a>):</p>

<pre><code>type Response = {
    err: ?string;
    data: Object;
}
function length(x): Response {
  return { data : {} };
}

length(10)
</code></pre>

<p>I made <code>err</code> optional, but still get an error:</p>

<blockquote>
  <p>Property <code>err</code> not found in object literal</p>
</blockquote>