title: Flow equivalent to Java Wildcard?
body: <p>Is there an equivalent to <a href="https://docs.oracle.com/javase/tutorial/java/generics/subtyping.html" rel="nofollow noreferrer">Java's Wildcards</a> in Flow?</p>
  
  <p>Here's my example code I've been working on as a test:</p>
  
  <pre><code>
  type InterfaceType = {
      var1 : number,
  };
  
  type ActualType = InterfaceType &amp; {
      var2 : string,
  };
  
  type InterfaceGenericType&lt;T : InterfaceType&gt; = {
      var3 : T,
  }
  
  type ActualGenericType = InterfaceGenericType&lt;ActualType&gt; &amp; {
  
  }
  
  
  class State&lt;T : InterfaceGenericType&lt;InterfaceType&gt;&gt; {
  
      prop : T;
  
      constructor(arg : T) : State&lt;T&gt; {
          this.prop = arg;
          return this;
      }
  }
  
  
  let actual : ActualType = {
      var1: 1,
      var2: "two",
  };
  
  let actualGeneric : ActualGenericType = {
      var3 : actual,
  }
  
  let s2 = new State(actualGeneric);
  </code></pre>
  
  <p>This is the flow error I'm getting:</p>
  
  <pre><code>    40: let s2 = new State(actualGeneric);
                             ^ Cannot call `State` with `actualGeneric` bound to `arg` because property `var2` is missing in `InterfaceType` [1] but exists in object type [2] in property `var3`.
          References:
          20: class State&lt;T : InterfaceGenericType&lt;InterfaceType&gt;&gt; {
                                                   ^ [1]
          7: type ActualType = InterfaceType &amp; {
                                               ^ [2]
  </code></pre>
  
  <p>I know I can get around the issue by doing:
  <code>class State&lt;I : InterfaceType, T : InterfaceGenericType&lt;I&gt;&gt; {</code>
  but I'm trying to not have to declare both types.</p>