enclosingElement3 property

  1. @override
ElementImpl get enclosingElement3
inherited

The element that either physically or logically encloses this element.

For LibraryElement returns null, because libraries are the top-level elements in the model.

For CompilationUnitElement returns the CompilationUnitElement that uses part directive to include this element, or null if this element is the defining unit of the library.

Implementation

@override
ElementImpl get enclosingElement3 {
  // TODO(paulberry): `!` is not appropriate here because variable elements
  // aren't guaranteed to have enclosing elements. See
  // https://github.com/dart-lang/sdk/issues/59750.
  return super.enclosingElement3 as ElementImpl;
}
set enclosingElement3 (ElementImpl? element)
inherited

Set the enclosing element of this element to the given element.

Implementation

set enclosingElement3(ElementImpl? element) {
  _enclosingElement3 = element;
}