if (element instanceof PropertyAccessorElement) {
//
// This is a function invocation expression disguised as something else. We are invoking a
// getter and then invoking the returned function.
//
FunctionType propertyType = ((PropertyAccessorElement) element).getType();
if (propertyType != null) {
Type returnType = propertyType.getReturnType();
if (returnType.isDartCoreFunction()) {
return dynamicType;
} else if (returnType instanceof InterfaceType) {
MethodElement callMethod = ((InterfaceType) returnType).lookUpMethod(
FunctionElement.CALL_METHOD_NAME,
resolver.getDefiningLibrary());
if (callMethod != null) {
return callMethod.getType().getReturnType();
}
} else if (returnType instanceof FunctionType) {
Type innerReturnType = ((FunctionType) returnType).getReturnType();
if (innerReturnType != null) {
return innerReturnType;
}
}
if (returnType != null) {
return returnType;
}
}
} else if (element instanceof ExecutableElement) {
FunctionType type = ((ExecutableElement) element).getType();
if (type != null) {
// TODO(brianwilkerson) Figure out the conditions under which the type is null.
return type.getReturnType();
}
} else if (element instanceof VariableElement) {
VariableElement variable = (VariableElement) element;
Type variableType = promoteManager.getStaticType(variable);
if (variableType instanceof FunctionType) {