René's URL Explorer Experiment


Title: `Extract` not narrowing type union in mapped type passed as generic · Issue #57827 · microsoft/TypeScript · GitHub

Open Graph Title: `Extract` not narrowing type union in mapped type passed as generic · Issue #57827 · microsoft/TypeScript

X Title: `Extract` not narrowing type union in mapped type passed as generic · Issue #57827 · microsoft/TypeScript

Description: 🔎 Search Terms Extract, type union 🕗 Version & Regression Information This changed between versions 5.33 and 5.4 ⏯ Playground Link https://www.typescriptlang.org/play?ts=5.4.2#code/C4TwDgpgBAysBOBLAdgcwNIRAZwDwBUA+KAXigFEAPBAQwGNhcBrLAew...

Open Graph Description: 🔎 Search Terms Extract, type union 🕗 Version & Regression Information This changed between versions 5.33 and 5.4 ⏯ Playground Link https://www.typescriptlang.org/play?ts=5.4.2#code/C4TwDgpgBAysBOBL...

X Description: 🔎 Search Terms Extract, type union 🕗 Version & Regression Information This changed between versions 5.33 and 5.4 ⏯ Playground Link https://www.typescriptlang.org/play?ts=5.4.2#code/C4TwDgpgBAys...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`Extract` not narrowing type union in mapped type passed as generic","articleBody":"### 🔎 Search Terms\n\nExtract, type union\n\n### 🕗 Version & Regression Information\n\n- This changed between versions 5.33 and 5.4\r\n\n\n### ⏯ Playground Link\n\nhttps://www.typescriptlang.org/play?ts=5.4.2#code/C4TwDgpgBAysBOBLAdgcwNIRAZwDwBUA+KAXigFEAPBAQwGNhcBrLAewDMoBvAWACgogqAG0AClBRQWIDlHxQa2OWIC6UCNQjIAJkuwIUqKAH4oogFxRkEAG4R4KyzWQh+AXwA0UfUjSF+-HSsyPpQAEYANqysYKRQBB6EABQAXpZwvhhYeEQAlKTEvAJQQSHAUOyWPoZxKe4BfCjA9uz00Ira3PyCAI4A7hBVBmj1fPwREOU06cNZOLgd-nxAA\n\n### 💻 Code\n\n```ts\r\ntype StringKeys\u003cT> = Extract\u003ckeyof {\r\n    [P in keyof T as T[P] extends string ? P: never]: any\r\n}, string>\r\n\r\nconst bloop = \u003cT,>(z: StringKeys\u003cT>) => {\r\n  const f: string = z\r\n}\r\n\r\ninterface asd {\r\n  qwe: string\r\n}\r\n\r\nlet a: StringKeys\u003casd>\r\n\r\n```\r\n\n\n### 🙁 Actual behavior\n\n`z` is not assignable to `string` in the `bloop` function\n\n### 🙂 Expected behavior\n\n`z` should be assignable to `string`, because we extract string-extending keys\n\n### Additional information about the issue\n\nThis was working just fine on 5.3.3, and continues to work when the generic is concretized (hence the `let` at the bottom of the example)","author":{"url":"https://github.com/mikeauclair","@type":"Person","name":"mikeauclair"},"datePublished":"2024-03-18T14:08:43Z","url":"https://github.com/microsoft/TypeScript/issues/57827"}

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:11efb3f0-48d4-0340-79fb-46e2b47ae355
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA538:2A7C1C:199497:21F087:6B0187B0
html-safe-nonced08aa0408b89ca4a69fcd1383ce2e82b094da8dd56b3a9d7f4c95543bc164e6a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTM4OjJBN0MxQzoxOTk0OTc6MjFGMDg3OjZCMDE4N0IwIiwidmlzaXRvcl9pZCI6IjIwMDgyNTcwODM2OTAwMjY5MjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb3cda8b220f4baa6292f676946c707ab068d065ee0cc8630237b41586e3d472a
hovercard-subject-tagissue:2192329813
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/57827/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f899cf12d6f634b9d4ebb91d8e6fcb4f189a0eae0881252149d7e81cbca12735/microsoft/TypeScript/issues/57827
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f899cf12d6f634b9d4ebb91d8e6fcb4f189a0eae0881252149d7e81cbca12735/microsoft/TypeScript/issues/57827
og:image:alt🔎 Search Terms Extract, type union 🕗 Version & Regression Information This changed between versions 5.33 and 5.4 ⏯ Playground Link https://www.typescriptlang.org/play?ts=5.4.2#code/C4TwDgpgBAysBOBL...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemikeauclair
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/57827#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F57827
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%2F57827
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/57827
Reloadhttps://github.com/microsoft/TypeScript/issues/57827
Reloadhttps://github.com/microsoft/TypeScript/issues/57827
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/57827
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/57827
Extract not narrowing type union in mapped type passed as generichttps://github.com/microsoft/TypeScript/issues/57827#top
https://github.com/weswigham
Needs InvestigationThis issue needs a team member to investigate its status.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%22
https://github.com/mikeauclair
Mike Auclair (mikeauclair)https://github.com/mikeauclair
on Mar 18, 2024https://github.com/microsoft/TypeScript/issues/57827#issue-2192329813
https://www.typescriptlang.org/play?ts=5.4.2#code/C4TwDgpgBAysBOBLAdgcwNIRAZwDwBUA+KAXigFEAPBAQwGNhcBrLAewDMoBvAWACgogqAG0AClBRQWIDlHxQa2OWIC6UCNQjIAJkuwIUqKAH4oogFxRkEAG4R4KyzWQh+AXwA0UfUjSF+-HSsyPpQAEYANqysYKRQBB6EABQAXpZwvhhYeEQAlKTEvAJQQSHAUOyWPoZxKe4BfCjA9uz00Ira3PyCAI4A7hBVBmj1fPwREOU06cNZOLgd-nxAAhttps://www.typescriptlang.org/play?ts=5.4.2#code/C4TwDgpgBAysBOBLAdgcwNIRAZwDwBUA+KAXigFEAPBAQwGNhcBrLAewDMoBvAWACgogqAG0AClBRQWIDlHxQa2OWIC6UCNQjIAJkuwIUqKAH4oogFxRkEAG4R4KyzWQh+AXwA0UfUjSF+-HSsyPpQAEYANqysYKRQBB6EABQAXpZwvhhYeEQAlKTEvAJQQSHAUOyWPoZxKe4BfCjA9uz00Ira3PyCAI4A7hBVBmj1fPwREOU06cNZOLgd-nxAA
https://github.com/Andarist
Mateusz Burzyński (Andarist)https://github.com/Andarist
on Mar 18, 2024https://github.com/microsoft/TypeScript/issues/57827#issuecomment-2004431372
https://github.com/mikeauclair
Mike Auclair (mikeauclair)https://github.com/mikeauclair
on Mar 18, 2024https://github.com/microsoft/TypeScript/issues/57827#issuecomment-2004548378
https://github.com/fatcerberus
Bruce Pascoe (fatcerberus)https://github.com/fatcerberus
on Mar 18, 2024https://github.com/microsoft/TypeScript/issues/57827#issuecomment-2004700096
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Mar 18, 2024https://github.com/microsoft/TypeScript/issues/57827#issuecomment-2004777667
#56742https://github.com/microsoft/TypeScript/pull/56742
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Wesley Wigham (weswigham)https://github.com/weswigham
on Mar 18, 2024https://github.com/microsoft/TypeScript/issues/57827#event-12158227897
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Needs InvestigationThis issue needs a team member to investigate its status.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%22
on Mar 18, 2024https://github.com/microsoft/TypeScript/issues/57827#event-12158228765
https://github.com/814k31
Blake Lovelace (814k31)https://github.com/814k31
on Aug 6, 2024https://github.com/microsoft/TypeScript/issues/57827#issuecomment-2270348292
typescript playground linkhttps://www.typescriptlang.org/play/?ts=5.5.4&ssl=21&ssc=44&pln=22&pc=10#code/PTAEHUFMBsGMHsC2lQBd5oBYoCoE8AHSAZVgCcBLA1UABWgEM8BzM+AVwDsATAGiwoBnUENANQAd0gAjQRVSQAUCEmYKsTKGYUAbpGF4OY0BoadYKdJMoL+gzAzIoz3UNEiPOofEVKVqAHSKymAAmkYI7NCuqGqcANag8ABmIjQUXrFOKBJMggBcISGgoAC0oACCbvCwDKgU8JkY7p7ehCTkVDQS2E6gnPCxGcwmZqDSTgzxxWWVoASMFmgYkAAeRJTInN3ymj4d-jSCeNsMq-wuoPaOltigAKoASgAywhK7SbGQZIIz5VWCFzSeCrZagNYbChbHaxUDcCjJZLfSDbExIAgUdxkUBIursJzCFJtXydajBBCcQQ0MwAUVWDEQC0gADVHBQGNJ3KAALygABEAAkYNAMOB4GRonzFBTBPB3AERcwABS0+mM9ysygc9wASmCKhwzQ8ZC8iHFzmB7BoXzcZmY7AYzEg-Fg0HUiQ58D0Ii8fLpDKZgj5SWxfPADlQAHJhAA5SASPlBFQAeS+ZHegmdWkgR1QjgUrmkeFATjNOmGWH0KAQiGhwkuNok4uiIgMHGxCyYrA4PCCJUUqHaoH96pQvIA3qNM-lQJGAIyR-g6BjQdiQGecdiIaTfUAAX1AAB9QJPatPZwAmRegZer9dXVCUTgjA-H08Mc+RgDM19va5nwJyh4Xh7sEyRcLA9SNGg+ioAAPDg4KrAoPDCLQ7pwSOTL8JGZ6QJGAB8BFKskFAwNwM44AA2rhH74QAujqM50o+DCQZharYd4BEnooJQlII7yoBoJFkdEOq8fxUlTig86RjO458dJylOKg+JeO+n4LkuK7-qAc77gA3EpymgcpJR4Ze8mSeZUmqepJ4yTOkZXjpd4zrOVJPswkZ7sZtlmeZlnftZim2XZOYOZp95yW5emPmuRkmdJgXKdwkDJAwUSoIU4X8Vk8ASP08bDmQbBkEqepSaBe5AA
https://private-user-images.githubusercontent.com/9160551/355309189-1279b84a-1dba-4265-b100-ecdf5b3bcde5.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTUyNjI2ODUsIm5iZiI6MTc5NTI2MjM4NSwicGF0aCI6Ii85MTYwNTUxLzM1NTMwOTE4OS0xMjc5Yjg0YS0xZGJhLTQyNjUtYjEwMC1lY2RmNWIzYmNkZTUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MTEyMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjExMjFUMTE1OTQ1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NjQxZGNmMTE4NjhjZWM4ZjU5Y2NkNzc5Zjc5YjBhYjU2M2ZhNDdmNDJiNTc4NTFlNzI2NjQyZDU0Yjk2YmFkMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.ru9yJoP_Qf_zkzuoFObrfoPIXHy5abciu4gakc5bc7E
https://github.com/harry0000
harry (harry0000)https://github.com/harry0000
on Sep 11, 2024https://github.com/microsoft/TypeScript/issues/57827#issuecomment-2342507604
playgroundhttps://www.typescriptlang.org/play/?ts=5.6.2#code/MYewdgzgLgBAJgQygmBeGBv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DK6MwQs0posaa1xKnq3Hxmw6AFcwDKyOAYB0QCBefyoILhSrqY18QAKABuCL1mjtPLq+IAlJh5P9NXUJq74e6AHQUYlcXBAA
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/57827
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/57827
Wesley Wigham (weswigham)https://github.com/weswigham
Needs InvestigationThis issue needs a team member to investigate its status.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%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.