On Wednesday, 20 August 2014 at 15:29:05 UTC, ketmar via Digitalmars-d wrote:
and for (cond ? x : 42) compiler should emit error too, 'cause
exact return type can't be determined. maybe it should do this only for
'auto ref' though.

No, the type of (cond ? x : 42) is always `int`, the `ref` already gets lost inside the ternary operator. So in this case, it behaves correctly.

Reply via email to