René's URL Explorer Experiment


Title: Unable to read properties off object spread in generic function parameter (regression with 4.6.1-rc) · Issue #47865 · microsoft/TypeScript · GitHub

Open Graph Title: Unable to read properties off object spread in generic function parameter (regression with 4.6.1-rc) · Issue #47865 · microsoft/TypeScript

X Title: Unable to read properties off object spread in generic function parameter (regression with 4.6.1-rc) · Issue #47865 · microsoft/TypeScript

Description: Bug Report I noticed a regression between TypeScript 4.6.0-beta and 4.6.1-rc in my repo where parameters to generic functions that use object spread sometimes get an unusable type. 🔎 Search Terms object spread 4.6.1-rc 🕗 Version & Regres...

Open Graph Description: Bug Report I noticed a regression between TypeScript 4.6.0-beta and 4.6.1-rc in my repo where parameters to generic functions that use object spread sometimes get an unusable type. 🔎 Search Terms o...

X Description: Bug Report I noticed a regression between TypeScript 4.6.0-beta and 4.6.1-rc in my repo where parameters to generic functions that use object spread sometimes get an unusable type. 🔎 Search Terms o...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unable to read properties off object spread in generic function parameter (regression with 4.6.1-rc)","articleBody":"# Bug Report\r\n\r\nI noticed a regression between TypeScript 4.6.0-beta and 4.6.1-rc in my repo where parameters to generic functions that use object spread sometimes get an unusable type.\r\n\r\n### 🔎 Search Terms\r\n\r\n- object spread\r\n- 4.6.1-rc\r\n\r\n### 🕗 Version & Regression Information\r\n\r\n- This changed between versions 4.6.0-beta and 4.6.1-rc.\r\n\r\n### ⏯ Playground Link\r\n\r\n[Playground link with relevant code](https://www.typescriptlang.org/play?#code/PQKhAIFEA8BcCcCGBjW4AOikFsDO4AzeAe23EQDtwBTadea3fTWAC3AApqA6Ac2-AByYLlgBXACbUKsXMABcoydNgBJCYICUAkMACwAKFrpi8NLACe6alDhJUAJWJjY1AApZEeADwAVGnDSEvii8ACWFLwAfOAAvOChEbwBrhTB4L6G4OAA-OAO1MimEt6JkQA0CQhJUVng8hkpQfgABgAkAN4RBNTw4AD6AMqwWLAAvvKd3b3gHjhjwFMUPX0FomMtdXkdANoA1uARs55kAD7ge9QWxAS2CCiwTi7uJ7jea7BRALoNZbxjdQa-loqXS7S6yxmQxGZgmSxWx3mmwM2W2+0OVDmXh+VXCkQBKPq4A6YwA3IZDFJkAAbLA2AhiCioMLEKi8aiwPxNNIhaqRKIcOosVhA8p1ViUCTU3oNDiYHC4Bowe6OZyuLE+XxRTRxGIAN2IYQkYoMmgaBqN5IMhnZsA4wmFCgIxGIwFgrvkACMsIJKhwOs7iJVuCHcNSxLxcGMdbEYh06kUKKJid74GM4glw5HSdlgMBwMQDkdfINwAAWbgANm4AAYALSejmIcCelzgCjENDF0sV6sARjr8GQCdZuGI0u41OIvH9qejVvnFIMtvtwEd8kDbo9qd9mYj+FjxJHSbQHTnGbD+5z4DzBaLVE9ndYx7HE6nM7PWEXBm-QA)\r\n\r\n### 💻 Code\r\n\r\n(see comment below for a simpler repro: https://github.com/microsoft/TypeScript/issues/47865#issuecomment-1039290983)\r\n\r\n```ts\r\n/** Extract params from an express path (e.g. '/students/:studentId'). */\r\nexport type ExtractRouteParams\u003cT extends string> = string extends T\r\n  ? Record\u003cstring, string>\r\n  : T extends `${infer _Start}:${infer Param}/${infer Rest}`\r\n  ? {[k in Param | keyof ExtractRouteParams\u003cRest>]: string}\r\n  : T extends `${infer _Start}:${infer Param}`\r\n  ? {[k in Param]: string}\r\n  : {};\r\n\r\ndeclare function get\u003cT extends string>(\r\n  path: T,\r\n  handler: (params: ExtractRouteParams\u003cT>) => void,\r\n): void;\r\n\r\nget('/path/:foo/to/:bar', ({foo, ...slugs}) => {\r\n  const {bar} = slugs;  // ok in TS 4.6.0-beta but not in TS 4.6.1-rc\r\n  console.log({bar});\r\n});\r\n\r\nget('/path/:foo/to/:bar', slugs => {\r\n  const {bar} = slugs;  // ok in both\r\n  console.log({bar});\r\n});\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\nUsing object spread in a function parameter produces an unusable type in TS 4.6.1-rc.\r\n\r\nThe type of `slugs` in the first example is:\r\n\r\n     slugs: { bar: string; }\r\n\r\nin TypeScript 4.6.0-beta but:\r\n\r\n    slugs: Omit\u003cExtractRouteParams\u003cT>, \"foo\">\r\n\r\nin TypeScript 4.6.1-rc.\r\n\r\nThese are both the same (assuming `T = \"/path/:foo/to/:bar\"`) but the latter doesn't let me read any properties off of it.\r\n\r\n### 🙂 Expected behavior\r\n\r\nI should be able to read `bar` off of `slugs`.\r\n\r\n\u003c!-- What you expected to happen instead, and why -->\r\n","author":{"url":"https://github.com/danvk","@type":"Person","name":"danvk"},"datePublished":"2022-02-12T16:58:07Z","url":"https://github.com/microsoft/TypeScript/issues/47865"}

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:e62aafd5-b3ff-b815-87da-da8770cc08c6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE06E:96DDF:1E33ECC:263A5FF:6B015BE4
html-safe-noncea3916ea413d7d7b0063ad28949daf02245298977c50e16a7e306edb73b5002ce
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDZFOjk2RERGOjFFMzNFQ0M6MjYzQTVGRjo2QjAxNUJFNCIsInZpc2l0b3JfaWQiOiI0Mjg4Mjc3MDIyOTQzMzA0Njc2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacc1ae3762f9a038b1650d13e89de0df6815624503e1e79b9d2fd24ec9a385244a
hovercard-subject-tagissue:1134292658
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/47865/issue_layout
twitter:imagehttps://opengraph.githubassets.com/69fa8d08e316e8697029a8b1c11830281044dd9e9ae09b6c267b9de6340cd963/microsoft/TypeScript/issues/47865
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/69fa8d08e316e8697029a8b1c11830281044dd9e9ae09b6c267b9de6340cd963/microsoft/TypeScript/issues/47865
og:image:altBug Report I noticed a regression between TypeScript 4.6.0-beta and 4.6.1-rc in my repo where parameters to generic functions that use object spread sometimes get an unusable type. 🔎 Search Terms o...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedanvk
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/47865#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F47865
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%2F47865
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/47865
Reloadhttps://github.com/microsoft/TypeScript/issues/47865
Reloadhttps://github.com/microsoft/TypeScript/issues/47865
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests312 (312)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/47865
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/47865
#47909https://github.com/microsoft/TypeScript/pull/47909
Unable to read properties off object spread in generic function parameter (regression with 4.6.1-rc)https://github.com/microsoft/TypeScript/issues/47865#top
#47909https://github.com/microsoft/TypeScript/pull/47909
https://github.com/gabritto
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Fix AvailableA PR has been opened for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
TypeScript 4.6.1https://github.com/microsoft/TypeScript/milestone/158
https://github.com/danvk
Dan Vanderkam (danvk)https://github.com/danvk
on Feb 12, 2022https://github.com/microsoft/TypeScript/issues/47865#issue-1134292658
Playground link with relevant codehttps://www.typescriptlang.org/play#code/PQKhAIFEA8BcCcCGBjW4AOikFsDO4AzeAe23EQDtwBTadea3fTWAC3AApqA6Ac2-AByYLlgBXACbUKsXMABcoydNgBJCYICUAkMACwAKFrpi8NLACe6alDhJUAJWJjY1AApZEeADwAVGnDSEvii8ACWFLwAfOAAvOChEbwBrhTB4L6G4OAA-OAO1MimEt6JkQA0CQhJUVng8hkpQfgABgAkAN4RBNTw4AD6AMqwWLAAvvKd3b3gHjhjwFMUPX0FomMtdXkdANoA1uARs55kAD7ge9QWxAS2CCiwTi7uJ7jea7BRALoNZbxjdQa-loqXS7S6yxmQxGZgmSxWx3mmwM2W2+0OVDmXh+VXCkQBKPq4A6YwA3IZDFJkAAbLA2AhiCioMLEKi8aiwPxNNIhaqRKIcOosVhA8p1ViUCTU3oNDiYHC4Bowe6OZyuLE+XxRTRxGIAN2IYQkYoMmgaBqN5IMhnZsA4wmFCgIxGIwFgrvkACMsIJKhwOs7iJVuCHcNSxLxcGMdbEYh06kUKKJid74GM4glw5HSdlgMBwMQDkdfINwAAWbgANm4AAYALSejmIcCelzgCjENDF0sV6sARjr8GQCdZuGI0u41OIvH9qejVvnFIMtvtwEd8kDbo9qd9mYj+FjxJHSbQHTnGbD+5z4DzBaLVE9ndYx7HE6nM7PWEXBm-QA
#47865 (comment)https://github.com/microsoft/TypeScript/issues/47865#issuecomment-1039290983
https://github.com/danvk
Dan Vanderkam (danvk)https://github.com/danvk
on Feb 14, 2022https://github.com/microsoft/TypeScript/issues/47865#issuecomment-1039290983
simpler reprohttps://www.typescriptlang.org/play#code/JYOwLgpgTgZghgYwgAgMoBsCuBzAzsgbwChlkYB7cgLmVzClGwG4TkAjOKGuhkZogL5EiMTCARhg5EMgRx06ADwAVZBAAekEABN85NgCsIEgHwAKfQZrKANLLY0zAN3nWAlMgC8J5E-LBtD2JSBDYLQzcWISJtY3ROFHQIMGRLGgwcXBY5BXCDOzMCCnI7ADpyqAg6AQ9vQlYEaVxyJNL0cmwzSrpSjihI1gB6QdJRsfHkAD9p5AAFKHIAB2gwAE9kAHI+jeRtcirkEHIUjWA6VJk15c2AeQBbYDAVOwAiYpeTDdLkMFwzACYAMyAgCcbkEAyAA
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Feb 14, 2022https://github.com/microsoft/TypeScript/issues/47865#issuecomment-1039427729
#47337https://github.com/microsoft/TypeScript/pull/47337
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Gabriela Araujo Britto (gabritto)https://github.com/gabritto
on Feb 14, 2022https://github.com/microsoft/TypeScript/issues/47865#event-6069443768
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Feb 14, 2022https://github.com/microsoft/TypeScript/issues/47865#event-6069463135
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 4.6.1https://github.com/microsoft/TypeScript/milestone/158
on Feb 14, 2022https://github.com/microsoft/TypeScript/issues/47865#event-6069463325
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Feb 14, 2022https://github.com/microsoft/TypeScript/issues/47865#issuecomment-1039440054
Gabriela Araujo Britto (@gabritto)https://github.com/gabritto
TypeScript Bot (typescript-bot)https://github.com/typescript-bot
Fix AvailableA PR has been opened for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
on Feb 15, 2022https://github.com/microsoft/TypeScript/issues/47865#event-6077769408
Gabriela Araujo Britto (gabritto)https://github.com/gabritto
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#47909https://github.com/microsoft/TypeScript/pull/47909
on Feb 15, 2022https://github.com/microsoft/TypeScript/issues/47865#event-6078355054
microsofthttps://github.com/microsoft
on Oct 22, 2025https://github.com/microsoft/TypeScript/issues/47865#event-20417497651
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/47865
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/47865
Gabriela Araujo Britto (gabritto)https://github.com/gabritto
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Fix AvailableA PR has been opened for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
TypeScript 4.6.1https://github.com/microsoft/TypeScript/milestone/158
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.