title: With T extending Record<string, any>, keyof T does not give 'string' as type
body: <p>I am trying to achieve the following:</p>
  <pre class="lang-js prettyprint-override"><code>type MyFormProps&lt;FieldName extends keyof FormShape, FormShape extends Record&lt;string, any&gt;&gt; = {
    id: string;
    value: FormShape[FieldName];
  }
  
  const formPropsBuilder = &lt;FieldName extends keyof FormShape, FormShape extends Record&lt;string, any&gt;&gt;(
    name: FieldName,
    form: FormShape,
  ): MyFormProps&lt;FieldName, FormShape&gt; =&gt; {
    return {
      id: name,
      value: form[name],
    }
  }
  </code></pre>
  <p>But I get an error saying that name is of type <code>string | number | symbol</code>.</p>
  <p>It's weird since FormShape does extend <code>Record&lt;string, any&gt;</code>, so its keys need to be strings.</p>
  <p>Is it normal?
  If so, is there any way to make it work?</p>
  <p>Thanks ;)</p>
  <p>Link to the playground:
  <a href="https://www.typescriptlang.org/play?#code/C4TwDgpgBAsiBiB7ATgWwArMWAzgHngEsIAbAEwDkBDVaCAD2AgDsycoBrCERAMyiRoAygAsqkADQCUqUeLqMWbKACUIAYxRk8OYMkLMA5lKrMQAPnNQAvFADeAKChRCZAFxRd+owG4nUADcqEgBXCA9BWTFIAG0iUkoaCABdPwBfBwdNZl0oXhlMbBwAIRDCcghkGygCYnJqWigGJlZ2Lh5+SLlJaWFohRblNU1kbS8DYyhTC3MACn9mJIi6xNoJf3y0CJluiHWASg84SMLcWoSGvd6o+StrK0dnZAhgEORme39nVw9Fta-AsEwh5NqgYn8UutnBk0kA" rel="nofollow noreferrer">https://www.typescriptlang.org/play?#code/C4TwDgpgBAsiBiB7ATgWwArMWAzgHngEsIAbAEwDkBDVaCAD2AgDsycoBrCERAMyiRoAygAsqkADQCUqUeLqMWbKACUIAYxRk8OYMkLMA5lKrMQAPnNQAvFADeAKChRCZAFxRd+owG4nUADcqEgBXCA9BWTFIAG0iUkoaCABdPwBfBwdNZl0oXhlMbBwAIRDCcghkGygCYnJqWigGJlZ2Lh5+SLlJaWFohRblNU1kbS8DYyhTC3MACn9mJIi6xNoJf3y0CJluiHWASg84SMLcWoSGvd6o+StrK0dnZAhgEORme39nVw9Fta-AsEwh5NqgYn8UutnBk0kA</a></p>