Improve error messages for bad uses of `:type` etc.