title: Missing Errors when reading key paths with nesting from interface with general key definition
body: <p>Using TypeScript 4.5 and the following code, I need to find the paths of the properties of the <code>Detail</code> interface.</p>
  <pre class="lang-js prettyprint-override"><code>export interface Base {
    [key: string]: boolean | Base;
  }
  
  interface Detail extends Base {
    propertyA: boolean,
    propertyB: boolean,
    moduleC: {
      propertyD: boolean,
      propertyE: boolean,
    }
  }
  </code></pre>
  <p>I need to get a type with <code>'propertyA' | 'propertyB' | 'moduleC.propertyD' | 'moduleC.propertyE'</code>.</p>
  <p>Generally, there are solutions already existent, for instance here: <a href="https://stackoverflow.com/questions/58434389/typescript-deep-keyof-of-a-nested-object">Typescript: deep keyof of a nested object</a></p>
  <p><strong>But</strong>: given that <code>type Path&lt;T&gt; = ...</code> gives me the paths of all keys of type T and writing <code>const bad: Path&lt;Detail&gt; = 'propertyXY'</code> I want TypeScript to warn me about the wrong path.</p>
  <p>Available solutions find the paths and allow for things like syntax completion. However, all the solutions fail with the <code>[key: string]: boolean | Base</code> part in warning about wrong paths and so far I was unable find out why or how to fix this. Example (based on the aforementioned link):</p>
  <pre class="lang-js prettyprint-override"><code>type Join&lt;K, P&gt; = K extends string | number ?
    P extends string | number ?
      `${K}${&quot;&quot; extends P ? &quot;&quot; : &quot;.&quot;}${P}`
      : never : never;
  
  type Path&lt;T, D extends number = 10&gt; = [D] extends [never] ? never : T extends Base ?
    { [K in keyof T]-?: Join&lt;K, Path&lt;T[K], Prev[D]&gt;&gt; }[keyof T] : &quot;&quot;;
  
  type Prev = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
    11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ...0[]]
  
  const bad: Path&lt;Detail&gt; = 'moduleC.propertyXY' // there should be a warning here because propertyXY doesn't exist but there isn't
  </code></pre>
  <p>What is an implementation for <code>Path</code> that allows TypeScript to find wrong (in <code>Detail</code> not existing) paths?</p>