René's URL Explorer Experiment


Title: Intersection Types that have overlapping properties can fail · Issue #49264 · microsoft/TypeScript · GitHub

Open Graph Title: Intersection Types that have overlapping properties can fail · Issue #49264 · microsoft/TypeScript

X Title: Intersection Types that have overlapping properties can fail · Issue #49264 · microsoft/TypeScript

Description: This seems to be the source: #31838 Example: Try an intersection of 2 types where the same property has inconsistent overlapping types: type Bar = { Prop: string }; type Works = Bar & {Prop: number}; // Bar & {Prop: number} type ThisIsNe...

Open Graph Description: This seems to be the source: #31838 Example: Try an intersection of 2 types where the same property has inconsistent overlapping types: type Bar = { Prop: string }; type Works = Bar & {Prop: number...

X Description: This seems to be the source: #31838 Example: Try an intersection of 2 types where the same property has inconsistent overlapping types: type Bar = { Prop: string }; type Works = Bar & {Prop: nu...

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

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":"Intersection Types that have overlapping properties can fail","articleBody":"This seems to be the source: https://github.com/microsoft/TypeScript/pull/31838\r\n\r\nExample:\r\nTry an intersection of 2 types where the same property has inconsistent overlapping types:\r\n\r\n```\r\ntype Bar = {\r\n    Prop: string\r\n};\r\n\r\ntype Works = Bar & {Prop: number}; // Bar & {Prop: number}\r\ntype ThisIsNever = Bar & {Prop: null}; // never\r\n```\r\n\r\nIt makes sense to me that individual types can be reduced to never, but why can intersecting types with nested overlapping property types get reduced to `never`?\r\n\r\nPlayground link: https://www.typescriptlang.org/play?ts=4.7.0-beta#code/C4TwDgpgBAQghgJygXigbwFBW1ACggezAC4oBnYBASwDsBzDAXwG4MMB6dqAdQIQGsyUAGa0IGUJCgBJGsAgIyEAMbAqBGiliIoAMnT4ipGgFcAtgCMFLKJ21J9aQySinL1ieGgA5CADcFWXlFFTUNLXgHA0IXGn9rZlsuSL1oo1d4hEY2O28CYCgIAA9IVQgAE08pbxMAG1qghSVVdU1UFMdnYzramzsAJRUIKgDy40ykqABREtCK0gADDrTYnsYFqAAKPiglnU6Y8YCshYBKKugAVRpyiFE48saQlvD2-ZXSExu7sXK+rkGymGoyOCkmM1K8jGu2WTkOUC+t3uFXWWx2eyicPScWO63OQA\r\n\r\nThis might be expected, but it does feel like a bug to me. My initial use case was joining a few different types together to get a union of all their keys. But since some props had a `null | undefined` type, it was reduced to `never`. Causing my use of those keys to fail unexpectedly. I would expect `ThisIsNever` to have a `Prop: never` property instead, or maybe a union of `string | null`. Or at-least surface an error saying the union is not possible because of `Prop` being incompatible.\r\n\r\nTested on: 4.6.4, 4.7.0-beta\r\nThis worked as expected in: v3.8.3.  And starts not being expected in v3.9.7","author":{"url":"https://github.com/wdamien","@type":"Person","name":"wdamien"},"datePublished":"2022-05-26T18:23:57Z","url":"https://github.com/microsoft/TypeScript/issues/49264"}

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:3630aeb3-8c65-1fb5-c6a6-836c4cef4cce
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8836:1612C1:A72DDF:E380F6:6B04832C
html-safe-nonce42cf7cd89c2a92a66e7bc030a054164b8ec3a7e90e3d4e6cf7a82765b0d77550
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODM2OjE2MTJDMTpBNzJEREY6RTM4MEY2OjZCMDQ4MzJDIiwidmlzaXRvcl9pZCI6Ijc4NzQ5NzI4MDcwMzIyNDI5ODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac1621e6e4abe85ab6c00a21b8cd6bfa7cecd7db077074c65cf090a3d8d3370c8c
hovercard-subject-tagissue:1249901212
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/49264/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1f3e837b4a736da266706339824b176da71f6e8e3f155c996a6fb17983ba33ae/microsoft/TypeScript/issues/49264
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1f3e837b4a736da266706339824b176da71f6e8e3f155c996a6fb17983ba33ae/microsoft/TypeScript/issues/49264
og:image:altThis seems to be the source: #31838 Example: Try an intersection of 2 types where the same property has inconsistent overlapping types: type Bar = { Prop: string }; type Works = Bar & {Prop: number...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamewdamien
hostnamegithub.com
expected-hostnamegithub.com
None1d5c152376e38b7d2e37f3d5179be29a73bee93b85110da28a4eebe1159cdc70
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
releasef5017e8ff4ea25a8011fcf0f2a0e430c60dc86c8
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/49264#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F49264
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%2F49264
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/49264
Reloadhttps://github.com/microsoft/TypeScript/issues/49264
Reloadhttps://github.com/microsoft/TypeScript/issues/49264
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests319 (319)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/49264
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/49264
Intersection Types that have overlapping properties can failhttps://github.com/microsoft/TypeScript/issues/49264#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/wdamien
Wes Gorgichuk (wdamien)https://github.com/wdamien
on May 26, 2022https://github.com/microsoft/TypeScript/issues/49264#issue-1249901212
#31838https://github.com/microsoft/TypeScript/pull/31838
https://www.typescriptlang.org/play?ts=4.7.0-beta#code/C4TwDgpgBAQghgJygXigbwFBW1ACggezAC4oBnYBASwDsBzDAXwG4MMB6dqAdQIQGsyUAGa0IGUJCgBJGsAgIyEAMbAqBGiliIoAMnT4ipGgFcAtgCMFLKJ21J9aQySinL1ieGgA5CADcFWXlFFTUNLXgHA0IXGn9rZlsuSL1oo1d4hEY2O28CYCgIAA9IVQgAE08pbxMAG1qghSVVdU1UFMdnYzramzsAJRUIKgDy40ykqABREtCK0gADDrTYnsYFqAAKPiglnU6Y8YCshYBKKugAVRpyiFE48saQlvD2-ZXSExu7sXK+rkGymGoyOCkmM1K8jGu2WTkOUC+t3uFXWWx2eyicPScWO63OQAhttps://www.typescriptlang.org/play?ts=4.7.0-beta#code/C4TwDgpgBAQghgJygXigbwFBW1ACggezAC4oBnYBASwDsBzDAXwG4MMB6dqAdQIQGsyUAGa0IGUJCgBJGsAgIyEAMbAqBGiliIoAMnT4ipGgFcAtgCMFLKJ21J9aQySinL1ieGgA5CADcFWXlFFTUNLXgHA0IXGn9rZlsuSL1oo1d4hEY2O28CYCgIAA9IVQgAE08pbxMAG1qghSVVdU1UFMdnYzramzsAJRUIKgDy40ykqABREtCK0gADDrTYnsYFqAAKPiglnU6Y8YCshYBKKugAVRpyiFE48saQlvD2-ZXSExu7sXK+rkGymGoyOCkmM1K8jGu2WTkOUC+t3uFXWWx2eyicPScWO63OQA
https://github.com/jcalz
Joe Calzaretta (jcalz)https://github.com/jcalz
on May 26, 2022https://github.com/microsoft/TypeScript/issues/49264#issuecomment-1138909718
#36696https://github.com/microsoft/TypeScript/pull/36696
intersections are reduced by discriminant properties.https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html#intersections-reduced-by-discriminant-properties
a property whose member types contain at least one unit/singleton type are considered discriminant propertieshttps://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-2.html#non-unit-types-as-union-discriminants
Andrew Branch (andrewbranch)https://github.com/andrewbranch
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 May 26, 2022https://github.com/microsoft/TypeScript/issues/49264#event-6687786196
https://github.com/fatcerberus
Bruce Pascoe (fatcerberus)https://github.com/fatcerberus
on May 26, 2022https://github.com/microsoft/TypeScript/issues/49264#issuecomment-1139100959
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on May 26, 2022https://github.com/microsoft/TypeScript/issues/49264#issuecomment-1139113755
https://github.com/typescript-bot
TypeScript Bot (typescript-bot)https://github.com/typescript-bot
on May 29, 2022https://github.com/microsoft/TypeScript/issues/49264#issuecomment-1140515438
TypeScript Bot (typescript-bot)https://github.com/typescript-bot
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 29, 2022https://github.com/microsoft/TypeScript/issues/49264#event-6698699750
microsofthttps://github.com/microsoft
on Oct 22, 2025https://github.com/microsoft/TypeScript/issues/49264#event-20417546288
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/49264
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/49264
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

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.