Title: [7.0 regression] JSDoc `@this` breaks `@param` matching for destructured parameter (TS8024) · Issue #65524 · microsoft/TypeScript · GitHub
Open Graph Title: [7.0 regression] JSDoc `@this` breaks `@param` matching for destructured parameter (TS8024) · Issue #65524 · microsoft/TypeScript
X Title: [7.0 regression] JSDoc `@this` breaks `@param` matching for destructured parameter (TS8024) · Issue #65524 · microsoft/TypeScript
Description: 🔎 Search Terms JSDoc @this @param destructured TS8024 TS7031 regression 7.0 🕗 Version & Regression Information This changed between versions 5.9.3 and 7.0.2 5.9.3: no errors. 7.0.2 (tsc and the VS Code language service): errors below. ⏯ ...
Open Graph Description: 🔎 Search Terms JSDoc @this @param destructured TS8024 TS7031 regression 7.0 🕗 Version & Regression Information This changed between versions 5.9.3 and 7.0.2 5.9.3: no errors. 7.0.2 (tsc and the VS ...
X Description: 🔎 Search Terms JSDoc @this @param destructured TS8024 TS7031 regression 7.0 🕗 Version & Regression Information This changed between versions 5.9.3 and 7.0.2 5.9.3: no errors. 7.0.2 (tsc and the...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/65524
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[7.0 regression] JSDoc `@this` breaks `@param` matching for destructured parameter (TS8024)","articleBody":"### 🔎 Search Terms\n\n`JSDoc @this @param destructured TS8024 TS7031 regression 7.0`\n\n### 🕗 Version & Regression Information\n\n- This changed between versions 5.9.3 and 7.0.2\n- 5.9.3: no errors. 7.0.2 (`tsc` and the VS Code language service): errors below.\n\n### ⏯ Playground Link\n\n_N/A (needs `checkJs` on a `.js` file); full repro below_\n\n### 💻 Code\n\n`a.js`\n```js\n/**\n * @this {{ x: number }}\n * @param {{ title: string }} props\n */\nexport function withThis({ title }) {\n return this.x + title;\n}\n\n/**\n * @param {{ title: string }} props\n */\nexport function withoutThis({ title }) {\n return title;\n}\n```\n\n`tsconfig.json`\n```json\n{ \"compilerOptions\": { \"allowJs\": true, \"checkJs\": true, \"noEmit\": true, \"strict\": true }, \"files\": [\"a.js\"] }\n```\n\n### 🙁 Actual behavior\n\n```\na.js(3,31): error TS8024: JSDoc '@param' tag has name 'props', but there is no parameter with that name.\na.js(5,28): error TS7031: Binding element 'title' implicitly has an 'any' type.\n```\n\nThe `@param` gets no match, so the destructured parameter is typed as `any`. This happens only when there's a `@this` tag. `withoutThis` is fine.\n\n### 🙂 Expected behavior\n\nNo errors, the same as TS 5.9.3. The `@this` tag doesn't declare a parameter, so it shouldn't affect how `@param` tags match the destructured (unnamed) first parameter.\n\n### Additional information about the issue\n\nIt looks like the `@this` tag is counted as a positional parameter when an unnamed (binding pattern) parameter is matched to its `@param` tag. Possibly related, but not the same: #65167 (that one is about language service hover only, and the checker is OK there).\n","author":{"url":"https://github.com/jablonski","@type":"Person","name":"jablonski"},"datePublished":"2026-11-16T11:26:54Z","url":"https://github.com/microsoft/TypeScript/issues/65524"}
| 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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:91014092-e22f-e904-6a52-15efceb2b4a5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A460:63875:8B11EC:BA4018:6B00E149 |
| html-safe-nonce | 34ecc902a04a867bda412f6404489a5b239dccdf83275f060c1bbfaeedfbe25a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDYwOjYzODc1OjhCMTFFQzpCQTQwMTg6NkIwMEUxNDkiLCJ2aXNpdG9yX2lkIjoiNzU5MzY4MTU0MzI1MjQ2ODA0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 48b1e22871188487ee2fa1c63036a2bec83d8c74ee42be93f7250fc3b56e2875 |
| hovercard-subject-tag | issue:6420193406 |
| 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/65524/issue_layout |
| twitter:image | https://opengraph.githubassets.com/01e6ff490de451d9c8c82dfda19cf6d69daf3df9ae33462f37fb09587b7dc633/microsoft/TypeScript/issues/65524 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/01e6ff490de451d9c8c82dfda19cf6d69daf3df9ae33462f37fb09587b7dc633/microsoft/TypeScript/issues/65524 |
| og:image:alt | 🔎 Search Terms JSDoc @this @param destructured TS8024 TS7031 regression 7.0 🕗 Version & Regression Information This changed between versions 5.9.3 and 7.0.2 5.9.3: no errors. 7.0.2 (tsc and the VS ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jablonski |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| 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 | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width