bool y = (x == 42) ? true : false;
I get that it’s a only contrived example, but:
bool y = x == 42;
Or even better, don’t assign it to a variable, just use the condition where you want it. A better example might be an assignment statement where the result isn’t a boolean.