I think it would be cleaner to handle pointers like it's done in [DotIdExp::sematic](https://github.com/D-Programming-Language/dmd/blob/4203c06b4e54a598aa6366056d647cef9410a64b/src/expression.c#L7626), i.e. rewrite as `with (*p) {}`.

```d
    else
    {   Type *t = exp->type;

        assert(t);
        t = t->toBasetype();
        if (t->toBasetype()->ty == Tpointer && exp->type->ty != Tenum)
        {
            exp = new PtrExp(loc, exp);
            exp = exp->semantic(sc);
            t = exp->type->toBasetype();
        }
    }
```