isAccessibleIn method

  1. @override
bool isAccessibleIn(
  1. LibraryElement? library
)
inherited

Return true if this element, assuming that it is within scope, is accessible to code in the given library. This is defined by the Dart Language Specification in section 3.2:

A declaration m is accessible to library L if m is declared in L or if m is public.

TODO(migration): should not be nullable

Implementation

@override
bool isAccessibleIn(LibraryElement? library) {
  if (Identifier.isPrivateName(name!)) {
    return library == this.library;
  }
  return true;
}