Improved error message for impl on typedef.

This addresses GH #9767.