title: Incompatible return type [7]: Expected `Variable[T]` but got `Variable[R]`.Pyre
body: <p>Pyre type fails because it assumes an incorrect return type R when we are returning T.
  It happens when we use a derived class in another class and access a field that is generic typed from the parent class.</p>
  <p>Following is the toy code for which it is complaining at the last line.</p>
  <pre><code>T = TypeVar(&quot;T&quot;)
  R = TypeVar(&quot;R&quot;)
  
  @dataclass(frozen=True)
  class A(Generic[T, R]):
      t: T
      r: R
  
  class B(A[T, R]):
      ...
  
  @dataclass(frozen=True)
  class X(Generic[T, R]):
      a: A[T, R]
      b: B[T, R]
  
      def getfromA(self) -&gt; T:
          return self.a.t
  
      def getfromB(self) -&gt; T:
          # pyre-fixe[7] Incompatible return type [7]: Expected `Variable[T]` but got `Variable[R]`.Pyre
          return self.b.t
  
  </code></pre>
  <p>Notice that it works correctly when using A, the base class with generic.
  But when using with B, the derived class, it inverts the types.</p>
  <p>Am I missing something or am I hitting some known pyre bug?</p>
  <p>Thanks</p>