Fix inline-if semantics

Closes #9895.