Ternary operator vs if else

In reply to to_learn_uvm:

I assume you meant to ask:

logic ternary_out;
logic x=1'bx;
initial ternary_out = (x) ? 1 :0 );

then the result of ternary_out will be 1’bx??

That is correct