Closed
Description
Notice how NAME_SINGLEUNDERSCORE
is not linked.
Bug is here:
Library refLibrary;
var e = refElement is ClassMemberElement ||
refElement is PropertyAccessorElement
? refElement.enclosingElement
: refElement;
// If e is a ParameterElement, it's
// never going to be in a library. So refLibrary is going to be null.
refLibrary = element.package.libraries.firstWhere(
(lib) => lib.hasInNamespace(e), orElse: () => null);
In the case of a top-level property accessor, we shouldn't be getting its enclosingElement... that will never be in the namespace of a library.