title: How can var know of an undefined type?
body: <p>How can the implicit type variable <code>var</code> know a type that is not defined in the scope (using <code>using</code>)?</p>
  
  <p>Example: </p>
  
  <p>This is ok</p>
  
  <pre><code>public class MyClass
  {
      public void MyMethod        
      {
          var list = AStaticClass.GetList();
      }
  }
  </code></pre>
  
  <p>But this is not ok</p>
  
  <pre><code>public class MyClass
  {
      public void MyMethod        
      {
          List&lt;string&gt; list = AStaticClass.GetList();
      }
  }
  </code></pre>
  
  <p>In the last code snippet I have to add <code>using System.Collections.Generic;</code> for it to work.</p>
  
  <p>How does this work? </p>