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

Incorrect function parameter type reference in certain cases #1124

Closed
1 task done
dimarudnev opened this issue Oct 31, 2019 · 2 comments
Closed
1 task done

Incorrect function parameter type reference in certain cases #1124

dimarudnev opened this issue Oct 31, 2019 · 2 comments
Labels
bug Functionality does not match expectation

Comments

@dimarudnev
Copy link

Steps to reproduce:

  1. Copy the attached test.d.ts (from typedoc-reference.zip) to a new folder
  2. Run
typedoc --json res.json --ignoreCompilerErrors --includeDeclarations --excludePrivate --target ES5 .
  1. Open res.json
  2. Find the setMasterFilter method (id=157025)
  3. Find the "values" parameter (id=157027) of the setMasterFilter method
  4. See the "values" parameter type id.
    image

Current Behavior: id is 157021 that refers to the MasterFilterValues property of the ItemState class
image

Expected Behavior: id is 157022 and refers to the MasterFilterValues Type alias.
image

Environment

  • Typedoc version: 0.15.0
  • Node.js version: v10.16.3
  • OS: Windows 10
@dimarudnev dimarudnev added the bug Functionality does not match expectation label Oct 31, 2019
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Oct 31, 2019

This happens because the TypeScript compiler interns (some) identical types for performance reasons. microsoft/TypeScript#28197

Fixing this might prove... difficult. PR welcome if you'd like to give it a shot. I probably won't get to it for at least a couple of months.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Nov 28, 2020

I have no idea why I thought this was a problem with interning.... this is a complex enough type that it shouldn't be happening here. Interning only really happens with type Alias = <some primitive>.

This specific case appears to have been fixed by 0.20 (currently typedoc@beta). Hovering over the link shows that it targets the correct reflection. This also revealed a bug with 0.20's converter, it was producing multiple identical reflections for the namespace, so thanks for that!

image

@Gerrit0 Gerrit0 closed this as completed Dec 28, 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

No branches or pull requests

2 participants