title: Why does the following code compile without errors?
body: <p>I was messing around with my C# project a little bit and I was surprised to see this code compiles:</p>
  
  <pre><code>var a = new Action&lt;string&gt;(ref b =&gt; b = "hello");
  </code></pre>
  
  <p>Flipping it the other way around, like <code>Action&lt;string&gt; a = ref b =&gt; b = "hello";</code> will give a syntactical error at 'ref'.</p>
  
  <p>Sure enough, copy-pasting the snippet into <a href="http://dotnetfiddle.net" rel="nofollow">http://dotnetfiddle.net</a> gives a compiler error:</p>
  
  <pre><code>A ref or out argument must be an assignable variable
  </code></pre>
  
  <p>Have I encountered a bug in the compiler? (I'm using VS 2015 and C# 6.)</p>
  
  <hr>
  
  <p><strong>EDIT:</strong> Just switched to the Roslyn compiler on .NET Fiddle, it still emits the same error.</p>