René's URL Explorer Experiment


Title: Regression in 3.6: Combination of union and intersection types with literal types not resolving specific types properly · Issue #33448 · microsoft/TypeScript · GitHub

Open Graph Title: Regression in 3.6: Combination of union and intersection types with literal types not resolving specific types properly · Issue #33448 · microsoft/TypeScript

X Title: Regression in 3.6: Combination of union and intersection types with literal types not resolving specific types properly · Issue #33448 · microsoft/TypeScript

Description: TypeScript Version: 3.6.2 and 3.6.3 Search Terms: union types, intersection types, literal types Code type a = { type: 'a', data: string } type b = { type: 'b', name: string } type c = { type: 'c', other: string } type abc = a | b | c; f...

Open Graph Description: TypeScript Version: 3.6.2 and 3.6.3 Search Terms: union types, intersection types, literal types Code type a = { type: 'a', data: string } type b = { type: 'b', name: string } type c = { type: 'c',...

X Description: TypeScript Version: 3.6.2 and 3.6.3 Search Terms: union types, intersection types, literal types Code type a = { type: 'a', data: string } type b = { type: 'b', name: string } type ...

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

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":"Regression in 3.6: Combination of union and intersection types with literal types not resolving specific types properly","articleBody":"\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. (done) -->\r\n**TypeScript Version:**  `3.6.2` and `3.6.3`\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** union types, intersection types, literal types\r\n\r\n**Code**\r\n\r\n```ts\r\ntype a = {\r\n    type: 'a',\r\n    data: string\r\n}\r\ntype b = {\r\n    type: 'b',\r\n    name: string\r\n}\r\ntype c = {\r\n    type: 'c',\r\n    other: string\r\n}\r\ntype abc = a | b | c;\r\nfunction f(problem: abc & (b | c)) {\r\n    if (problem.type === 'b') {\r\n        console.log(problem.name);\r\n    } else {\r\n        console.log(problem.other);\r\n    }\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\nTypeScript not to complain about the typings.\r\n\r\n**Actual behavior:**\r\nIn the `f` function, TypeScript says that `problem` may not have `name` because type `Property 'name' does not exist on type 'a & c'`, but `a` and `c` are mutually exclusive types and therefore not possible. It also complains that `problem` may not have `other` because `Property 'other' does not exist on type 'a & b'`, but due to the if/else, it's not possible for `problem` to be of type `b`, and in fact the only possible type for it is `c`.\r\n\r\n**Playground Link:** Since the playground is still on 3.5.1, this issue is not reproducible there. Here's a link to the example I posted above in the playground (though it is passing): https://www.typescriptlang.org/play/#code/C4TwDgpgBAhlC8UDeAoK6qkgLigchjwBo0MATGYGXAZ2ACcBLAOwHMUBfFLaAIwWSl0PXHl7EhUZjAC2EWgxbsuPKAGMBqDJnDz8aidoD2wABYR6Cpm07ddsXhsRwAPlH5u1AbhQAzAK7MasCMRsxQvgAUYPRGvAA2EDK4MI5QAGRQkR7qAJS5gtqMvlkxcYkyAHSq8LX44gVa2hhqYTRGiZXxRqzRsQlJldJyuT7aHFAQ8TTQTc3qbR0QXT195YMm5vSjklxcQA\r\n\r\n**Related Issues:** https://github.com/microsoft/TypeScript/issues/33101 looked like it *might* be related, can't quite tell.\r\n","author":{"url":"https://github.com/ReinAkane","@type":"Person","name":"ReinAkane"},"datePublished":"2019-09-16T14:38:06Z","url":"https://github.com/microsoft/TypeScript/issues/33448"}

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:19f3e472-55bc-d93e-5592-4a0d97b874af
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB04E:2BA76E:580022:7ABB53:6B0481D2
html-safe-noncedae24ddbf9a1d1ae934e4380b7ec60d4c52246280fc5be6e22855586e0742909
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDRFOjJCQTc2RTo1ODAwMjI6N0FCQjUzOjZCMDQ4MUQyIiwidmlzaXRvcl9pZCI6IjE4MDk0ODYxODE5MTQ5MzU3NjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd30c57eff7b0810f7dfab744f084803af7865fe7f0d91d35642f8d3a7cc52a1d
hovercard-subject-tagissue:494092562
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/33448/issue_layout
twitter:imagehttps://opengraph.githubassets.com/42a2ca6ddb419f6d168a8579e14d3a7a380800235233921b9e2cafe2dfd8bed9/microsoft/TypeScript/issues/33448
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/42a2ca6ddb419f6d168a8579e14d3a7a380800235233921b9e2cafe2dfd8bed9/microsoft/TypeScript/issues/33448
og:image:altTypeScript Version: 3.6.2 and 3.6.3 Search Terms: union types, intersection types, literal types Code type a = { type: 'a', data: string } type b = { type: 'b', name: string } type c = { type: 'c',...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameReinAkane
hostnamegithub.com
expected-hostnamegithub.com
None0366ddfb372682a32e92a5d86155cb08fa83e5bbe79953a968789f2f7e24c511
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
releaseed3f2e01f6b7672780c586c8af0e72726374d7b6
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/33448#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F33448
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%2F33448
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/33448
Reloadhttps://github.com/microsoft/TypeScript/issues/33448
Reloadhttps://github.com/microsoft/TypeScript/issues/33448
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/33448
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/33448
#35513https://github.com/microsoft/TypeScript/pull/35513
Regression in 3.6: Combination of union and intersection types with literal types not resolving specific types properlyhttps://github.com/microsoft/TypeScript/issues/33448#top
#35513https://github.com/microsoft/TypeScript/pull/35513
https://github.com/ahejlsberg
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 3.8.0https://github.com/microsoft/TypeScript/milestone/102
https://github.com/ReinAkane
Rein Akane (ReinAkane)https://github.com/ReinAkane
on Sep 16, 2019https://github.com/microsoft/TypeScript/issues/33448#issue-494092562
https://www.typescriptlang.org/play/#code/C4TwDgpgBAhlC8UDeAoK6qkgLigchjwBo0MATGYGXAZ2ACcBLAOwHMUBfFLaAIwWSl0PXHl7EhUZjAC2EWgxbsuPKAGMBqDJnDz8aidoD2wABYR6Cpm07ddsXhsRwAPlH5u1AbhQAzAK7MasCMRsxQvgAUYPRGvAA2EDK4MI5QAGRQkR7qAJS5gtqMvlkxcYkyAHSq8LX44gVa2hhqYTRGiZXxRqzRsQlJldJyuT7aHFAQ8TTQTc3qbR0QXT195YMm5vSjklxcQAhttps://www.typescriptlang.org/play/#code/C4TwDgpgBAhlC8UDeAoK6qkgLigchjwBo0MATGYGXAZ2ACcBLAOwHMUBfFLaAIwWSl0PXHl7EhUZjAC2EWgxbsuPKAGMBqDJnDz8aidoD2wABYR6Cpm07ddsXhsRwAPlH5u1AbhQAzAK7MasCMRsxQvgAUYPRGvAA2EDK4MI5QAGRQkR7qAJS5gtqMvlkxcYkyAHSq8LX44gVa2hhqYTRGiZXxRqzRsQlJldJyuT7aHFAQ8TTQTc3qbR0QXT195YMm5vSjklxcQA
#33101https://github.com/microsoft/TypeScript/issues/33101
Rein Akane (ReinAkane)https://github.com/ReinAkane
on Sep 16, 2019https://github.com/microsoft/TypeScript/issues/33448#event-2636651833
https://github.com/jack-williams
Jack Williams (jack-williams)https://github.com/jack-williams
on Sep 16, 2019https://github.com/microsoft/TypeScript/issues/33448#issuecomment-531814011
#31838https://github.com/microsoft/TypeScript/pull/31838
#31838https://github.com/microsoft/TypeScript/pull/31838
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 Sep 16, 2019https://github.com/microsoft/TypeScript/issues/33448#event-2636942720
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
on Sep 16, 2019https://github.com/microsoft/TypeScript/issues/33448#event-2636942857
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 3.7.0https://github.com/microsoft/TypeScript/milestone/98
on Sep 16, 2019https://github.com/microsoft/TypeScript/issues/33448#event-2636942988
https://github.com/jack-williams
Jack Williams (jack-williams)https://github.com/jack-williams
on Sep 16, 2019https://github.com/microsoft/TypeScript/issues/33448#issuecomment-531933363
https://github.com/jack-williams
Jack Williams (jack-williams)https://github.com/jack-williams
on Sep 18, 2019https://github.com/microsoft/TypeScript/issues/33448#issuecomment-532815872
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 3.7.0https://github.com/microsoft/TypeScript/milestone/98
TypeScript 3.7.1https://github.com/microsoft/TypeScript/milestone/105
on Oct 14, 2019https://github.com/microsoft/TypeScript/issues/33448#event-2711288545
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 3.7.1https://github.com/microsoft/TypeScript/milestone/105
TypeScript 3.8.0https://github.com/microsoft/TypeScript/milestone/102
on Oct 29, 2019https://github.com/microsoft/TypeScript/issues/33448#event-2752753970
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
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
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 Dec 5, 2019https://github.com/microsoft/TypeScript/issues/33448#event-2856094758
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#35513https://github.com/microsoft/TypeScript/pull/35513
on Dec 12, 2019https://github.com/microsoft/TypeScript/issues/33448#event-2878181312
microsofthttps://github.com/microsoft
on Oct 21, 2025https://github.com/microsoft/TypeScript/issues/33448#event-20416779045
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/33448
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/33448
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
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 3.8.0https://github.com/microsoft/TypeScript/milestone/102
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.