Fix Issue 11819 - Implement better diagnostics for unrecognized traits.