想象一下情况
int? customerId = null; // works fine
int? customerId = 5; // also fine
int? customerId = someCondition ? 5 : null; // There is no implicit conversion between int and null
int? customerId = someCondition ? 5 : (int?)null; // now is ok
这怎么可能?这是语言规范吗?对我来说,显而易见的是隐式转换。你觉得怎么样?