title: Make field type override object generic's type
body: <p>Basically what I want to happen is that the type of T(generic) be the listener's(listener field) type, that way no metter if listener is either the default value or a custom one, I'd have auto completion for &quot;firstParatemer&quot;, is that possible? If not, is there any other way around other than setting everything to any?</p>
  <p>Right now I can only have one type at once, either dummy or upper, not both.</p>
  <p>Code:</p>
  <pre><code>const upper = ({ helloWorld }: { helloWorld: string }) =&gt;
      helloWorld.toUpperCase();
  
  const dummy = ({ worldHello }: { worldHello: string }) =&gt; worldHello;
  
  type objType&lt;T extends (...args: any[]) =&gt; any = typeof upper&gt; = {
      listener?: T;
      firstParameter: Parameters&lt;T&gt;[0];
  };
  
  const obj: objType = {
      listener: upper,
      firstParameter: {
          helloWorld: &quot;hello world&quot;, // auto completion
      },
  };
  
  let arr: objType[] = [
      obj,
      { listener: dummy, firstParameter: { worldHello: &quot;world hello&quot; } },
  ]; // what I want
  
  let dummyObj: objType = {
      listener: dummy,
      firstParameter: {
          // i want auto completion here without having to specify the type with objType&lt;typeof dummy&gt;
      }
  }
  </code></pre>
  <p><a href="https://www.typescriptlang.org/play?#code/MYewdgzgLgBArgBwQUwE4wLwwBQG8YAWyANsSAOoirEAmMAvgFwz5GkVW3PSoCWYAcwYBKTAD4AUDGmESZStRoA6KCACqSNAGEAhhGTZhAbgkTQkWDTgBbawE9MOfAHdONABJyQDZi7ef2big+QRFxGFdFALITCSg7FBgQACMAKwAVBOQAHnSYZAAPKGQwGggcJUqdVAEIZh0wOwBtAF1RDDEYBocseJQQADN4TVROrFwpGWJeaBK0AH5mdJMZGAHeVGgABWqda2Ri1GYd1D2DtAhcsSaABhaTeljzaCS05hSMrMcJ1enZsDQzEQKFQABpJtJ1psoCczodfBDVrJ2AouDAAERsMgRNzo0EwAD0BK6cFUMFA1gQxAOvHAiPo4MepmpsGqR1enxQrUcTURH3Bq3wf2KAPZVlsdnxUO2u328JYOKiXmY6MitGRZHRDAY4PuhOJzgIOlgAEkIg0oMyDjBxfYAPJvDmZRLjRHCuZimz2AUyaUw2Xndk-JHSIkwXjmsCs0neClUmngWSoZARXhQAggUmEHQAN34QjJEBQwF4Awc6ZTfRTzjTBCdWWyVcGNq9dkkq3oEnoQA" rel="nofollow noreferrer">Playground Link</a></p>