title: How to fix Type 'string' is not assignable to type 'T[keyof T]'
body: <p>Given the following Typescript function:</p>
  <pre class="lang-js prettyprint-override"><code>const setter = &lt;T = Record&lt;string, string&gt;&gt;(obj: T, prop: keyof T, val: string): void =&gt; {
      obj[prop] = val;
  };
  </code></pre>
  <p>I get the following error from my IDE:</p>
  <pre><code>Type 'string' is not assignable to type 'T[keyof T]'
  </code></pre>
  <p>If T is a Record of string keys and string values and <code>prop</code> is a key of T, then I originally assumed that I could assign a string to <code>T[keyof T]</code>.</p>
  <p>What is the proper use of generics to fix this error?</p>