Merge clauses even when no clause is consistent with the expected type.

Closes PR14731.
Fix type queries.