I was messing around with my C# project a little bit and I was surprised to see this code compiles:

var a = new Action<string>(ref b => b = "hello");

Flipping it the other way around, like Action<string> a = ref b => b = "hello"; will give a syntactical error at 'ref'.

Sure enough, copy-pasting the snippet into http://dotnetfiddle.net gives a compiler error:

A ref or out argument must be an assignable variable

Have I encountered a bug in the compiler? (I'm using VS 2015 and C# 6.)

EDIT: Just switched to the Roslyn compiler on .NET Fiddle, it still emits the same error.