title: Cannot return object literal because null or undefined - Flow
body: <p>Mixing the mayBe types with Optional props of an object literal</p>
  
  <pre><code> type Response = {
          data?: string;
      }
  
   function length(): ?string {
        return undefined;
   }
  
   function test(): Response {
      const data = length()
      return {
          data
      }
   }
  
  12:         data        ^ Cannot return object literal because null or undefined [1] is incompatible with string [2] in property `data`.
  References:
  5: function length(): ?string {
                        ^ [1]
  2:     data?: string;
                ^ [2]
  
  </code></pre>
  
  <p><a href="https://flow.org/try/#0C4TwDgpgBAShDOYD2A7e0C8UDeAoKBUAJgIbAkD8AXFPMAE4CWKA5gNy4C+uuAZgK4oAxsEaooAGwitgACwAUAShoU6TVjnxR6EYP3ooogohF7MIRDtz6CRYw8ATAlNOIlTpNASCEfgxMhIoLCkZBUVcLx09A00CLy9SckjuTiA" rel="nofollow noreferrer">Test Flow</a></p>
  
  <p>Following the flow documentation for <a href="https://flow.org/en/docs/types/maybe/" rel="nofollow noreferrer">MayBe types</a> and <a href="https://flow.org/en/docs/types/objects/" rel="nofollow noreferrer">Object Types</a>
  I am not sure why I get the error, is there a way to fix this ?</p>