title: FlowJS: types inheritance
body: <p>I'm testing FlowJS for my project, and I have an issue with <a href="https://flowtype.org/docs/syntax.html#type-aliases" rel="nofollow noreferrer">Type Aliases</a>.</p>
  
  <p>I build a web SDK for an API: I have an <code>Helper</code> class with this method:</p>
  
  <pre><code>class Helper {
      find(filters:PaginationOptions = {}) {
          // ...
      }
  }
  </code></pre>
  
  <p><code>PaginationOptions</code> is a basic FlowJS type:</p>
  
  <pre><code>type PaginationOptions = {
    start?:string,
    end?:number,
  };
  </code></pre>
  
  <p>I also have an helper for Users, inheriting from <code>Helper</code>:</p>
  
  <pre><code>class UsersHelper extends Helper {
      find(filters:UsersFilterOptions = {}) {
          // ...
      }
  }
  </code></pre>
  
  <p><code>UsersFilterOptions</code> is a FlowJS type "extending" <code>PaginationOptions</code>:</p>
  
  <pre><code>type UsersFilterOptions = {
    username?:string,
    city?:string,
  } &amp; PaginationOptions;
  </code></pre>
  
  <p>I use here an <a href="https://flowtype.org/docs/union-intersection-types.html" rel="nofollow noreferrer">Intersection</a> so that my users filters should also accept <code>start</code> and <code>end</code> properties.</p>
  
  <p>It seems that my IDE (PHPStorm) does not like my <code>find()</code> method from my class <code>UsersHelper</code>, it keeps telling me that:</p>
  
  <blockquote>
    <p>Incompatible override, should have type 'PaginationOptions'</p>
  </blockquote>
  
  <p>Well... I know, that's why <code>UsersFilterOptions</code> has an intersection with <code>PaginationOptions</code>.</p>
  
  <p>But FlowJS also shows me two others warnings:</p>
  
  <blockquote>
    <p>Flow: property <code>username</code>. Property not found in object literal<br>
    Flow: property <code>city</code>. Property not found in object literal</p>
  </blockquote>
  
  <p>I don't understand why I have these errors : these properties are defined as optional...</p>
  
  <p>Do you have any suggestions for fixing these three errors?</p>
  
  <p>Thanks in advance!</p>