title: Get Generic arguments type of anonymous type in Roslyn assembly
body: <p>Suppose that you have the next code:</p>
  
  <pre><code>        var house = new {Color = "White", Area = 150};
          var typeHouse = house.GetType();
          var argumentTypes = typeHouse.GetGenericArguments();
  </code></pre>
  
  <p>The <em>argumentTypes</em> array have two types : string and int... It's ok :)</p>
  
  <p>But if I have the next code using Roslyn compiler:</p>
  
  <pre><code>            var tree = SyntaxTree.ParseText(@"
              namespace TestRoslyn {
                  public class MyClass {
                      public void GetHouse(){
                          var house = new {Color = 'W', Area = 150};
                      }
                  }
              }");
  
          byte[] assembly;
          var compiler = Compilation.Create("Test", new CompilationOptions(outputKind: OutputKind.DynamicallyLinkedLibrary,
                                                                   usings: new[] { "System" }))
              .AddSyntaxTrees(tree)
              .AddReferences(new MetadataFileReference(typeof(object).Assembly.Location));
  
          using (var stream = new MemoryStream())
          {
              var result = compiler.Emit(stream);
              if (!result.Success)
                  throw new Exception("You have an error! :( ");
              assembly = stream.ToArray();
          }
          Type[] types = Assembly.Load(assembly).GetTypes();
          var argumentTypes = types[0].GetGenericArguments(); //types [0] returns the &lt;&gt;f__AnonymousType 
  </code></pre>
  
  <p>Then the <em>argumentTypes</em> array shows two generic types like "Color j_<em>TPar" and "Area j</em>_TPar"... :( </p>
  
  <p>My questions is: Why in the Roslyn example I can't get the correct argument types from Anonymous type? </p>
  
  <p>How to get the "correct" argument types?</p>