fix Issue 10142 - enum value semantic problem that declared in class member
merge D2 pull #2069