Make ErrorCollector#checkSucceeds generic

Closes #1013