I entered this code into the codepad:
It told me it expected a semi-colon. This gave same error:
This, however, was fine:
I think it's to do with the types. If I cast the null in the first case, it works:
But I don't immediately see why the assignment should work without error, and yet the expression fails. Is it because we count a type warning in the first case as a reason to fail the compile, but in the assignment it gets ignored because we're confident it's a statement?