title: Why do structs need to be boxed?
body: <p>In C#, any user-defined <code>struct</code> is automatically a subclass of <strike>System.Struct</strike> <code>System.ValueType</code> and <strike>System.Struct</strike> <code>System.ValueType</code> is a subclass of <code>System.Object</code>.</p>
  
  <p>But when we assign some struct to object-type reference it gets boxed. For example:</p>
  
  <pre><code>struct A
  {
      public int i;
  }
  
  A a;
  object obj = a;  // boxing takes place here
  </code></pre>
  
  <p>So my question is: if <code>A</code> is an descendant of <code>System.Object</code>, can't the compiler up-cast it to object type instead of boxing?</p>