title: Is CS0165 C# compiler error guaranteed for unassigned local variables?
body: <p>In code like this:</p>
  
  <pre><code>int val;
  
  if (something())
     val = 10;
  
  val++; // Error CS0165 Use of unassigned local variable
  </code></pre>
  
  <p>I get <code>CS0165</code> error message when a local variable is used when there's a chance it was not surely initialized before.</p>
  
  <p>In C++ world this scenario is <em>undefined behavior</em> class situation, which means that anything is allowed. So maybe there's a compiler error, maybe there's a compiler warning, maybe there's a runtime error, maybe code just uses whatever was in memory at that moment and good luck noticing it.</p>
  
  <p>Is <code>CS0165</code> guaranteed for such code in C#? </p>
  
  <p>Is there a case where this specific piece of code does not yield an error message?</p>