implement visitor for dsymbol and type (need for #2074)

Please pull it faster if possible, because it have many dependences.