René's URL Explorer Experiment


Title: Infer between closely matching types in unions and intersections by ahejlsberg · Pull Request #32558 · microsoft/TypeScript · GitHub

Open Graph Title: Infer between closely matching types in unions and intersections by ahejlsberg · Pull Request #32558 · microsoft/TypeScript

X Title: Infer between closely matching types in unions and intersections by ahejlsberg · Pull Request #32558 · microsoft/TypeScript

Description: TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - Infer between closely matching types in unions and intersections by ahejlsberg · Pull Request #32558 · microsoft/TypeScript

Open Graph Description: This PR further extends the work in #32460. The complete rules for union and intersection type inference are summarized in the following. When inferring from a set of source types in a single type ...

X Description: This PR further extends the work in #32460. The complete rules for union and intersection type inference are summarized in the following. When inferring from a set of source types in a single type ...

Opengraph URL: https://github.com/microsoft/TypeScript/pull/32558

X: @github

direct link

Domain: github.com

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/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format)
route-controllervoltron_pull_requests_fragments
route-actionpull_request_layout
fetch-noncev2:1b5a4428-598b-fb90-6dab-1dc7b391c6e1
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD518:A71F9:52D8A1:67C5A0:6B010DE8
html-safe-nonce9300817f5ef5b1275ecb38a5a3cd29e92e45e95dc9206f93fac6ff10649df3ec
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTE4OkE3MUY5OjUyRDhBMTo2N0M1QTA6NkIwMTBERTgiLCJ2aXNpdG9yX2lkIjoiODA5NTQzODQwMzY0MDM5NjU2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac9673f3247299ec969f7c45ff60a2c25a2e8d23c55738ea09cac7da512b8486e9
hovercard-subject-tagpull_request:301268462
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/pull_requests_fragments/pull_request_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/microsoft/TypeScript/32558/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/8da31c3a3192f24b5b02cc412f979ad1843149884a0749f6718a24e973085a00/microsoft/TypeScript/pull/32558
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8da31c3a3192f24b5b02cc412f979ad1843149884a0749f6718a24e973085a00/microsoft/TypeScript/pull/32558
og:image:altThis PR further extends the work in #32460. The complete rules for union and intersection type inference are summarized in the following. When inferring from a set of source types in a single type ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameahejlsberg
hostnamegithub.com
expected-hostnamegithub.com
Nonecb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124
turbo-cache-controlno-cache
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
release2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-namepull-requests

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/pull/32558#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fpull%2F32558
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%2Fpull%2F32558
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%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/pull/32558
Reloadhttps://github.com/microsoft/TypeScript/pull/32558
Reloadhttps://github.com/microsoft/TypeScript/pull/32558
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests310 (310)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
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
masterhttps://github.com/microsoft/TypeScript/tree/master
fix32247https://github.com/microsoft/TypeScript/tree/fix32247
Conversationhttps://github.com/microsoft/TypeScript/pull/32558
Commits10 (10)https://github.com/microsoft/TypeScript/pull/32558/commits
Checkshttps://github.com/microsoft/TypeScript/pull/32558/checks
Files changedhttps://github.com/microsoft/TypeScript/pull/32558/files
Infer between closely matching types in unions and intersectionshttps://github.com/microsoft/TypeScript/pull/32558#top
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
masterhttps://github.com/microsoft/TypeScript/tree/master
fix32247https://github.com/microsoft/TypeScript/tree/fix32247
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Jul 25, 2019https://github.com/microsoft/TypeScript/pull/32558#issue-473019005
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/32558
#32460https://github.com/microsoft/TypeScript/pull/32460
#32247https://github.com/microsoft/TypeScript/issues/32247
#32572https://github.com/microsoft/TypeScript/issues/32572
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/32558
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
July 25, 2019 09:56https://github.com/microsoft/TypeScript/pull/32558#commits-pushed-dc415c5
https://github.com/ahejlsberg
Infer between closely matching types in unions and intersectionshttps://github.com/microsoft/TypeScript/pull/32558/commits/dc415c5c5e81d6578f58cb1847d0c27926e8a005
dc415c5https://github.com/microsoft/TypeScript/pull/32558/commits/dc415c5c5e81d6578f58cb1847d0c27926e8a005
https://github.com/ahejlsberg
Accept new baselineshttps://github.com/microsoft/TypeScript/pull/32558/commits/35de142943ea867f302fc8318afa9e9f9bb7c0ad
35de142https://github.com/microsoft/TypeScript/pull/32558/commits/35de142943ea867f302fc8318afa9e9f9bb7c0ad
https://github.com/ahejlsberg
Add regression testshttps://github.com/microsoft/TypeScript/pull/32558/commits/b9d27c0f2ce5df82b8899aca94ed752b626978b0
b9d27c0https://github.com/microsoft/TypeScript/pull/32558/commits/b9d27c0f2ce5df82b8899aca94ed752b626978b0
https://github.com/ahejlsberg
Accept new baselineshttps://github.com/microsoft/TypeScript/pull/32558/commits/540134840da0acea39f103b12719392c41b9a67d
5401348https://github.com/microsoft/TypeScript/pull/32558/commits/540134840da0acea39f103b12719392c41b9a67d
https://github.com/ahejlsberg
Don't exclude non-anonymous object types in identity checkshttps://github.com/microsoft/TypeScript/pull/32558/commits/4c76bae8880d97d01847064cd98befba8f42028a
4c76baehttps://github.com/microsoft/TypeScript/pull/32558/commits/4c76bae8880d97d01847064cd98befba8f42028a
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Jul 25, 2019https://github.com/microsoft/TypeScript/pull/32558#issuecomment-515213850
TypeScript Bot (@typescript-bot)https://github.com/typescript-bot
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/32558
https://github.com/typescript-bot
TypeScript Bot (typescript-bot)https://github.com/typescript-bot
Jul 25, 2019https://github.com/microsoft/TypeScript/pull/32558#issuecomment-515213888
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/32558
Anders Hejlsberg (@ahejlsberg)https://github.com/ahejlsberg
4c76baehttps://github.com/microsoft/TypeScript/commit/4c76bae8880d97d01847064cd98befba8f42028a
herehttps://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_build/results?buildId=37754
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/32558
https://github.com/ahejlsberg
Less aggressive reduction of intersection typeshttps://github.com/microsoft/TypeScript/pull/32558/commits/00f41e5693e55ede6a243b8fe0f4d982081ef2dd
00f41e5https://github.com/microsoft/TypeScript/pull/32558/commits/00f41e5693e55ede6a243b8fe0f4d982081ef2dd
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Jul 26, 2019https://github.com/microsoft/TypeScript/pull/32558#issuecomment-515547330
TypeScript Bot (@typescript-bot)https://github.com/typescript-bot
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/32558
https://github.com/typescript-bot
TypeScript Bot (typescript-bot)https://github.com/typescript-bot
Jul 26, 2019https://github.com/microsoft/TypeScript/pull/32558#issuecomment-515547987
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/32558
Anders Hejlsberg (@ahejlsberg)https://github.com/ahejlsberg
00f41e5https://github.com/microsoft/TypeScript/commit/00f41e5693e55ede6a243b8fe0f4d982081ef2dd
herehttps://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_build/results?buildId=37842
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/32558
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Jul 26, 2019 https://github.com/microsoft/TypeScript/pull/32558#ref-issue-473218976
wrong type infer in 3.6.0-dev.20190725 #32572 https://github.com/microsoft/TypeScript/issues/32572
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Jul 26, 2019https://github.com/microsoft/TypeScript/pull/32558#issuecomment-515581062
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/32558
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
July 26, 2019 13:12https://github.com/microsoft/TypeScript/pull/32558#commits-pushed-bb87332
https://github.com/ahejlsberg
Add more commentshttps://github.com/microsoft/TypeScript/pull/32558/commits/bb87332e73a1024dd3aa1b0fef18575cb504057d
bb87332https://github.com/microsoft/TypeScript/pull/32558/commits/bb87332e73a1024dd3aa1b0fef18575cb504057d
https://github.com/ahejlsberg
Add more testshttps://github.com/microsoft/TypeScript/pull/32558/commits/ec38799e2a1a9df776882e20d89604c85ec3015f
ec38799https://github.com/microsoft/TypeScript/pull/32558/commits/ec38799e2a1a9df776882e20d89604c85ec3015f
https://github.com/ahejlsberg
Accept new baselineshttps://github.com/microsoft/TypeScript/pull/32558/commits/1ea4008120a20c4cca416af2096c5f3a46da7063
1ea4008https://github.com/microsoft/TypeScript/pull/32558/commits/1ea4008120a20c4cca416af2096c5f3a46da7063
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Wesley Wigham (weswigham)https://github.com/weswigham
July 26, 2019 21:20https://github.com/microsoft/TypeScript/pull/32558#event-2513736542
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Jul 26, 2019 https://github.com/microsoft/TypeScript/pull/32558#ref-pullrequest-473549742
Prepare for TS #32558 DefinitelyTyped/DefinitelyTyped#37167 https://github.com/DefinitelyTyped/DefinitelyTyped/pull/37167
https://github.com/ahejlsberg
Record full inference status in visitation cachehttps://github.com/microsoft/TypeScript/pull/32558/commits/a9e0a7766e30eff61f76ca85b380e65f45c8eb12
a9e0a77https://github.com/microsoft/TypeScript/pull/32558/commits/a9e0a7766e30eff61f76ca85b380e65f45c8eb12
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Jul 28, 2019https://github.com/microsoft/TypeScript/pull/32558#issuecomment-515722826
TypeScript Bot (@typescript-bot)https://github.com/typescript-bot
TypeScript Bot (@typescript-bot)https://github.com/typescript-bot
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/32558
https://github.com/typescript-bot
TypeScript Bot (typescript-bot)https://github.com/typescript-bot
Jul 28, 2019https://github.com/microsoft/TypeScript/pull/32558#issuecomment-515722827
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/32558
Anders Hejlsberg (@ahejlsberg)https://github.com/ahejlsberg
a9e0a77https://github.com/microsoft/TypeScript/commit/a9e0a7766e30eff61f76ca85b380e65f45c8eb12
herehttps://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_build/results?buildId=38002
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/32558
https://github.com/typescript-bot
TypeScript Bot (typescript-bot)https://github.com/typescript-bot
Jul 28, 2019https://github.com/microsoft/TypeScript/pull/32558#issuecomment-515722828
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/32558
Anders Hejlsberg (@ahejlsberg)https://github.com/ahejlsberg
a9e0a77https://github.com/microsoft/TypeScript/commit/a9e0a7766e30eff61f76ca85b380e65f45c8eb12
herehttps://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_build/results?buildId=38001
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/32558
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Jul 28, 2019https://github.com/microsoft/TypeScript/pull/32558#issuecomment-515724436
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/32558
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
TypeScript 3.6.1https://github.com/microsoft/TypeScript/milestone/100
Jul 28, 2019https://github.com/microsoft/TypeScript/pull/32558#event-2514817227
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
4cc6618https://github.com/microsoft/TypeScript/commit/4cc6618fc2dfec801e0eb335a0d40fc00eeab683
Jul 29, 2019https://github.com/microsoft/TypeScript/pull/32558#event-2517431891
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
July 29, 2019 18:34https://github.com/microsoft/TypeScript/pull/32558#event-2517432093
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Aug 15, 2019 https://github.com/microsoft/TypeScript/pull/32558#ref-pullrequest-481245125
Stricter criteria for eliminating types in unions during inference #32919 https://github.com/microsoft/TypeScript/pull/32919
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
Sep 3, 2019 https://github.com/microsoft/TypeScript/pull/32558#ref-issue-487584381
Wrong type parameter inference when there is mapped types and Readonly in the argument type #33164 https://github.com/microsoft/TypeScript/issues/33164
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
Sep 18, 2019 https://github.com/microsoft/TypeScript/pull/32558#ref-issue-495132982
Regression for inferred unions in generic parameters #33490 https://github.com/microsoft/TypeScript/issues/33490
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Oct 30, 2019 https://github.com/microsoft/TypeScript/pull/32558#ref-issue-512880020
TS3.6/3.7 regression: template arguments used in unions no longer resolve/narrow #34754 https://github.com/microsoft/TypeScript/issues/34754
https://github.com/sandersn
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
Jan 23, 2020 https://github.com/microsoft/TypeScript/pull/32558#ref-issue-501247575
Contextual typing interferes with type argument inference #33738 https://github.com/microsoft/TypeScript/issues/33738
https://github.com/microsoft
Microsoft (microsoft)https://github.com/microsoft
Oct 21, 2025https://github.com/microsoft/TypeScript/pull/32558#event-20416732852
https://github.com/typescript-bot
TypeScript Bot (typescript-bot)https://github.com/typescript-bot
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Oct 21, 2025https://github.com/microsoft/TypeScript/pull/32558#event-20416734986
https://github.co/hiddenchars
https://github.com/microsoft/TypeScript/pull/{{ revealButtonHref }}
Sign up for freehttps://github.com/join?source=comment-repo
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fpull%2F32558
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh) https://github.com/RyanCavanaugh
https://github.com/weswigham
Wesley Wigham (weswigham) https://github.com/weswigham
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/32558
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg) https://github.com/ahejlsberg
TypeScript 3.6.1 https://github.com/microsoft/TypeScript/milestone/100
wrong type infer in 3.6.0-dev.20190725 https://github.com/microsoft/TypeScript/issues/32572
Error with async generators https://github.com/microsoft/TypeScript/issues/32247
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/32558
https://github.com/ahejlsberg
https://github.com/typescript-bot
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.