To resolve forward reference, each `Dsymbol`s have `scope` field (it's set by `Dsymbol::setScope`).
And also, EnumDeclaration has `isdone` field to avoid multiple semantic call. So here should be:

```cpp
Type *TypeEnum::semantic(Loc loc, Scope *sc)
{
    //printf("TypeEnum::semantic() %s\n", toChars());
    if (!sym->isdone)
    {
        assert(sym->scope);
        sym->semantic(sym->scope);
    }
    return merge();
}
```