title: GetILGenerator method is not supported by MethodBuilder
body: <p>I am trying to generate generic method via <code>Reflection</code> API. Here is function which I want to create:</p>
  
  <pre><code>public List&lt;T&gt; CreateList&lt;T&gt;()
  {
      return new List&lt;T&gt;();
  }
  </code></pre>
  
  <p>Here is program, which should create assembly with <code>DemoType</code> class, which will contain mentioned <code>CreateList</code> method, generated dynamically:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Reflection;
  using System.Reflection.Emit;
  
  class GenericMethodBuilder
  {
      public static void Main()
      {
          var asmName = new AssemblyName("DemoMethodBuilder1");
          var demoAssembly = AppDomain.CurrentDomain.DefineDynamicAssembly(asmName, AssemblyBuilderAccess.RunAndSave);
  
          var demoModule = demoAssembly.DefineDynamicModule(asmName.Name, asmName.Name + ".dll");
          var demoType = demoModule.DefineType("DemoType", TypeAttributes.Public);
  
          var create_list_method = demoType.DefineMethod("CreateList", MethodAttributes.Public | MethodAttributes.Static);
  
          var TInput = create_list_method.DefineGenericParameters(new string[] { "TInput" })[0];
          var t_list_type = typeof(List&lt;&gt;).MakeGenericType(TInput);
  
          create_list_method.SetParameters(Type.EmptyTypes);
          create_list_method.SetReturnType(t_list_type);
  
          var ilgen = create_list_method.GetILGenerator();
  
          ilgen.Emit(OpCodes.Newobj, t_list_type.GetConstructors()[0]);
          ilgen.Emit(OpCodes.Ret);
  
          Type dt = demoType.CreateType();
          demoAssembly.Save(asmName.Name + ".dll");
      }
  }
  </code></pre>
  
  <p>But during execution <code>create_list_method.GetILGenerator()</code> I receive <code>NotSupportedException</code> at with message:</p>
  
  <blockquote>
    <p>Additional information: Specified method is not supported.</p>
  </blockquote>
  
  <p>What's wrong with this method? I checked out docs, and it seems like ok.</p>