Summary
There is a situation in which the current common-type algorithm results are counter-intuitive, and results in the programmer adding what feels like a redundant cast to the code. With this change, an expression such as condition ? 1 : null would result in a value of type int?.
This and #881 should be taken into the language at the same time.
Summary
There is a situation in which the current common-type algorithm results are counter-intuitive, and results in the programmer adding what feels like a redundant cast to the code. With this change, an expression such as
condition ? 1 : nullwould result in a value of typeint?.This and #881 should be taken into the language at the same time.