title: Compiler complains about unassigned variable after switch on enum
body: <p>I have the following enumerator:</p>
  
  <pre><code>enum Foo { Bar, Baz };
  </code></pre>
  
  <p>In the following code, the compiler aborts with the error:</p>
  
  <pre>use of unassigned local variable 'str'</pre>
  
  <p>The code:</p>
  
  <pre><code>string str;
  Foo foo = Foo.Bar;
  
  switch (foo)
  {
      case Foo.Bar: str = "a"; break;
      case Foo.Baz: str = "b"; break;
  }
  
  str.ToLower();
  </code></pre>
  
  <p>The <code>switch</code> covers all the possible values of the enumerator. But the compiler still thinks that <code>str</code> might be unassigned. Why is that? Of course I could put a <code>default</code> case in there, but that would be wrong, since errors are not caught at compile-time. For example, if the <code>Foo</code> enum is modified later on and a new value added, <em>then</em> it would be nice to get a compiler error. If I use a <code>default</code> case, then the error is not caught when recompiling.</p>
  
  <p>I suppose there is no way to get the compiler to accept a <code>switch</code> without a <code>default</code> case <em>and</em> raise an error if <code>Foo</code> is extended later on?</p>