title: Why do I get this error creating & returning a new struct?
body: <p>I get an error when I compile this code:</p>
  
  <pre><code>using System;
  
  public struct Vector2
  {
      public event EventHandler trigger;
  
      public float X;
      public float Y;
  
      public Vector2 func()
      {
          Vector2 vector;
          vector.X = 1;
          vector.Y = 2;
          return vector;  // error CS0165: Use of unassigned local variable 'vector'
      }
  }
  </code></pre>
  
  <p>hi!</p>
  
  <p>The compiler says: "Use of unassigned local variable 'vector'" and points to the return value. It looks to me that Vector2 become a reference type (without the event member it acts normally). What is happening?</p>