title: Dynamic binding vs type inference
body: <p>In <a href="https://rads.stackoverflow.com/amzn/click/com/0321741765" rel="nofollow noreferrer" rel="nofollow noreferrer">The C# Programming language</a> Bill Wagner says:</p>
  
  <blockquote>
    <p>Many people confuse dynamic binding with type inference.  Type
    inference is statically bound.  The compiler determines the type at
    compile time.  For example:</p>
  
  <pre><code>var i = 5;             //i is an int (Compiler performs type inference)
  Console.WriteLine(i);  //Static binding to Console.WriteLine(int)
  </code></pre>
    
    <p>The compiler infers that i is an integer.  All binding on the variable
    i uses static binding.</p>
  </blockquote>
  
  <p>Now, given this information and my own made-up dynamic scenerio:</p>
  
  <pre><code>        dynamic i = 5;       //Compiler punts
          Console.WriteLine(i);//This is now dynamically bound
  </code></pre>
  
  <p>We know type inference is statically bound. This implies that there is no way a dynamic variable can use type inference to determine a type.  How does a dynamic type get resolved without using type inference?</p>
  
  <p><strong>Update</strong> <br />
  To try and clarify...at runtime we must somehow figure out what type i is right?  Because I assign a literal <code>5</code> then the runtime can infer that <code>i</code> is an <code>int</code>.  Isn't that type inference rather than dynamic binding?</p>