Handle implicit cast when short-circuiting ternary expression.

If a ternary expression with mixed logic and real operands is
short-circuited and the logic value is selected, that value
should be cast to a real value.