René's URL Explorer Experiment


Title: Inconsistent behaviour of `-?` · Issue #59948 · microsoft/TypeScript · GitHub

Open Graph Title: Inconsistent behaviour of `-?` · Issue #59948 · microsoft/TypeScript

X Title: Inconsistent behaviour of `-?` · Issue #59948 · microsoft/TypeScript

Description: 🔎 Search Terms optional mapped type 🕗 Version & Regression Information This changed between versions 5.4.5 and 5.5.4 ⏯ Playground Link https://www.typescriptlang.org/play/?exactOptionalPropertyTypes=true#code/C4TwDgpgBA8mwEsD2A7AhgGwCpIK...

Open Graph Description: 🔎 Search Terms optional mapped type 🕗 Version & Regression Information This changed between versions 5.4.5 and 5.5.4 ⏯ Playground Link https://www.typescriptlang.org/play/?exactOptionalPropertyType...

X Description: 🔎 Search Terms optional mapped type 🕗 Version & Regression Information This changed between versions 5.4.5 and 5.5.4 ⏯ Playground Link https://www.typescriptlang.org/play/?exactOptionalProperty...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inconsistent behaviour of `-?`","articleBody":"### 🔎 Search Terms\n\noptional mapped type\n\n### 🕗 Version & Regression Information\n\n- This changed between versions 5.4.5 and 5.5.4\n\n\n### ⏯ Playground Link\n\nhttps://www.typescriptlang.org/play/?exactOptionalPropertyTypes=true#code/C4TwDgpgBA8mwEsD2A7AhgGwCpIKouRQHUFgALfAEwgDMEUJKAeLAPigF4oBvAKCgFQA2gGko9KAGsIIJDShYAugC4FUCAA9gEFJQDOUAEoQAxkgBOzEQBoFoxa36DnAfjsjFT5wNVZ7UAB8oAFddWnpGXgBfXl5QSCgASRRtcwBbBEoENG1OWHhCTBx8QhJyKnCGZm4oNBdVPWBzegBzKCj2AHpOnlr6qEbmlDag0Oo6Kva48GgAGVIIc0w8mrqGptbAkLCJxnaoboG0NOh46DQDZNSMrJyIWLOjCD0ARjzjAEdghHNGJivFjdstouj1Vushm0Yo9jHoAEzvCBfH5-eapTCg3poCGbUY7CKUdpAA\n\n### 💻 Code\n\n```ts\ntype OptionalToUnionWithUndefined\u003cT> = {\n    [K in keyof T]: T extends Record\u003cK, T[K]>\n        ? T[K]\n        : T[K] | undefined\n}\n\ntype Intermediate = OptionalToUnionWithUndefined\u003c{ a?: string }> // { a?: string | undefined }\ntype Literal = { a?: string | undefined } // same type as Intermediate\n\ntype Res1 = Required\u003cIntermediate> // { a: string }\ntype Res2 = Required\u003cLiteral> // { a: string | undefined }\n```\n\n\n### 🙁 Actual behavior\n\n`Res1` and `Res2` are different types\n\n### 🙂 Expected behavior\n\nthey should be the same because the inputs are\n\n### Additional information about the issue\n\nThis issue may share the cause with #59902 ","author":{"url":"https://github.com/m-shaka","@type":"Person","name":"m-shaka"},"datePublished":"2024-09-12T08:39:47Z","url":"https://github.com/microsoft/TypeScript/issues/59948"}

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:a83dbdd4-0c2d-462d-ad7f-56b1c95b6fce
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9582:143D5D:DC78EF:1244272:6B050821
html-safe-nonce6e8567055574fe2fb7c3dba743aa40e8ded1345299f0956dd2f982aa14b8254b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTgyOjE0M0Q1RDpEQzc4RUY6MTI0NDI3Mjo2QjA1MDgyMSIsInZpc2l0b3JfaWQiOiI1ODE3NTA1NDMyOTY4OTU1OTM3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac74417129283aa92542f93bce1f43c0417849da0924d27626a0ea4972d8981997
hovercard-subject-tagissue:2521743115
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/59948/issue_layout
twitter:imagehttps://opengraph.githubassets.com/75ac82ef6cd51580f443bf16cc1d7aa7717d631c5933b5fb91621d883a7982b6/microsoft/TypeScript/issues/59948
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/75ac82ef6cd51580f443bf16cc1d7aa7717d631c5933b5fb91621d883a7982b6/microsoft/TypeScript/issues/59948
og:image:alt🔎 Search Terms optional mapped type 🕗 Version & Regression Information This changed between versions 5.4.5 and 5.5.4 ⏯ Playground Link https://www.typescriptlang.org/play/?exactOptionalPropertyType...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamem-shaka
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/59948#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F59948
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%2F59948
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/59948
Reloadhttps://github.com/microsoft/TypeScript/issues/59948
Reloadhttps://github.com/microsoft/TypeScript/issues/59948
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests320 (320)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/59948
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/59948
#64100https://github.com/microsoft/TypeScript/pull/64100
Inconsistent behaviour of -?https://github.com/microsoft/TypeScript/issues/59948#top
#64100https://github.com/microsoft/TypeScript/pull/64100
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
Backloghttps://github.com/microsoft/TypeScript/milestone/29
https://github.com/m-shaka
m-shakahttps://github.com/m-shaka
on Sep 12, 2024https://github.com/microsoft/TypeScript/issues/59948#issue-2521743115
https://www.typescriptlang.org/play/?exactOptionalPropertyTypes=true#code/C4TwDgpgBA8mwEsD2A7AhgGwCpIKouRQHUFgALfAEwgDMEUJKAeLAPigF4oBvAKCgFQA2gGko9KAGsIIJDShYAugC4FUCAA9gEFJQDOUAEoQAxkgBOzEQBoFoxa36DnAfjsjFT5wNVZ7UAB8oAFddWnpGXgBfXl5QSCgASRRtcwBbBEoENG1OWHhCTBx8QhJyKnCGZm4oNBdVPWBzegBzKCj2AHpOnlr6qEbmlDag0Oo6Kva48GgAGVIIc0w8mrqGptbAkLCJxnaoboG0NOh46DQDZNSMrJyIWLOjCD0ARjzjAEdghHNGJivFjdstouj1Vushm0Yo9jHoAEzvCBfH5-eapTCg3poCGbUY7CKUdpAAhttps://www.typescriptlang.org/play/?exactOptionalPropertyTypes=true#code/C4TwDgpgBA8mwEsD2A7AhgGwCpIKouRQHUFgALfAEwgDMEUJKAeLAPigF4oBvAKCgFQA2gGko9KAGsIIJDShYAugC4FUCAA9gEFJQDOUAEoQAxkgBOzEQBoFoxa36DnAfjsjFT5wNVZ7UAB8oAFddWnpGXgBfXl5QSCgASRRtcwBbBEoENG1OWHhCTBx8QhJyKnCGZm4oNBdVPWBzegBzKCj2AHpOnlr6qEbmlDag0Oo6Kva48GgAGVIIc0w8mrqGptbAkLCJxnaoboG0NOh46DQDZNSMrJyIWLOjCD0ARjzjAEdghHNGJivFjdstouj1Vushm0Yo9jHoAEzvCBfH5-eapTCg3poCGbUY7CKUdpAA
#59902https://github.com/microsoft/TypeScript/issues/59902
https://github.com/Fullfungo
Fullfungohttps://github.com/Fullfungo
on Sep 12, 2024https://github.com/microsoft/TypeScript/issues/59948#issuecomment-2346167904
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Sep 12, 2024https://github.com/microsoft/TypeScript/issues/59948#issuecomment-2346620970
https://github.com/Fullfungo
Fullfungohttps://github.com/Fullfungo
on Sep 12, 2024https://github.com/microsoft/TypeScript/issues/59948#issuecomment-2346626216
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Sep 12, 2024https://github.com/microsoft/TypeScript/issues/59948#issuecomment-2346646556
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Sep 12, 2024https://github.com/microsoft/TypeScript/issues/59948#event-14235242180
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Backloghttps://github.com/microsoft/TypeScript/milestone/29
on Sep 12, 2024https://github.com/microsoft/TypeScript/issues/59948#event-14235242671
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Help Wantedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Help%20Wanted%22
on Sep 12, 2024https://github.com/microsoft/TypeScript/issues/59948#event-14235243819
https://github.com/mkantor
Matt Kantor (mkantor)https://github.com/mkantor
on Apr 25, 2025https://github.com/microsoft/TypeScript/issues/59948#issuecomment-2830706165
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
your example has a type errorhttps://www.typescriptlang.org/play/?ts=5.5.4#code/C4TwDgpgBA8mwEsD2A7AhgGwCpIKouRQHUFgALfAEwgDMEUJKAeLAPigF4oBvAKCgFQA2gGko9KAGsIIJDShYAugC4FUCAA9gEFJQDOUAEoQAxkgBOzEQBoFoxa36DnAfjsjFT5wNVZ7UAB8oAFddWnpGXgBfXl5QSCgASRRtcwBbBEoENG1OWHhCTBx8QhJyKnCGZm4oNBdVPWBzegBzKCj2AHpOnlr6qEbmlDag0Oo6Kva48GgAWTyauoam1qn46AAZUghzTAW+5aGRkLCJxnaoboG0NOh12oNk1IysnIhY++M9AEY84wBHYIIcyMJhPHYvbLaLo9RaHVYxT4QPQAJj+EEBwNBW1SmBhvTQ8OGU141BMGDQIKgGAgwCg5lUX2+AG5eGYUI0oAArPLmAB0aFZV0EAD0XLErigkHSYCI2ahOWBGciUUIAORoNWKPJjSqMZlAA
Here's a reduced reproductionhttps://www.typescriptlang.org/play/?ts=5.5.4#code/C4TwDgpgBAglC8UDeUDaBpKBLAdlA1hCAPYBmyUAhgPwBcUAzsAE64DmUAvgLoC0djFuy4AoAPRioUgHrURoSFABCCChmx5CJcjG70mrHBwA+UAK44AJhFK4Il0RKlRZIkQGNiOJlABG9FUQUSnoLa1scey4oJxxiKAhmZmJmABooawYwLGBoBWhcUnjKX2IANwggA
https://github.com/m-shaka
m-shakahttps://github.com/m-shaka
on Apr 26, 2025https://github.com/microsoft/TypeScript/issues/59948#issuecomment-2831948460
Matt Kantor (@mkantor)https://github.com/mkantor
https://www.typescriptlang.org/play/?exactOptionalPropertyTypes=false&ts=5.5.4#code/PTAEG9QQwLlBnALgJwJYDsDmoA+oCu6AJgKYBmGJRoAvqKmaCQB5QDGiA8gA6KoD26KABsACsn7cSyRAE8AKrKnwAvCnwkAUCAjQ4SNFlr1GLdl14ChYiVJkKlJVWRHwtcqaHmgVoAEokAI74qMhUADyQUAD8+igY2HiEpBToVLQAfJqabIJIel4A2gDkUMUAuj4ExOSUREAhttps://www.typescriptlang.org/play/?exactOptionalPropertyTypes=false&ts=5.5.4#code/PTAEG9QQwLlBnALgJwJYDsDmoA+oCu6AJgKYBmGJRoAvqKmaCQB5QDGiA8gA6KoD26KABsACsn7cSyRAE8AKrKnwAvCnwkAUCAjQ4SNFlr1GLdl14ChYiVJkKlJVWRHwtcqaHmgVoAEokAI74qMhUADyQUAD8+igY2HiEpBToVLQAfJqabIJIel4A2gDkUMUAuj4ExOSUREA
https://github.com/mkantor
Matt Kantor (mkantor)https://github.com/mkantor
on Apr 26, 2025https://github.com/microsoft/TypeScript/issues/59948#issuecomment-2832038741
my latter reduced examplehttps://www.typescriptlang.org/play/?ts=5.5.4#code/C4TwDgpgBAglC8UDeUDaBpKBLAdlA1hCAPYBmyUAhgPwBcUAzsAE64DmUAvgLoC0djFuy4AoAPRioUgHrURoSFABCCChmx5CJcjG70mrHBwA+UAK44AJhFK4Il0RKlRZIkQGNiOJlABG9FUQUSnoLa1scey4oJxxiKAhmZmJmABooawYwLGBoBWhcUnjKX2IANwggA
#59957https://github.com/microsoft/TypeScript/pull/59957
#60411https://github.com/microsoft/TypeScript/issues/60411
https://github.com/m-shaka
m-shakahttps://github.com/m-shaka
on Apr 27, 2025https://github.com/microsoft/TypeScript/issues/59948#issuecomment-2832847568
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/59948#event-20330973347
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Help Wantedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Help%20Wanted%22
on Nov 10, 2026https://github.com/microsoft/TypeScript/issues/59948#event-35721456343
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/59948
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/59948
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
BacklogNo due datehttps://github.com/microsoft/TypeScript/milestone/29
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.