visitExpressionInvocation method

  1. @override
void visitExpressionInvocation(
  1. ExpressionInvocation e,
  2. TypeExpectation arg
)
override

Implementation

@override
void visitExpressionInvocation(ExpressionInvocation e, TypeExpectation arg) {
  final result = _resolveInvocation(e);
  if (result.type case final resolvedType?) {
    session._checkAndResolve(e, resolvedType, arg);
  } else if (arg case ExactTypeExpectation(type: final expectedType)
      when result.needsContext) {
    // Use expected type when we need more context
    session._checkAndResolve(e, expectedType, arg);
  }

  final visited = _resolveFunctionArguments(e);
  for (final child in e.childNodes) {
    if (!visited.contains(child)) {
      visit(child, const NoTypeExpectation());
    }
  }
}