title: Getting the name of a type of generic property of class definition using Roslyn
body: <p>I have a class defined as below:</p>
  
  <pre><code>class Derived
  {
      public int t { get; set; }
      public List&lt;Child&gt; Childs { get; set; }
  }
  </code></pre>
  
  <p>I want to get the <code>System.Type</code> for every property of the class. This is what I have currently:</p>
  
  <pre><code>var properties = node.DescendantNodes().OfType&lt;PropertyDeclarationSyntax&gt;();
  
  var symbolDisplayFormat = new SymbolDisplayFormat(
      typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces
  );
  
  foreach (var property in properties) 
  {
      var typeSymbol = context.SemanticModel.GetSymbolInfo(property.Type).Symbol as INamedTypeSymbol;
      string name = typeSymbol.ToDisplayString(symbolDisplayFormat);
  }
  </code></pre>
  
  <p>Where node is a <code>ClassDeclarationSyntax</code>. </p>
  
  <p>This code works fine for the property <code>t</code>; the name of the type of the property is returned <code>System.Int32</code>. However, for the property <code>Childs</code> (it's a type with a generic argument) I get a null <code>typeSymbol</code>, which is not the <code>System.Type</code> for this property that's expected. </p>
  
  <p>How can I get the type of property of a generic type from a class definition using Roslyn?</p>