Skip to content

Instance and static members with the same name are conflated #269

Open

Description

@glebec

Hello,

Doclets.io does not properly handle classes with identically-named static and instance methods. Consider a class Promise with static all and instance method all:

  • Only one URL is generated, something like ...#dl-Promise-all. This goes to the first method with that anchor tag in the page. Consequences:
    • Some of the inline links in a project are broken because they navigate to the wrong entry.
    • Only one sidebar link is even shown.

On a side note, it may seem like a not-great idea to have identically-named (but different in behavior) static and instance methods of the same class, but there is both precedence and an argument for it. For example, in Bluebird, Promise.all(iterable) gets its input directly from the calling code, whereas promisedIterable.all() uses the promise instance's eventual value as its input. Both are useful — the static for starting a chain when none already exists, and the latter for continuing a chain without having to add a handler which simply returns the static.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions