Compiler not evaluating elvis operator ?. correctly

I've noticed what appears to be a compiler bug. The following code uses Newtonsoft.Json to parse JSON.

var deserialized = JObject.Parse("{ \"a\": \"b\", \"c\": \"d\", \"e\": \"f\" }");

var oldTest = new

    {
        A = deserialized["a"] != null ? deserialized["a"].Value<string>() : null,
        B = deserialized["b"] != null ? deserialized["b"].Value<string>() : null,
        C = deserialized["c"] != null ? deserialized["c"].Value<string>() : null,
        D = deserialized["d"] != null ? deserialized["d"].Value<string>() : null,
        E = deserialized["e"] != null ? deserialized["e"].Value<string>() : null,
        F = deserialized["f"] != null ? deserialized["f"].Value<string>() : null
    };

var newTest = new

    {
        A = deserialized["a"]?.Value<string>(),
        B = deserialized["b"]?.Value<string>(),
        C = deserialized["c"]?.Value<string>(),
        D = deserialized["d"]?.Value<string>(),
        E = deserialized["e"]?.Value<string>(),
        F = deserialized["f"]?.Value<string>()
    };

The above code throws a ArgumentNullException in the call to Value<string>() while assigning newTest.B. The expected behavior would be to assign null to newTest.B. This problem happens only when compiling on the Mac. The problem does not occur when using Visual Studio connected to a Mac.


Reference: https://bugzilla.xamarin.com/show_bug.cgi?id=37080