Title: JsDoc is missing/duplicated in declarations for overloads declared in classes declared in functions · Issue #59397 · microsoft/TypeScript · GitHub
Open Graph Title: JsDoc is missing/duplicated in declarations for overloads declared in classes declared in functions · Issue #59397 · microsoft/TypeScript
X Title: JsDoc is missing/duplicated in declarations for overloads declared in classes declared in functions · Issue #59397 · microsoft/TypeScript
Description: 🔎 Search Terms jsdoc overloads compiler declaration class function 🕗 Version & Regression Information This is the behavior in every version I tried, and I reviewed the FAQ for entries about overloads, classes, et al. ⏯ Playground Link ht...
Open Graph Description: 🔎 Search Terms jsdoc overloads compiler declaration class function 🕗 Version & Regression Information This is the behavior in every version I tried, and I reviewed the FAQ for entries about overloa...
X Description: 🔎 Search Terms jsdoc overloads compiler declaration class function 🕗 Version & Regression Information This is the behavior in every version I tried, and I reviewed the FAQ for entries about ove...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/59397
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"JsDoc is missing/duplicated in declarations for overloads declared in classes declared in functions","articleBody":"### 🔎 Search Terms\n\njsdoc overloads compiler declaration class function\n\n### 🕗 Version \u0026 Regression Information\n\n- This is the behavior in every version I tried, and I reviewed the FAQ for entries about overloads, classes, et al.\r\n\n\n### ⏯ Playground Link\n\nhttps://www.typescriptlang.org/play/?ts=5.5.3#code/PQKhCgAIUgVALAlgZ0gEwPYGMCuBbAUwDsAXAQxMQyMhUgAcAnDegxgGwE9aaT4DIAOjSCSyKCGDgs7MslQAxDBkgBvKJE2gIm3TAQCA5srSRkiQ0Qo5GBDXqm7IAM2UAKAEZlGALjMlGRCJDAEo-ADcMRDQAbntIbXjoSAABNAImAjIsEgJTBDpzS2tbWlR0zOzctCTJeNcMNzD-QOC4pwbPbwB+P2QAoNC+geDIAB9ISOi1JN1bEhsaAHIkJfbdAF9IcA3wcETkg3RsfGJySmoeIRExMsgvGugpZxwiHKoaAFkyAGsCACFvE0Zk55otIDI5KhAYwQU5dAd4Xo4PxIMYMKYilYFrZZg48S53F5fC1Bs0prECYikck0hlbFgKHkUYULNibAI6BUGUzHjTkgTDkhUFiSpzUHgUOZRs5mHhIHwBMJROJ+U8CZ1mv1WoZ1kjOsTeqTglqRoZxpMoqZ1Gq5gQcctVgTdk5dhsgA\n\n### 💻 Code\n\n```ts\r\n/**\r\n * This documentation is properly in the .d.ts\r\n */\r\nclass Foo {\r\n /**\r\n * The good signature\r\n */\r\n foo(bar: string): void;\r\n /**\r\n * @depreacted This signature is depreacted\r\n */\r\n foo(): string;\r\n foo(bar?: string): string | void {\r\n return 'hi';\r\n } \r\n}\r\n\r\n/**\r\n * The documentation in .d.ts is bad\r\n */\r\nfunction MakeBar() {\r\n return class Bar {\r\n /**\r\n * The good signature\r\n */\r\n foo(bar: string): void;\r\n /**\r\n * @deprecated This signature is deprecated\r\n * \r\n * This signature is missing from the .d.ts\r\n */\r\n foo(): string;\r\n foo(bar?: string): string | void {\r\n return 'hi'\r\n }\r\n }\r\n}\r\n```\r\n\n\n### 🙁 Actual behavior\n\nThe jsdoc in the `d.t.s` file duplicates the jsdoc for the first signature found on all other overloaded signatures when a function returns a constructor. This behavior does not appear in normal class definitions.\n\n### 🙂 Expected behavior\n\nThe JSDoc on each signature should match what's written for that signature in the `.ts` file.\n\n### Additional information about the issue\n\nIntellisense that's picked up directly from the `.ts` file works fine - it understands the difference between the signatures, it's only the declaration file that's broken.","author":{"url":"https://github.com/amerrit2","@type":"Person","name":"amerrit2"},"datePublished":"2024-07-23T17:50:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/59397/TypeScript/issues/59397"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:93a8f9e3-ab0c-9888-4282-29e9cc29f2b2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EE04:A97AB:370B10F:4C45AD2:6A60E161 |
| html-safe-nonce | 5518e77442bc0a44b5cad872d8f3c59fc4c83e93c38adf27d7b3fb60cc62a9a5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRTA0OkE5N0FCOjM3MEIxMEY6NEM0NUFEMjo2QTYwRTE2MSIsInZpc2l0b3JfaWQiOiI4NDUwMjg5NDQwMTY2ODMwNDMzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4b06c45788f4ad4e64551bd51ed4e4ca9f8f6e0a499b606ef4b110215b2b4555 |
| hovercard-subject-tag | issue:2425775097 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/59397/issue_layout |
| twitter:image | https://opengraph.githubassets.com/508aeca4943c7302bf23fa1562e1b90266668d816c1ab7b56e5758cf4489421f/microsoft/TypeScript/issues/59397 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/508aeca4943c7302bf23fa1562e1b90266668d816c1ab7b56e5758cf4489421f/microsoft/TypeScript/issues/59397 |
| og:image:alt | 🔎 Search Terms jsdoc overloads compiler declaration class function 🕗 Version & Regression Information This is the behavior in every version I tried, and I reviewed the FAQ for entries about overloa... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | amerrit2 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1957f194e271fe30a03dc862496c17190cace7b76c3327faf05645d99ab7da7b |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ce4ea0e3ce641f8f789b539253752038d78f1cfe |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width