fix Issue 11727 - Repeated error message with using forward referenced enum as variable
Merge pull request #2956 from 9rnsr/fix11727

[diag] Issue 11727 - Repeated error message with using forward referenced enum as variable