checkFunction function

void checkFunction(
  1. ExecutableElement element
)

Implementation

void checkFunction(ExecutableElement element) {
  if ($Injectable.firstAnnotationOfExact(element) == null) {
    return;
  }

  if (!element.isStatic) {
    throw BuildError.forElement(
      element,
      'Non-static functions can not be @Injectable',
    );
  }

  if (element.isPrivate) {
    throw BuildError.forElement(
      element,
      'Private functions can not be @Injectable',
    );
  }

  dependencyReader.parseDependencies(element);
}