fix Issue 11727 - Repeated error message with using forward referenced enum as variable