Move type parameter error handling code to the grammar checker.