forbid cast as bool

Closes #7311