Possible Duplicate:
Why is this code invalid in C#?
Conditional operator cannot cast implicitly?
If I do the following:
bool someBool = false;
uint value = 0;
These are fine:
value = (someBool) ? 0 : (uint)1;
value = (someBool) ? (uint)0 : 1;
But this is not:
value = (someBool) ? 0 : 1;
Why can I not use the last one when I can easily say:
value = 0;
value = 1;
How is the type of the ternary operator determined?