resolveFunction method

void resolveFunction(
  1. Functional function,
  2. FunctionType type
)

Implementation

void resolveFunction(Stmt.Functional function, FunctionType type) {
  FunctionType enclosingFunctionType = currentFunctionType;
  currentFunctionType = type;

  beginScope();
  for (Token param in function.params) {
    declare(param);
    define(param);
  }
  for (Token param in function.namedParams.keys) {
    declare(param);
    define(param);
  }
  resolve(function.body);
  endScope();
  currentFunctionType = enclosingFunctionType;
}