[new compiler] Fix logic error in enum resolver

Change-Id: I614cc1428439801ed20cdee099cf8260ff930618
Reviewed-by: Liang Qi <liang.qi@digia.com>