René's URL Explorer Experiment


Title: Removing optional modifier in homomorphic mapped types does not work in generic contexts since 5.5.x · Issue #59902 · microsoft/TypeScript · GitHub

Open Graph Title: Removing optional modifier in homomorphic mapped types does not work in generic contexts since 5.5.x · Issue #59902 · microsoft/TypeScript

X Title: Removing optional modifier in homomorphic mapped types does not work in generic contexts since 5.5.x · Issue #59902 · microsoft/TypeScript

Description: 🔎 Search Terms optional modifier, required fields, generic, NonNullable, strictNullChecks, homomorphic mapped types 🕗 Version & Regression Information This changed between versions 5.4.5 and 5.5.2 This changed in commit or PR e418f8d (as...

Open Graph Description: 🔎 Search Terms optional modifier, required fields, generic, NonNullable, strictNullChecks, homomorphic mapped types 🕗 Version & Regression Information This changed between versions 5.4.5 and 5.5.2 ...

X Description: 🔎 Search Terms optional modifier, required fields, generic, NonNullable, strictNullChecks, homomorphic mapped types 🕗 Version & Regression Information This changed between versions 5.4.5 and 5....

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Removing optional modifier in homomorphic mapped types does not work in generic contexts since 5.5.x","articleBody":"### 🔎 Search Terms\r\n\r\noptional modifier, required fields, generic, NonNullable, strictNullChecks, homomorphic mapped types\r\n\r\n### 🕗 Version & Regression Information\r\n\r\n- This changed between versions 5.4.5 and 5.5.2\r\n- This changed in commit or PR e418f8d12c5f1b6c10fc3127764f34dad44d4586 (as reported by `every-ts`)\r\n\r\n\r\n### ⏯ Playground Link\r\n\r\nhttps://www.typescriptlang.org/play/?ts=5.5.4#code/MYewdgzgLgBApgDwIYFsAOAbOMC8MA8AKvAlHGACYQzQBOAlmAOYB8AFAJQBcMSYAnrhYwA3gCgYMAPRSYAJTiYkwRkxgB3elAAWvATTRwVAM3rAaAVwBGAWij9DMEMZgADOqtcwUSANZxqHWx7Q2pQWlojWCQmJEYAOglpWRDsYjwPZgBuMSTUmABlEBQ4AHk0KHpwJAxcURgAbX9BRhhCAF0Afh4ARhgAXxzJPIdsAEEMDAUARwt6SIo6kUbmmFbm50LisoqqsBr2m26YPsHcyXyZuYWANRqLALqJqbhZ+bgKJrh+Teer94o7RySRkMAAwsUlIxqK0AKzxAAs8QQABoYFYLLBTGBsHD4vCEElQJBYAgeP9bvdHngLJQ4NiPucYJEoBZaGAYAgcoMgA\r\n\r\n### 💻 Code\r\n\r\n```ts\r\nconst example = \u003cT extends string>(): any => {\r\n  // Replacing with any specific sub-type of `string` makes the types correct again.\r\n  // type T = string;\r\n\r\n  type SomeOptional = { [key in T]?: 1 };\r\n  \r\n  type AllRequired = { [key in keyof SomeOptional]-?: 1 };\r\n\r\n  type RequiredValues = AllRequired[keyof AllRequired];\r\n\r\n  // Complains in 5.4.x, but fine in 5.5.x\r\n  const x: RequiredValues = undefined\r\n\r\n  return x;\r\n};\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\nUsing `-?` leaves the fields marked as optional, and taking the values of the resulting type gives a union with `undefined`.\r\n\r\n### 🙂 Expected behavior\r\n\r\nUsing `-?` makes all fields required, and taking the values of the resulting type gives a union of field types.\r\n\r\n### Additional information about the issue\r\n\r\nRequires a `--strictNullChecks`  flag.\r\n\r\nReplacing `keyof SomeOptional` with `NonNullable\u003ckeyof SomeOptional>` or `keyof SomeOptional as keyof SomeOptional` fixes the issue. It looks like this problem is limited to homomorphic mapped types.\r\n\r\nUsing `Required\u003c{ [P in keyof SomeOptional]: 1; }>` in place of `{ [key in keyof SomeOptional]-?: 1 }` results in the same behaviour.","author":{"url":"https://github.com/Fullfungo","@type":"Person","name":"Fullfungo"},"datePublished":"2024-09-09T11:52:07Z","url":"https://github.com/microsoft/TypeScript/issues/59902"}

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:9894ca74-474b-f80a-f200-528686d221f6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBD9E:AC748:962D10:C15360:6B0510A8
html-safe-noncefb32244a29e3910fbbd18ce5f7ca385cbd5804693ecb73d67134379044596b6b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDlFOkFDNzQ4Ojk2MkQxMDpDMTUzNjA6NkIwNTEwQTgiLCJ2aXNpdG9yX2lkIjoiODIyNzE0MjM4NzA4OTM0NjcyOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf0022cb7574df8698e48c69060121d25fd0b51fb079b2811162e3ae51aea4580
hovercard-subject-tagissue:2513747262
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/59902/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2a35b274d1134d2b0be4e534949d51798ccc93062bface321e35451af99b1fdc/microsoft/TypeScript/issues/59902
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2a35b274d1134d2b0be4e534949d51798ccc93062bface321e35451af99b1fdc/microsoft/TypeScript/issues/59902
og:image:alt🔎 Search Terms optional modifier, required fields, generic, NonNullable, strictNullChecks, homomorphic mapped types 🕗 Version & Regression Information This changed between versions 5.4.5 and 5.5.2 ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameFullfungo
hostnamegithub.com
expected-hostnamegithub.com
None854d880890b5e847b3fce9d1b31f032107baeddeebad2aa379c48aa4f1451f6b
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
release220e980097d94ce616d5d11fbd5316d208e3fc93
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/59902#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F59902
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%2F59902
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/59902
Reloadhttps://github.com/microsoft/TypeScript/issues/59902
Reloadhttps://github.com/microsoft/TypeScript/issues/59902
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests321 (321)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/59902
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/59902
Removing optional modifier in homomorphic mapped types does not work in generic contexts since 5.5.xhttps://github.com/microsoft/TypeScript/issues/59902#top
https://github.com/ahejlsberg
Bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Domain: Mapped Typeshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20Mapped%20Types%22
TypeScript 5.7.0https://github.com/microsoft/TypeScript/milestone/208
https://github.com/Fullfungo
Fullfungohttps://github.com/Fullfungo
on Sep 9, 2024https://github.com/microsoft/TypeScript/issues/59902#issue-2513747262
e418f8dhttps://github.com/microsoft/TypeScript/commit/e418f8d12c5f1b6c10fc3127764f34dad44d4586
https://www.typescriptlang.org/play/?ts=5.5.4#code/MYewdgzgLgBApgDwIYFsAOAbOMC8MA8AKvAlHGACYQzQBOAlmAOYB8AFAJQBcMSYAnrhYwA3gCgYMAPRSYAJTiYkwRkxgB3elAAWvATTRwVAM3rAaAVwBGAWij9DMEMZgADOqtcwUSANZxqHWx7Q2pQWlojWCQmJEYAOglpWRDsYjwPZgBuMSTUmABlEBQ4AHk0KHpwJAxcURgAbX9BRhhCAF0Afh4ARhgAXxzJPIdsAEEMDAUARwt6SIo6kUbmmFbm50LisoqqsBr2m26YPsHcyXyZuYWANRqLALqJqbhZ+bgKJrh+Teer94o7RySRkMAAwsUlIxqK0AKzxAAs8QQABoYFYLLBTGBsHD4vCEElQJBYAgeP9bvdHngLJQ4NiPucYJEoBZaGAYAgcoMgAhttps://www.typescriptlang.org/play/?ts=5.5.4#code/MYewdgzgLgBApgDwIYFsAOAbOMC8MA8AKvAlHGACYQzQBOAlmAOYB8AFAJQBcMSYAnrhYwA3gCgYMAPRSYAJTiYkwRkxgB3elAAWvATTRwVAM3rAaAVwBGAWij9DMEMZgADOqtcwUSANZxqHWx7Q2pQWlojWCQmJEYAOglpWRDsYjwPZgBuMSTUmABlEBQ4AHk0KHpwJAxcURgAbX9BRhhCAF0Afh4ARhgAXxzJPIdsAEEMDAUARwt6SIo6kUbmmFbm50LisoqqsBr2m26YPsHcyXyZuYWANRqLALqJqbhZ+bgKJrh+Teer94o7RySRkMAAwsUlIxqK0AKzxAAs8QQABoYFYLLBTGBsHD4vCEElQJBYAgeP9bvdHngLJQ4NiPucYJEoBZaGAYAgcoMgA
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Sep 9, 2024https://github.com/microsoft/TypeScript/issues/59902#event-14187623360
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
on Sep 9, 2024https://github.com/microsoft/TypeScript/issues/59902#event-14187623800
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 5.7.0https://github.com/microsoft/TypeScript/milestone/208
on Sep 9, 2024https://github.com/microsoft/TypeScript/issues/59902#event-14187625015
TypeScript Bot (typescript-bot)https://github.com/typescript-bot
Fix Availablehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
on Sep 10, 2024https://github.com/microsoft/TypeScript/issues/59902#event-14193765541
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Domain: Mapped Typeshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20Mapped%20Types%22
on Oct 16, 2025https://github.com/microsoft/TypeScript/issues/59902#event-20330973147
Jake Bailey (jakebailey)https://github.com/jakebailey
Fix Availablehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
on Aug 20, 2026https://github.com/microsoft/TypeScript/issues/59902#event-29770106466
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/59902
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/59902
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Domain: Mapped Typeshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20Mapped%20Types%22
TypeScript 5.7.0https://github.com/microsoft/TypeScript/milestone/208
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.