title: C# Method overloading using dynamic params
body: <p>I'm trying to write a tool for serialization of values. And I was hoping to get some nice syntax working..... </p>
  
  <pre><code>            float f = 9999.0f;
              ByteSerializer s = new ByteSerializer ();
              s.Write(f);
  </code></pre>
  
  <p>Where the params of Write() could be anything and any number:</p>
  
  <pre><code>    public void Write (params dynamic[] objects)
      {
  
          for (int i =0;i&lt;objects.Length;i++) {
  
              byteList.AddRange (GetBytes (objects[i]));
  
          }
      }
  </code></pre>
  
  <p>GetBytes() should now be called according to the type of the object that was passed:</p>
  
  <pre><code>    public  byte[] GetBytes ( object v)
      {
      //Shouldn't actually do anything since it's a dummy
          return new byte[0];
      }
  
  
      public  byte[] GetBytes ( System.Single v)
      {
      //Why is this not called?
  
          return BitConverter.GetBytes (v);
  
      }
  </code></pre>
  
  <p>But it will always go straight for the method that takes an object as parameter. 
  I initially tried (params object[]) as method parameters and found this behaviour to be rather obvious. But why does dynamic[] behave the same?</p>
  
  <p>objects[i].GetType() reports a System.Single so what's going on here? Is what I am trying to do just not possible?</p>