Coerce generic case conditions to predicates

Fixes #1818
Merge pull request #1819 from cleishm/generic_case_predicate

Coerce generic case conditions to predicates