René's URL Explorer Experiment


Title: Allow non-unit types in union discriminants by ahejlsberg · Pull Request #27695 · microsoft/TypeScript · GitHub

Open Graph Title: Allow non-unit types in union discriminants by ahejlsberg · Pull Request #27695 · microsoft/TypeScript

X Title: Allow non-unit types in union discriminants by ahejlsberg · Pull Request #27695 · microsoft/TypeScript

Description: TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - Allow non-unit types in union discriminants by ahejlsberg · Pull Request #27695 · microsoft/TypeScript

Open Graph Description: With this PR we permit non-unit types in union type discriminants. Specifically, we now consider a property of a union type to be a discriminant property if it has a union type containing at least ...

X Description: With this PR we permit non-unit types in union type discriminants. Specifically, we now consider a property of a union type to be a discriminant property if it has a union type containing at least ...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.4

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:d0723538-960e-b777-862f-e4465b373cb1
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB156:29CED8:4B3E86:6AB8CE:6B047277
html-safe-noncefbaa1058eb9696f52426717fdc8987ad04fb2997cd3decebe9b79ed90e636087
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTU2OjI5Q0VEODo0QjNFODY6NkFCOENFOjZCMDQ3Mjc3IiwidmlzaXRvcl9pZCI6IjgyMTA4ODY4NDIxMTIwNDU2ODciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac6f0f778493d3b76ab1123b15a67dfdca79a50a6a848f759237fedc8ff2596d94
hovercard-subject-tagpull_request:221957669
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/27695/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/69a4bafa404351d33fafc5592acf47cef17fd359c997057f59db82f9f05fca84/microsoft/TypeScript/pull/27695
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/69a4bafa404351d33fafc5592acf47cef17fd359c997057f59db82f9f05fca84/microsoft/TypeScript/pull/27695
og:image:altWith this PR we permit non-unit types in union type discriminants. Specifically, we now consider a property of a union type to be a discriminant property if it has a union type containing at least ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameahejlsberg
hostnamegithub.com
expected-hostnamegithub.com
Noneae8802492f12d3ba4f6b0d814054e617a2a5616b6327bf8555c10cd5b0dc2a6f
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
releasecfb5f24c6e01d85f70804652a5107e5cac03a161
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-namepull-requests

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/pull/27695#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fpull%2F27695
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%2F27695
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/27695
Reloadhttps://github.com/microsoft/TypeScript/pull/27695
Reloadhttps://github.com/microsoft/TypeScript/pull/27695
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
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
masterhttps://github.com/microsoft/TypeScript/tree/master
mixedDiscriminantTypeshttps://github.com/microsoft/TypeScript/tree/mixedDiscriminantTypes
Conversationhttps://github.com/microsoft/TypeScript/pull/27695
Commits5 (5)https://github.com/microsoft/TypeScript/pull/27695/commits
Checkshttps://github.com/microsoft/TypeScript/pull/27695/checks
Files changedhttps://github.com/microsoft/TypeScript/pull/27695/files
Allow non-unit types in union discriminantshttps://github.com/microsoft/TypeScript/pull/27695#top
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
masterhttps://github.com/microsoft/TypeScript/tree/master
mixedDiscriminantTypeshttps://github.com/microsoft/TypeScript/tree/mixedDiscriminantTypes
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Oct 10, 2018https://github.com/microsoft/TypeScript/pull/27695#issue-368886620
#27631https://github.com/microsoft/TypeScript/pull/27631
#24193https://github.com/microsoft/TypeScript/issues/24193
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/27695
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
October 9, 2018 18:41https://github.com/microsoft/TypeScript/pull/27695#commits-pushed-d069875
https://github.com/ahejlsberg
Allow discriminant property to contain some non-unit typeshttps://github.com/microsoft/TypeScript/pull/27695/commits/d0698751ce06814d740b22511c363d2a88a4a1bc
d069875https://github.com/microsoft/TypeScript/pull/27695/commits/d0698751ce06814d740b22511c363d2a88a4a1bc
https://github.com/ahejlsberg
Discriminant must include at least one unit type and no instantiable …https://github.com/microsoft/TypeScript/pull/27695/commits/c110f57deb0c423c4e160ab5bce74c35187cb039
c110f57https://github.com/microsoft/TypeScript/pull/27695/commits/c110f57deb0c423c4e160ab5bce74c35187cb039
https://github.com/ahejlsberg
Accept new baselineshttps://github.com/microsoft/TypeScript/pull/27695/commits/7737cd5f1fe07d47b00b1f5e189a73e060c78c19
7737cd5https://github.com/microsoft/TypeScript/pull/27695/commits/7737cd5f1fe07d47b00b1f5e189a73e060c78c19
https://github.com/ahejlsberg
Add testshttps://github.com/microsoft/TypeScript/pull/27695/commits/22907bfb0701284f83fea13b9050c2c95ec63924
22907bfhttps://github.com/microsoft/TypeScript/pull/27695/commits/22907bfb0701284f83fea13b9050c2c95ec63924
https://github.com/ahejlsberg
Accept new baselineshttps://github.com/microsoft/TypeScript/pull/27695/commits/6cdba6d3516a32e36458ef68e2f785a914ffd91f
6cdba6dhttps://github.com/microsoft/TypeScript/pull/27695/commits/6cdba6d3516a32e36458ef68e2f785a914ffd91f
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
October 10, 2018 22:53https://github.com/microsoft/TypeScript/pull/27695#event-1896834339
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Oct 10, 2018 https://github.com/microsoft/TypeScript/pull/27695#ref-pullrequest-368207875
Fix #24193: Allow nullable discriminants #27631 https://github.com/microsoft/TypeScript/pull/27631
https://github.com/jack-williams
Jack Williams (jack-williams)https://github.com/jack-williams
Oct 10, 2018https://github.com/microsoft/TypeScript/pull/27695#issuecomment-428764591
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/27695
https://github.com/jack-williams
Jack Williams (jack-williams)https://github.com/jack-williams
Oct 10, 2018 https://github.com/microsoft/TypeScript/pull/27695#pullrequestreview-163605343
View reviewed changes https://github.com/microsoft/TypeScript/pull/27695/files/6cdba6d3516a32e36458ef68e2f785a914ffd91f
tests/cases/conformance/types/union/discriminatedUnionTypes2.tshttps://github.com/microsoft/TypeScript/pull/27695/files/6cdba6d3516a32e36458ef68e2f785a914ffd91f#diff-c9469c275ab6411eeed6a3bca9766f9229c65793f0c395b6308960e3c353eeea
Jack Williams (jack-williams)https://github.com/jack-williams
Oct 10, 2018https://github.com/microsoft/TypeScript/pull/27695#discussion_r224277243
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/27695
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
Oct 11, 2018https://github.com/microsoft/TypeScript/pull/27695#issuecomment-429160233
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/27695
https://github.com/jack-williams
Jack Williams (jack-williams)https://github.com/jack-williams
Oct 12, 2018https://github.com/microsoft/TypeScript/pull/27695#issuecomment-429403244
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/27695
Wesley Wigham (@weswigham)https://github.com/weswigham
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/27695
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Oct 13, 2018https://github.com/microsoft/TypeScript/pull/27695#issuecomment-429546747
Jack Williams (@jack-williams)https://github.com/jack-williams
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/27695
https://github.com/jack-williams
Jack Williams (jack-williams)https://github.com/jack-williams
Oct 15, 2018https://github.com/microsoft/TypeScript/pull/27695#issuecomment-429815083
Anders Hejlsberg (@ahejlsberg)https://github.com/ahejlsberg
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/27695
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
Oct 15, 2018 https://github.com/microsoft/TypeScript/pull/27695#ref-pullrequest-370268032
Fix circular mapped type instantiations for arrays and tuples #27911 https://github.com/microsoft/TypeScript/pull/27911
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
Oct 15, 2018https://github.com/microsoft/TypeScript/pull/27695#issuecomment-429974822
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/27695
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
Oct 15, 2018 https://github.com/microsoft/TypeScript/pull/27695#pullrequestreview-164853634
View reviewed changes https://github.com/microsoft/TypeScript/pull/27695/files/6cdba6d3516a32e36458ef68e2f785a914ffd91f
Wesley Wigham (weswigham)https://github.com/weswigham
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/27695
https://github.com/microsoft/TypeScript/pull/27695#pullrequestreview-164853634
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/27695
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
9767522https://github.com/microsoft/TypeScript/commit/9767522ca0dfa5d76bbbd4a9ebce9bd69621beb7
Oct 15, 2018https://github.com/microsoft/TypeScript/pull/27695#event-1905097178
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
October 15, 2018 20:10https://github.com/microsoft/TypeScript/pull/27695#event-1905097462
https://github.com/jack-williams
Jack Williams (jack-williams)https://github.com/jack-williams
Oct 25, 2018 https://github.com/microsoft/TypeScript/pull/27695#ref-issue-374123150
Unable to discriminate union type because of "Property does not exist" #28138 https://github.com/microsoft/TypeScript/issues/28138
https://github.com/bmingles
Brian Ingles (bmingles)https://github.com/bmingles
Oct 30, 2018https://github.com/microsoft/TypeScript/pull/27695#issuecomment-434468492
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/27695
https://github.com/ksaldana1
Kevin Saldaña (ksaldana1)https://github.com/ksaldana1
Nov 14, 2018https://github.com/microsoft/TypeScript/pull/27695#issuecomment-438502871
Brian Ingles (@bmingles)https://github.com/bmingles
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/27695
Logical and loses narrowed types when testing for truthyness on union types #29106 https://github.com/microsoft/TypeScript/issues/29106
Fix discriminant property check #29110 https://github.com/microsoft/TypeScript/pull/29110
https://github.com/dragomirtitian
Titian Cernicova-Dragomir (dragomirtitian)https://github.com/dragomirtitian
Mar 20, 2019 https://github.com/microsoft/TypeScript/pull/27695#ref-issue-423205301
Type guard not work in union type of objects #30506 https://github.com/microsoft/TypeScript/issues/30506
https://github.com/jack-williams
Jack Williams (jack-williams)https://github.com/jack-williams
Aug 5, 2019 https://github.com/microsoft/TypeScript/pull/27695#ref-issue-475697864
Regression in discriminated unions when a common property may be boolean #32657 https://github.com/microsoft/TypeScript/issues/32657
https://github.com/octogonz
Pete Gonzalez (octogonz)https://github.com/octogonz
Aug 26, 2021 https://github.com/microsoft/TypeScript/pull/27695#ref-issue-467942096
Union not narrowed with typeof x.y as a discriminant #32399 https://github.com/microsoft/TypeScript/issues/32399
https://github.com/richard-ling
Richard Ling (richard-ling)https://github.com/richard-ling
Mar 12, 2025 https://github.com/microsoft/TypeScript/pull/27695#ref-issue-49962345
Consider property access a form of type guards #1260 https://github.com/microsoft/TypeScript/issues/1260
https://github.com/microsoft
Microsoft (microsoft)https://github.com/microsoft
Oct 21, 2025https://github.com/microsoft/TypeScript/pull/27695#event-20415820712
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/27695#event-20415821356
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%2F27695
https://github.com/weswigham
Wesley Wigham (weswigham) https://github.com/weswigham
https://github.com/microsoft/TypeScript/pull/27695/files/6cdba6d3516a32e36458ef68e2f785a914ffd91f
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) https://github.com/DanielRosenwasser
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh) https://github.com/RyanCavanaugh
https://github.com/jack-williams
Jack Williams (jack-williams) https://github.com/jack-williams
https://github.com/microsoft/TypeScript/pull/27695/files/6cdba6d3516a32e36458ef68e2f785a914ffd91f
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/27695
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg) https://github.com/ahejlsberg
Allow to use null as discriminator for tagged union https://github.com/microsoft/TypeScript/issues/24193
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/27695
https://github.com/ahejlsberg
https://github.com/jack-williams
https://github.com/weswigham
https://github.com/bmingles
https://github.com/ksaldana1
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-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.