TS Confuses namespace with the class on JSDoc module.exported class with static method. #55875
Labels
Bug
A bug in TypeScript
Domain: JSDoc
Relates to JSDoc parsing and type generation
Help Wanted
You can do this
Milestone
🔎 Search Terms
"module.exports static method" "namespace vs class confusion" "namespace vs class collision" "Two different types with this name exist, but they are unrelated."
🕗 Version & Regression Information
Versions tried:
⏯ Playground Link
https://www.typescriptlang.org/dev/bug-workbench/?noUnusedLocals=true&noUnusedParameters=true&checkJs=true&allowJs=true&module=1&emitDeclarationOnly=true&stripInternal=true#code/PTAEAEFsHsBMFcA2BTAXKAxtSMB2ArAZwCgQIYEUAlZQ6ReAFwEtpd0A5OZUscWZBkQBDAE7CWbXhGSRmjACKCR4ybgDyuRAE9p4YYkTQA7gCkSZcBgAWggNbm9jMQHNkjUACIAogGUATAAMQZ56iMwARqAA2j4BwYGeALp6hIyizAAOAJK4jMiiuAZ6uNDZkJnhGPIAKtbMFnylAKq48ITIsAAy0BgGjRAtbR2wAApiwpDuBSR6AGbMKEVT6MvIAHRExADk7cigaRkYjNsA3MSkAFSXxKCXoOqZaoSgc9CioIy2oLjuwrCwUS0QjrW73cCMbSZTrIOagADe6gi+EEjAAvqAOJNkI9nmCIJlRNBoaJIQjfOlmLgXBi1mDgBdgNd8Rx3KAAIIAoGEEh3UA0Qm0ZB5F7CH7uYzvOygf6A4Ggu4M4hCYQ8zHYhG3UBM8GQ6HkynUjGXBmgH7Y85anVavkAYSBEn2Yt+jElomlsu5IJtJouZqwuEO8GO7wAFABKTVms1fBrrNagAC8oG2+TSZy1aL92uZ0fuuRRx1AhOJBRYtFeRMgoGs0DSABpi+9GI3hLhYOLXVKFWbwZkJtX4RSMkbzVMfRAgYx4IUXvDY4Qs3mlWa5lWsVNQ2tI-CbZ96iCE8m1udo6ApzPcPuGqfQFmrbnewSBwaRzSxzw85P3Je5xvkEuvYrgczgsBglbYP+W7Yjue4XoU4rGNehARusa6Qdi0FTOGt5ZveTL4t4AAemR1p+vrEBQSAbMgJHNi8yb-palgLEs2LoO0whuJsJC7B0IFHCcloBmk6pTEm57IAAjvAzBAqG2zrMAazbDhjLXBAer7PC-7GgyKAeJ6wKWkZarHsgSFQWpxCmYeGrJtsdBTCpzF8KxwrscWwgYHYXEbEQUjwp4hLMAAbo6njoOk8AAUAA
💻 Code
🙁 Actual behavior
This reports an error:
🙂 Expected behavior
new Name()
and@type {Name}
should be the same asmodule.exports = Name
class.Additional information about the issue
Repository format: https://github.com/nodech/type-tsjs-tests
generated declaration file for
name.js
is in the form:If you remove
@typedef {Object} NameOptions
from thename.js
, the declaration becomesand issue goes away.
More confusing
If you leave NameOptions but remove static member
static fromName
of the class Name, it still has namespace and class with the same name, BUT issue goes away ?The text was updated successfully, but these errors were encountered: