builder.append(getSource().getFullName());
builder.append(" was not set while trying to resolve types.");
AnalysisEngine.getInstance().getLogger().logError(builder.toString(), new AnalysisException());
}
element.setReturnType(computeReturnType(node.getReturnType()));
FunctionTypeImpl type = new FunctionTypeImpl(element);
ClassElement definingClass = element.getAncestor(ClassElement.class);
if (definingClass != null) {
type.setTypeArguments(definingClass.getType().getTypeArguments());
}
element.setType(type);
if (element instanceof PropertyAccessorElement) {
PropertyAccessorElement accessor = (PropertyAccessorElement) element;
PropertyInducingElementImpl variable = (PropertyInducingElementImpl) accessor.getVariable();
if (accessor.isGetter()) {
variable.setType(type.getReturnType());
} else if (variable.getType() == null) {
Type[] parameterTypes = type.getNormalParameterTypes();
if (parameterTypes != null && parameterTypes.length > 0) {
variable.setType(parameterTypes[0]);
}
}
}