change Declaration.kind to Declaration.type