Skip to content

Unable to link to top-level property from doc comments #761

Closed
@sethladd

Description

@sethladd

screen shot 2015-08-03 at 9 16 44 pm

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.

Metadata

Metadata

Assignees

Labels

type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions