title: Translating between properties
body: <p>If I have an object, and I want to take 'rename' certain properties of that object, I might create some generic function which allows me to define types of such translation:</p>
  
  <pre class="lang-js prettyprint-override"><code>export const fromTo = &lt;T, U&gt;(fromToPairs: { from: keyof T, to: keyof U }[]) =&gt;
      (o: T): Partial&lt;U&gt; =&gt; fromToPairs
          .reduce(
              (p, c) =&gt; ({
                  ...p,
                  [c.to]: o[c.from],
              }),
              {},
          );
  </code></pre>
  
  <p>What I'd like to be able to do is find a way of defining this such that it doesn't return a <code>Partial&lt;U&gt;</code>, but rather just <code>U</code>, by that I mean I'd like to return a complete type. When I try this I get the following error:</p>
  
  <blockquote>
    <p>Type '{}' is not assignable to type 'U'.
      '{}' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.ts(2322)</p>
  </blockquote>
  
  <p>Is there a way to do this?</p>