Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

TypeScript overloads fail #110

Closed
tavianator opened this issue Aug 7, 2019 · 2 comments
Closed

TypeScript overloads fail #110

tavianator opened this issue Aug 7, 2019 · 2 comments

Comments

@tavianator
Copy link
Contributor

The following example:

function foo(bar: number): number;
function foo(bar: string): string;

function foo(bar: number | string): number | string {
    return bar;
}

Generates this error:

Exception occurred:
  File ".../site-packages/sphinx_js/doclets.py", line 49, in gather_doclets
    raise PathsTaken(conflicts)
sphinx_js.doclets.PathsTaken: Your JS code contains multiple documented objects at each of these paths:

  ./docs/foo.external:foo.foo

We won't know which one you're talking about. Using JSDoc tags like @class might help you differentiate them.
@erikrose
Copy link
Contributor

erikrose commented Aug 6, 2020

In the IR branch, I am arbitrarily just taking the first signature now. That ought to get it not crashing. Later, we can figure out how to show all the signature or choose among them or whatever.

@erikrose
Copy link
Contributor

erikrose commented Sep 2, 2020

It doesn't fail anymore, but the ticket about showing all of them is #152. Cheers!

@erikrose erikrose closed this as completed Sep 2, 2020
hoodmane added a commit to hoodmane/sphinx-js that referenced this issue Oct 2, 2023
And refactor a bit of the module generation stuff
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants