title: C# CallerMemberName not working with dynamic in args?
body: <p>I have a method that accepts a <code>dynamic</code> argument, and also has <code>[CallerMemberName]</code> on a different argument. The <code>[CallerMemberName]</code> argument doesn't get populated as long as the dynamic object is also in the arguments.</p>
  
  <p>Is this a bug in the <code>CallerMemberName</code> or in C# itself? See below for a test </p>
  
  <pre><code>    static void Main(string[] args)
      {
          new CMNTest().BaseMethod();
      }
  
      public void BaseMethod()
      {
          NormalMethod();
          dynamic myDyn = new Object();
          DynamicArgumentMethod(myDyn);
          ObjectArgumentMethod(new object());
          ObjectArgumentMethod((object)myDyn);
      }
  
      public void NormalMethod([CallerMemberName]string methodName = null)
      {
          Console.WriteLine(methodName);
      }
  
      public void DynamicArgumentMethod(dynamic dynObject, [CallerMemberName]string methodName = null)
      {
          Console.WriteLine(methodName);
      }
  
      public void ObjectArgumentMethod(object otherArg, [CallerMemberName]string methodName = null)
      {
          Console.WriteLine(methodName);
      }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>BaseMethod
  &lt;null&gt;
  BaseMethod
  BaseMethod
  </code></pre>
  
  <p>Tested in Visual Studio and LinqPad, same results. Any way around this? I need to do <code>dynamic</code> things with the object, so casting into an <code>object</code> won't work.</p>