Improve the error message on type applications