title: Why do "Not all code paths return a value" with a switch statement and an enum?
body: <p>I have the following code:        </p>
  
  <pre><code>public int Method(MyEnum myEnum)
  {
      switch (myEnum)
      {
          case MyEnum.Value1: return 1;
          case MyEnum.Value2: return 2;
          case MyEnum.Value3: return 3;
      }
  }
  
  public enum MyEnum
  {
      Value1,
      Value2,
      Value3
  }
  </code></pre>
  
  <p>And I get the error: <code>"Not all code paths return a value"</code>. I do not understand how that <code>switch</code> statement could ever not jump to one of the specified cases.</p>
  
  <p>Can an <code>enum</code> somehow be <code>null</code>?</p>