title: Generics used in struct vs class
body: <p>Assume that we have the following <code>struct</code> definition that uses generics:</p>
  
  <pre><code>public struct Foo&lt;T&gt;
  {
      public T First; 
      public T Second;
  
      public Foo(T first)
      {
          this.First = first;
      }
  
  }
  </code></pre>
  
  <p>The compiler says </p>
  
  <blockquote>
    <p>'Foo.Second' must be fully assigned before control is returned to the caller</p>
  </blockquote>
  
  <p>However, if <code>Foo</code> is a class, then it compiles successfully.</p>
  
  <pre><code>public class Foo&lt;T&gt;
  {
      public T First; 
      public T Second;
  
      public Foo(T first)
      {
          this.First = first;
      }
  
  }
  </code></pre>
  
  <p>Why? Why the compiler treats them differently? Moreover if no constructor is defined in the first <code>Foo</code> then it compiles. Why this behaviour?</p>