get method

  1. @override
ASTFunctionDeclaration get(
  1. ASTFunctionSignature parametersSignature,
  2. bool exactTypes
)
override

Implementation

@override
ASTFunctionDeclaration get(
    ASTFunctionSignature parametersSignature, bool exactTypes) {
  for (var f in _functions) {
    if (f.matchesParametersTypes(parametersSignature, exactTypes)) {
      return f;
    }
  }

  ASTFunctionDeclaration? first;
  for (var f in _functions) {
    first = f;
    break;
  }

  if (!exactTypes && first != null) {
    return first;
  }

  throw StateError(
      "Can't find function '${first?.name}' with signature: $parametersSignature");
}