title: TS Compiler API: how can I get the resolved type of an argument to a function?
body: <p>I'm working with the TS Compiler API and I would like to be able to resolve the type of the first argument in a function.</p>
  <p>I was able to this for a top level call, i.e., wherein the type provided is not itself determined by a type argument ...</p>
  <pre class="lang-js prettyprint-override"><code>interface Abc {
     a : number;
     b : boolean;
     c : number;
  }
  
  const thing : Abc = {
     a : 1;
     b : true;
     c : 3;
  }
  
  getTypeOfArg(thing); // works, get's Abc type
  </code></pre>
  <p>However, I'm having a bit harder time traversing up through nestings, e.g.,...</p>
  <pre class="lang-js prettyprint-override"><code>
  const doThingWithTypeOf = &lt;T extends any&gt;(anObject : T) =&gt;{
      
     // depending on which strategy I ask my getTypeOfArg to use
     // this either gets any or T,
     // and in neither case gets the resolved ts.Type
     const typeOfAnObject = getTypeFromArg(anObject); // does not work, at least not in the intended way
  
  };
  
  </code></pre>
  <p>Any thoughts on how I could move up the through the hierarchy to find the actual type of the symbol?</p>