$a and $b should not be understood as stand-ins for "anything"
True. I very consciously chose the scalars $a and $b. In fact, I had originally started to write return A ? A : B; but realized that that would not be sufficient, nor would it be necessary for the point (i.e. the OP's problem).