You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tyedoc ends up reporting types as being a rename of another type even though the types are wholly unrelated
Steps to reproduce the bug
//@ts-ignoreexporttype{T1}from'bad-module'// no types, no definitions//@ts-ignoreexporttype{T2}from'bad-module-2'// no types, no definitions//@ts-ignoreimport{T3}from'bad-module-3'// no types, no definitionsexportdefaultT3;
This produces:
T2
Renames and re-exports T1
default
Renames and re-exports T1
Even though T2 and default are not in any way related to T1. For default it's even more confusing as T3 is not even mentioned, it gets resolved to T1
Environment
Typedoc version: 0.22.10
TypeScript version: 4.5
Node.js version: 15
OS: Windows 10
The text was updated successfully, but these errors were encountered:
I'm really tempted to say that there's nothing to say that those aren't the same symbol. It wouldn't be difficult to always treat the error symbol as a new symbol, but then we might run into the opposite problem if anything references it (typeof T1 resulting in a "not exported" warning).
Having thought about this some more, we might be able to fix this by changing how symbol references are stored. Right now, TypeDoc relies on reference equality to determine if symbols are the same. If we change that to be based on paths + names (paths + names + line number to handle declaration merging?)...
This is something I've wanted to try for a while, since doing it should make it easier to fix #1606.
To do this, we'd need an update to the validateExports function, and it would probably also end up breaking typedoc-plugin-missing-exports... which is annoyingly popular.
I did some more investigation on this, and... I don't think this is something I want to "fix". It is technically possible, but doing this means that a core assumption about how aliased symbols work would have to be changed, and would require a lot of rework with consequences I'm fairly certain would be detrimental in other cases (could probably hack the change in with 50loc, but I think it would break several internal plugins in very easy to miss ways).
Search terms
type alias, rename
Expected Behavior
Typedoc should not confuse
any
error types.Actual Behavior
Tyedoc ends up reporting types as being a rename of another type even though the types are wholly unrelated
Steps to reproduce the bug
This produces:
T2
Renames and re-exports T1
default
Renames and re-exports T1
Even though
T2
anddefault
are not in any way related toT1
. Fordefault
it's even more confusing asT3
is not even mentioned, it gets resolved toT1
Environment
0.22.10
4.5
15
Windows 10
The text was updated successfully, but these errors were encountered: