Fix Issue 11819 - Implement better diagnostics for unrecognized traits.
Merge pull request #3507 from AndrejMitrovic/Fix11819

Issue 11819 - Implement better diagnostics for unrecognized traits.