Remove needless casts from ASTVisitor