title: `out` variable unassigned... unless the condition is inline?
body: <p>I'm trying to understand what the C# compiler's rules are for deciding when an <code>out</code> variable was assigned. </p>
  
  <p>Here's one example that baffles me. Let's assume we have a <code>Dictionary&lt;&gt;</code>:</p>
  
  <pre><code>var dict = new Dictionary&lt;string, string&gt;();
  </code></pre>
  
  <p>Let's start with a simple condition: this compiles.</p>
  
  <pre><code>var found = dict.TryGetValue("b", out var val);
  if(found)
  {
      Console.WriteLine(val); //no problem
  }
  </code></pre>
  
  <p>If the condition is slightly more complicated, it's a compile error:</p>
  
  <pre><code>var aBool = true;
  var found = aBool &amp;&amp; dict.TryGetValue("b", out var val);
  if(found)
  {
      Console.WriteLine(val); //use of unassigned local variable val
  }
  </code></pre>
  
  <p>OK, so I guess the compiler doesn't deal with logical operators in this case.<br>
  ...but if we move the <em>exact same condition inline</em>, it's all rainbows again:</p>
  
  <pre><code>var aBool = true;
  if(aBool &amp;&amp; dict.TryGetValue("b", out var val))
  {
      Console.WriteLine(val); //compiles fine
  }
  </code></pre>
  
  <p>Why? </p>