Title: JSDoc generated declaration omits constructor of child class · Issue #41397 · microsoft/TypeScript · GitHub
Open Graph Title: JSDoc generated declaration omits constructor of child class · Issue #41397 · microsoft/TypeScript
X Title: JSDoc generated declaration omits constructor of child class · Issue #41397 · microsoft/TypeScript
Description: TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - JSDoc generated declaration omits constructor of child class · Issue #41397 · microsoft/TypeScript
Open Graph Description: TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - JSDoc generated declaration omits constructor of child class · Issue #41397 · microsoft/TypeScript
X Description: TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - JSDoc generated declaration omits constructor of child class · Issue #41397 · microsoft/TypeScript
Opengraph URL: https://github.com/microsoft/TypeScript
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"JSDoc generated declaration omits constructor of child class","articleBody":"**TypeScript Version:** 4.1.1-rc\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** jsdoc declaration constructor super class\r\n\r\n**Code**\r\n\r\n```js\r\nexport class Super {\r\n /**\r\n * @param {string} firstArg\r\n * @param {string} secondArg\r\n */\r\n constructor(firstArg, secondArg) {}\r\n}\r\n\r\nexport class Sub extends Super {\r\n constructor() {\r\n super('first', 'second');\r\n }\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\nThe generated declaration is:\r\n\r\n```ts\r\nexport class Super {\r\n /**\r\n * @param {string} firstArg\r\n * @param {string} secondArg\r\n */\r\n constructor(firstArg: string, secondArg: string);\r\n}\r\nexport class Sub extends Super {\r\n constructor();\r\n}\r\n```\r\n\r\n**Actual behavior:**\r\n```ts\r\nexport class Super {\r\n /**\r\n * @param {string} firstArg\r\n * @param {string} secondArg\r\n */\r\n constructor(firstArg: string, secondArg: string);\r\n}\r\nexport class Sub extends Super {\r\n}\r\n```\r\n\r\nThis causes problems when using `composite` projects, where the `.d.ts` files are used to perform compilations. When the `.d.ts` is used which omits the child constructor, the compilation will error with:\r\n\r\n```\r\nerror TS2554: Expected 2 arguments, but got 0.\r\n```\r\n\r\n**Playground Link:** https://www.typescriptlang.org/play?useJavaScript=true#code/KYDwDg9gTgLgBAYwDYEMDOa4GUCuZhRwDeAUHHAPQBUVZ5VcAAmClCgLbFoxQCWAdgHMAvnABmvKNwCCUQXTgNmrDlx4CRcNMAQR+AE1nzyiinV39uUHAhjQAFBKkwjAGi069huQEpiwkgCSUEhYRFQMbBwAIzhQGGADTFx8QlJyCysbOyh7P3STNDwCewByJ25S91LtC31SnwBuOgDhIA\r\n\r\n**Related Issues:** n/a\r\n","author":{"url":"https://github.com/TimvdLippe","@type":"Person","name":"TimvdLippe"},"datePublished":"2020-11-04T15:42:18Z","url":"https://github.com/microsoft/TypeScript/issues/41397"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:8d9f029a-7172-55c9-3a03-cc9bf1ac6f2c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A480:213839:2967897:34E9828:6B01972F |
| html-safe-nonce | dd222113e314b96e4be400593704c7396dd10fa64a4dc7be78ce582e0767a6ca |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDgwOjIxMzgzOToyOTY3ODk3OjM0RTk4Mjg6NkIwMTk3MkYiLCJ2aXNpdG9yX2lkIjoiMjAyMTQ0MjI5Mzk4NjMzNDUxMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 50a8f827d6b563bd3eefda0a53e8148f13192997918721e6e415d6d59d945d42 |
| hovercard-subject-tag | repository:20929025 |
| 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/microsoft/TypeScript/issues/41397 |
| twitter:image | https://opengraph.githubassets.com/47cde802d3847ff7ce61448bd4f8c3272d012c9a3f2b9085b71a67530bf7bbd6/microsoft/TypeScript |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/47cde802d3847ff7ce61448bd4f8c3272d012c9a3f2b9085b71a67530bf7bbd6/microsoft/TypeScript |
| og:image:alt | TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - JSDoc generated declaration omits constructor of child class · Issue #41397 · microsoft/TypeScript |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-cache |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width