Improving error handling of invalid `requires` type