double? test = true ? null : 1.0;
In my book, this is the same as
if (true) { test = null; } else { test = 1.0; }
double? test = true ? (double?)null : 1.0;
will work. That's because there is no conversion from the type of the first expression (null) to the type of the second expression (double).
null
double