title: Querying generic types for a method using Sourcery
body: <p>Using Sourcery, for a <code>TypeName</code>, you can query whether or not the type isGeneric, using the <code>isGeneric</code> property, and you can also look at the <code>generic</code> property to get the <code>generic.typeParameters</code> array. <a href="https://merowing.info/Sourcery/Classes/TypeName.html" rel="nofollow noreferrer">See TypeName documentation</a></p>
  <p>However, I can't figure out how to do the same thing for a method. I have a method like:</p>
  <pre><code>func doSomething&lt;T: MyType&gt;(input: T) -&gt; T
  </code></pre>
  <p>And when I am generating a stub class, I need to know that the return type, <code>T</code>, represents a generic type. I can query <code>isGeneric</code> on the <code>Method</code> (correctly returns <code>true</code>), but there is no <code>generic</code> property with which to identify <code>T</code>, so it doesn't really help me that I know that the method is generic - because that doesn't necessarily mean that the return type is generic. <a href="https://merowing.info/Sourcery/Classes/Method.html" rel="nofollow noreferrer">See Method documentation</a></p>
  <p>Also, querying the <code>isGeneric</code> property of the <code>returnTypeName</code> of the method returns <code>false</code>, so this approach doesn't work either.</p>