Fix inline-if semantics

Closes #9895.
:+1: