> That's the case only if Statement is inherited directly. A possibility to avoid this is to plop this:
`assert(typeid(*this) == typeid(Whatever));`

And it relies on each new visitor adding the assert.

In some other project I've worked on, I've preferred the default implementation of `visit` to be `assert(0)` for every class, not just the base.  The prevents unintentionally inheriting base class behavior.  I originally had both in here, but took it out to reduce the size of the diff.

It gives you that little bit of added safety, at the code of some code duplication.
```cpp
class Visitor
{
public:
    virtual void visit(Statement *s) { assert(0); }
    virtual void visit(ErrorStatement *s) { assert(0); }
    virtual void visit(PeelStatement *s) { assert(0); }
    ...
};

class InheritVisitor : public Visitor
{
public:
    void visit(ErrorStatement *s) { visit((Statement *)s); }
    void visit(PeelStatement *s) { visit((Statement *)s); }
    ...
};
```