}
Element element = node.getName().getStaticElement();
if (element instanceof VariableElement) {
((VariableElementImpl) element).setType(declaredType);
if (element instanceof PropertyInducingElement) {
PropertyInducingElement variableElement = (PropertyInducingElement) element;
PropertyAccessorElementImpl getter = (PropertyAccessorElementImpl) variableElement.getGetter();
getter.setReturnType(declaredType);
FunctionTypeImpl getterType = new FunctionTypeImpl(getter);
ClassElement definingClass = element.getAncestor(ClassElement.class);
if (definingClass != null) {
getterType.setTypeArguments(definingClass.getType().getTypeArguments());
}
getter.setType(getterType);
PropertyAccessorElementImpl setter = (PropertyAccessorElementImpl) variableElement.getSetter();
if (setter != null) {
ParameterElement[] parameters = setter.getParameters();
if (parameters.length > 0) {
((ParameterElementImpl) parameters[0]).setType(declaredType);
}