Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceType.equals() returns incorrectly returns true when symbolFullyQualifiedName fields are different #1383

Closed
socsieng opened this issue Oct 27, 2020 · 3 comments · Fixed by #1384
Labels
bug Functionality does not match expectation

Comments

@socsieng
Copy link
Contributor

Search terms

ReferenceType, equals, symbolFullyQualifiedName

Expected Behavior

ReferenceType.equals() should return false when symbolFullyQualifiedName isn't equal.

Example:

const type1 = new ReferenceType("Type1", "Type1");
const type2 = new ReferenceType("Type2", "Type2");

equal(type1.equals(type2), false); // should return false, but returns true instead

Actual Behavior

ReferenceType.equals() returns true because reflection on both types are undefined and satisfies the || other.reflection === this.reflection condition.

Steps to reproduce the bug

const type1 = new ReferenceType("Type1", "Type1");
const type2 = new ReferenceType("Type2", "Type2");

equal(type1.equals(type2), false); // should return false, but returns true instead

Environment

  • Typedoc version: 0.19.2
  • TypeScript version: 4.0.3
  • Node.js version: v10.19.0
  • OS: macOS
@socsieng socsieng added the bug Functionality does not match expectation label Oct 27, 2020
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Oct 27, 2020

This one is probably going to be a wontfix - reference types are changing in 0.20 to use symbols instead of fully qualified names, so it won't apply anymore.

@socsieng
Copy link
Contributor Author

Thanks for the quick response. I've actually already prepared a change with tests.

Let me know if you're interested and I can submit a PR (the test may/may not be useful going forward).

socsieng pushed a commit to socsieng/typedoc that referenced this issue Oct 27, 2020
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Oct 28, 2020

Go ahead and submit it - There might need to be another 0.19 release before 0.20 comes, so it would be valuable there :)

socsieng pushed a commit to socsieng/typedoc that referenced this issue Oct 28, 2020
Gerrit0 pushed a commit that referenced this issue Oct 28, 2020
socsieng pushed a commit to socsieng/typedoc that referenced this issue Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants