title: When is a type not a type? Error: 'is a type, which is not valid in the given context'
body: <p>Consider the following code, the first call to <code>AcceptType1</code> compiles fine, however the second call of <code>AcceptType1(XYZ);</code> fails. The specific error is:</p>
  
  <blockquote>
    <p>Error CS0119  'XYZ' is a type, which is not valid in the given context</p>
  </blockquote>
  
  <p>I'm not understanding the the specifics behind the error message, and from that I'm failing to understand why the second call fails if <code>XYZ</code> is a type which is exactly what <code>AcceptType1</code> accepts. If <code>XYZ</code> is a type, then why the need to then call <code>typeof</code>?</p>
  
  <pre><code>public class XYZ
  {
  }
  
  public class Tester
  {
  
      public void RunTest()
      {
          AcceptType1(typeof(XYZ));
          AcceptType1(XYZ);
      }
  
      private void AcceptType1(Type t)
      {
          Console.WriteLine(t.ToString());
      }
  
  }
  </code></pre>