title: Unexpected compile time error with dynamic
body: <blockquote>
    <p>Clarification of question: <strong>I am not looking for answers on how to solve this issue (several are listed below), but as to <em>why</em> it is happening.</strong></p>
  </blockquote>
  
  <p>I expect the following code to compile:</p>
  
  <pre><code>struct Alice
  {
      public string Alpha;
      public string Beta;
  }
  
  struct Bob
  {
      public long Gamma;
  }
  
  static object Foo(dynamic alice)
  {
      decimal alpha;
      long beta;
  
      if (!decimal.TryParse(alice.Alpha, out alpha) // *
          || !long.TryParse(alice.Beta, out beta)) // **
      {
          return alice;
      }
  
      var bob = new Bob { Gamma = beta }; // ***
  
      // do some stuff with alice and bob
  
      return alice;
  }
  </code></pre>
  
  <p>However the following compile time error is thrown at <code>// ***</code>:</p>
  
  <blockquote>
    <p>Use of unassigned local variable 'beta'</p>
  </blockquote>
  
  <p>I can make the program compile under the following situations:</p>
  
  <ol>
  <li><p>If I change the signature to be </p>
  
  <p><code>static object Foo(Alice alice)</code></p></li>
  <li><p>Explicitly casting on the lines <code>// *</code> and <code>// **</code>, e.g.:</p>
  
  <p><code>!long.TryParse((string)alice.Beta, out beta)</code>.</p></li>
  <li><p>Removing the <code>decimal.TryParse</code> on line <code>// *</code>.</p></li>
  <li><p>Replacing the short circuit or <code>||</code> with <code>|</code>. <sub><sup>Thanks to HansPassant</sup></sub></p></li>
  <li><p>Swapping the <code>TryParse</code>s around</p></li>
  <li><p>Pulling the results of the <code>TryParse</code>s into <code>bool</code>s <sub><sup>Thanks to Chris</sup></sub></p></li>
  <li><p>Assigning a default value to <code>beta</code></p></li>
  </ol>
  
  <p>Am I missing something obvious, or is there something subtle going on, or is this a bug?</p>