René's URL Explorer Experiment


Title: TS7 JSDoc `@overload` is ignored on `const` arrow function (works in 6.0.2, not in 7.0.2) · Issue #65558 · microsoft/TypeScript · GitHub

Open Graph Title: TS7 JSDoc `@overload` is ignored on `const` arrow function (works in 6.0.2, not in 7.0.2) · Issue #65558 · microsoft/TypeScript

X Title: TS7 JSDoc `@overload` is ignored on `const` arrow function (works in 6.0.2, not in 7.0.2) · Issue #65558 · microsoft/TypeScript

Description: 🔎 Search Terms JSDoc, overload, TS7 🕗 Version & Regression Information This changed between versions 6.0.3 and 7.0.2 ⏯ Playground Link No response 💻 Code main.js: #!/usr/bin/env node /** * @overload * @param {"a"} x * @returns {string} *...

Open Graph Description: 🔎 Search Terms JSDoc, overload, TS7 🕗 Version & Regression Information This changed between versions 6.0.3 and 7.0.2 ⏯ Playground Link No response 💻 Code main.js: #!/usr/bin/env node /** * @overloa...

X Description: 🔎 Search Terms JSDoc, overload, TS7 🕗 Version & Regression Information This changed between versions 6.0.3 and 7.0.2 ⏯ Playground Link No response 💻 Code main.js: #!/usr/bin/env node /** * @ove...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/65558

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TS7 JSDoc `@overload` is ignored on `const` arrow function (works in 6.0.2, not in 7.0.2)","articleBody":"### 🔎 Search Terms\n\nJSDoc, overload, TS7\n\n### 🕗 Version & Regression Information\n\n- This changed between versions 6.0.3 and 7.0.2\n\n\n### ⏯ Playground Link\n\n_No response_\n\n### 💻 Code\n\n`main.js`:\n```js\n#!/usr/bin/env node\n/**\n * @overload\n * @param {\"a\"} x\n * @returns {string}\n */\n/**\n * @overload\n * @param {\"b\"} x\n * @returns {number}\n */\n/**\n * @param {\"a\" | \"b\"} x\n * @returns {string | number}\n */\nconst f = x => {\n  if (x === \"a\") return \"100\";\n  else if (x === \"b\") return 10;\n\n  return x;\n}\n\n/**\n * @overload\n * @param {\"a\"} x\n * @returns {string}\n */\n/**\n * @overload\n * @param {\"b\"} x\n * @returns {number}\n */\n/**\n * @param {\"a\" | \"b\"} x\n * @returns {string | number}\n */\nfunction g(x) {\n  if (x === \"a\") return \"100\";\n  else if (x === \"b\") return 10;\n\n  return x;\n}\n\nconsole.log(parseInt(f(\"a\"), 10));\nconsole.log(parseInt(g(\"a\"), 10));\n\n```\n`tsconfig.json`:\n```jsonc\n{\n  \"compilerOptions\": {\n    \"rootDir\": \".\",\n    \"module\": \"EsNext\",\n    \"target\": \"ES2025\",\n\n    \"strict\": true,\n    \"noEmit\": true,\n    \"allowJs\": true,\n    \"checkJs\": true,\n  }\n}\n\n```\n\n`package.json`:\n```json\n{\n  \"devDependencies\": {\n    \"typescript6\": \"npm:typescript@6.0.3\",\n    \"typescript7\": \"npm:typescript@7.0.2\"\n  }\n}\n\n```\n\n### 🙁 Actual behavior\n\nWith TypeScript 7.0.2, the JSDoc `@overload` tags on a `const` arrow function are ignored. The function is typed from its implementation signature instead, so `f(\"a\")` returns `string | number` rather than `string`.\n\nHovering `f` in tsserver shows:\n\n```ts\nconst f: (x: \"a\" | \"b\") => string | number\n```\n\nwith no `(+1 overload)` suffix. As a result, `parseInt(f(\"a\"), 10)` fails:\n\n```\nerror TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string'.\nType 'number' is not assignable to type 'string'.\n```\n\nThis is wrong because:\n- The identical overloads work in TypeScript 6.0.3 (no error).\n- The identical overloads work in 7.0.2 when declared with `function g(x) {}` instead of `const f = x => {}`.\n\n### 🙂 Expected behavior\n\n`@overload` tags should be recognized on a `const` arrow function, the same way as in TypeScript 6.0.2.\n\nHovering `f` should show the overload signatures:\n\n```ts\nconst f: {\n    (x: \"a\"): string;\n    (x: \"b\"): number;\n}\n```\n\nso `f(\"a\")` returns `string` and `parseInt(f(\"a\"), 10)` type-checks without errors.\n\nThis is expected because:\n- The same code produces the type above in TypeScript 6.0.2.\n- The same overloads on a `function` declaration (`g` in the example) already work in 7.0.2, so the declaration form alone should not change the result.\n\n### Additional information about the issue\n\n## Versions\n\n- typescript 6.0.3: no error\n- typescript 7.0.2: error on the `f(\"a\")` line only\n- Node: v26.9.0\n- OS: Windows 11 26H2\n\n## Environment\nReproduced in a clean Docker container:\n\n```Dockerfile\nFROM node:26-slim\nWORKDIR /app\nCOPY package*.json .\nRUN npm i\nCOPY . .\nCMD [\"sh\", \"run.sh\"]\n\n```\n- Image: node:26-slim (Node v26.13.1)\n- typescript 6.0.3: no error\n- typescript 7.0.2: error on the `f(\"a\")` line only\n\n## Workaround\n\nDeclaring the function with `function f(x) {}` instead of `const f = x => {}` makes the overloads work in 7.0.2.","author":{"url":"https://github.com/abc-abc-ab","@type":"Person","name":"abc-abc-ab"},"datePublished":"2026-11-18T05:13:21Z","url":"https://github.com/microsoft/TypeScript/issues/65558"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:c81af9d8-9f87-ff0e-5d16-9711be59e0b3
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCD02:22DB35:9AFA79:C9A440:6B00E144
html-safe-noncea27f5a41b2224a089ee16634b011fc8ab14d9ccc09c1b8ebe100173fda309238
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDAyOjIyREIzNTo5QUZBNzk6QzlBNDQwOjZCMDBFMTQ0IiwidmlzaXRvcl9pZCI6IjQ0NzU1MTczOTc4MTc2ODAxOTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb98f290fe9778c4cbc07313c2e1d98b27332f4e24b43346875e01ea61a6700f9
hovercard-subject-tagissue:6460502796
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/65558/issue_layout
twitter:imagehttps://opengraph.githubassets.com/de2086379fbc792b3102c714fb74093fc1b2086e230f2100649a68ba8761b426/microsoft/TypeScript/issues/65558
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/de2086379fbc792b3102c714fb74093fc1b2086e230f2100649a68ba8761b426/microsoft/TypeScript/issues/65558
og:image:alt🔎 Search Terms JSDoc, overload, TS7 🕗 Version & Regression Information This changed between versions 6.0.3 and 7.0.2 ⏯ Playground Link No response 💻 Code main.js: #!/usr/bin/env node /** * @overloa...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameabc-abc-ab
hostnamegithub.com
expected-hostnamegithub.com
None043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5425dc24e8bd8d6fca9641a12afc984825a43875
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/65558#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F65558
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F65558
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/65558
Reloadhttps://github.com/microsoft/TypeScript/issues/65558
Reloadhttps://github.com/microsoft/TypeScript/issues/65558
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests309 (309)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/65558
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/65558
TS7 JSDoc @overload is ignored on const arrow function (works in 6.0.2, not in 7.0.2)https://github.com/microsoft/TypeScript/issues/65558#top
Working as IntendedThe behavior described is the intended behavior; this is not a bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Working%20as%20Intended%22
https://github.com/abc-abc-ab
Marui (abc-abc-ab)https://github.com/abc-abc-ab
on Nov 18, 2026https://github.com/microsoft/TypeScript/issues/65558#issue-6460502796
https://github.com/zhengdaodeguL
刘亦达 (zhengdaodeguL)https://github.com/zhengdaodeguL
on Nov 18, 2026https://github.com/microsoft/TypeScript/issues/65558#issuecomment-6977922609
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Nov 18, 2026https://github.com/microsoft/TypeScript/issues/65558#issuecomment-6984746122
TypeScript/tsc/CHANGES.mdhttps://github.com/microsoft/TypeScript/blob/e086ad3b8205668290a81baed890c536047003db/tsc/CHANGES.md?plain=1#L325
e086ad3https://github.com/microsoft/TypeScript/commit/e086ad3b8205668290a81baed890c536047003db
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Working as IntendedThe behavior described is the intended behavior; this is not a bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Working%20as%20Intended%22
on Nov 18, 2026https://github.com/microsoft/TypeScript/issues/65558#event-36551986051
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/65558
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/65558
Working as IntendedThe behavior described is the intended behavior; this is not a bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Working%20as%20Intended%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.