René's URL Explorer Experiment


Title: Type guards as assertions by ahejlsberg · Pull Request #8548 · microsoft/TypeScript · GitHub

Open Graph Title: Type guards as assertions by ahejlsberg · Pull Request #8548 · microsoft/TypeScript

X Title: Type guards as assertions by ahejlsberg · Pull Request #8548 · microsoft/TypeScript

Description: TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - Type guards as assertions by ahejlsberg · Pull Request #8548 · microsoft/TypeScript

Open Graph Description: This PR fixes several of the issues we've had around nothing types in control flows. We previously took the view that when the current control flow based type of a variable is disjoint with the...

X Description: This PR fixes several of the issues we've had around nothing types in control flows. We previously took the view that when the current control flow based type of a variable is disjoint with...

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

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:ff523083-f92a-4c16-e8aa-4fc287ae6633
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB002:29FFA9:27C8D65:325F4CC:6B019686
html-safe-noncef899955126bff5319d6490851e1e8761ad6c2e147f2d0925ccb083cedfbc2f31
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDAyOjI5RkZBOToyN0M4RDY1OjMyNUY0Q0M6NkIwMTk2ODYiLCJ2aXNpdG9yX2lkIjoiMzIzOTg1Mzg4OTQxOTMxODkxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacd1e35034ecee7be9ef12c600e955a329f9d011a8710a8d0d6ff5603c217841fd
hovercard-subject-tagpull_request:69550272
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/8548/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/193b456a38d97ad4168a5148d5f2024df3629fe84aa5b670a03f09c2c85e8f8b/microsoft/TypeScript/pull/8548
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/193b456a38d97ad4168a5148d5f2024df3629fe84aa5b670a03f09c2c85e8f8b/microsoft/TypeScript/pull/8548
og:image:altThis PR fixes several of the issues we've had around nothing types in control flows. We previously took the view that when the current control flow based type of a variable is disjoint with the...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameahejlsberg
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-namepull-requests

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/pull/8548#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fpull%2F8548
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%2F8548
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/8548
Reloadhttps://github.com/microsoft/TypeScript/pull/8548
Reloadhttps://github.com/microsoft/TypeScript/pull/8548
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests312 (312)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
typeGuardAsAssertionhttps://github.com/microsoft/TypeScript/tree/typeGuardAsAssertion
Conversationhttps://github.com/microsoft/TypeScript/pull/8548
Commits6 (6)https://github.com/microsoft/TypeScript/pull/8548/commits
Checkshttps://github.com/microsoft/TypeScript/pull/8548/checks
Files changedhttps://github.com/microsoft/TypeScript/pull/8548/files
Type guards as assertionshttps://github.com/microsoft/TypeScript/pull/8548#top
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
masterhttps://github.com/microsoft/TypeScript/tree/master
typeGuardAsAssertionhttps://github.com/microsoft/TypeScript/tree/typeGuardAsAssertion
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
May 10, 2016https://github.com/microsoft/TypeScript/pull/8548#issue-154068896
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
#8513https://github.com/microsoft/TypeScript/issues/8513
#8429https://github.com/microsoft/TypeScript/pull/8429
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
May 10, 2016 09:35https://github.com/microsoft/TypeScript/pull/8548#commits-pushed-e944bfa
https://github.com/ahejlsberg
Revert to declared type when narrowing produces the nothing typehttps://github.com/microsoft/TypeScript/pull/8548/commits/e944bfab52e9863cc56a36848473d5f6f0452ab8
e944bfahttps://github.com/microsoft/TypeScript/pull/8548/commits/e944bfab52e9863cc56a36848473d5f6f0452ab8
https://github.com/ahejlsberg
Renaming emptyUnionType to nothingTypehttps://github.com/microsoft/TypeScript/pull/8548/commits/6563251dbf007ae734e5323e71c1629a0e045a05
6563251https://github.com/microsoft/TypeScript/pull/8548/commits/6563251dbf007ae734e5323e71c1629a0e045a05
https://github.com/ahejlsberg
Accepting new baselineshttps://github.com/microsoft/TypeScript/pull/8548/commits/2a45e56b653e7882dbb42b1261e0e36030cf2968
2a45e56https://github.com/microsoft/TypeScript/pull/8548/commits/2a45e56b653e7882dbb42b1261e0e36030cf2968
https://github.com/ahejlsberg
Adding testhttps://github.com/microsoft/TypeScript/pull/8548/commits/8c9348d8d6427eaf4edf9c6bda93329b8714e94d
8c9348dhttps://github.com/microsoft/TypeScript/pull/8548/commits/8c9348d8d6427eaf4edf9c6bda93329b8714e94d
https://github.com/msftclas
Microsoft Contribution License Agreements (msftclas)https://github.com/msftclas
cla-not-required https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3Acla-not-required
May 10, 2016https://github.com/microsoft/TypeScript/pull/8548#event-656131445
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
May 10, 2016https://github.com/microsoft/TypeScript/pull/8548#issuecomment-218296531
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
May 10, 2016https://github.com/microsoft/TypeScript/pull/8548#issuecomment-218324226
Mohamed Hegazy (@mhegazy)https://github.com/mhegazy
#8429https://github.com/microsoft/TypeScript/pull/8429
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
May 11, 2016https://github.com/microsoft/TypeScript/pull/8548#issuecomment-218330231
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
May 11, 2016https://github.com/microsoft/TypeScript/pull/8548#issuecomment-218330841
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
https://github.com/Arnavion
Arnav Singh (Arnavion)https://github.com/Arnavion
May 11, 2016https://github.com/microsoft/TypeScript/pull/8548#issuecomment-218370606
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
May 11, 2016 09:26https://github.com/microsoft/TypeScript/pull/8548#commits-pushed-5edf726
https://github.com/ahejlsberg
Revert to declared type when '!' postfix operator would produce 'noth…https://github.com/microsoft/TypeScript/pull/8548/commits/5edf72666d62cbdefaf4a31513c61451c5a9fc01
5edf726https://github.com/microsoft/TypeScript/pull/8548/commits/5edf72666d62cbdefaf4a31513c61451c5a9fc01
https://github.com/ahejlsberg
Adding testhttps://github.com/microsoft/TypeScript/pull/8548/commits/9f30d9ff6eb252c9ab2e91466abce7f708513fbd
9f30d9fhttps://github.com/microsoft/TypeScript/pull/8548/commits/9f30d9ff6eb252c9ab2e91466abce7f708513fbd
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
May 11, 2016https://github.com/microsoft/TypeScript/pull/8548#issuecomment-218519694
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
this discussionhttps://github.com/Microsoft/TypeScript/issues/8404#issuecomment-216000021
Ivo Gabe de Wolff (@ivogabe)https://github.com/ivogabe
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
89506c1https://github.com/microsoft/TypeScript/commit/89506c1138696f4b14821db9e251abb36c5608b1
May 11, 2016https://github.com/microsoft/TypeScript/pull/8548#event-657590863
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
May 11, 2016 18:29https://github.com/microsoft/TypeScript/pull/8548#event-657593739
https://github.com/malibuzios
malibuzioshttps://github.com/malibuzios
May 14, 2016https://github.com/microsoft/TypeScript/pull/8548#issuecomment-219209543
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
Anders Hejlsberg (@ahejlsberg)https://github.com/ahejlsberg
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
May 14, 2016https://github.com/microsoft/TypeScript/pull/8548#issuecomment-219223206
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
https://github.com/malibuzios
malibuzioshttps://github.com/malibuzios
May 14, 2016https://github.com/microsoft/TypeScript/pull/8548#issuecomment-219226901
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
https://github.com/malibuzios
malibuzioshttps://github.com/malibuzios
May 14, 2016https://github.com/microsoft/TypeScript/pull/8548#issuecomment-219229599
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
https://github.com/malibuzios
malibuzioshttps://github.com/malibuzios
May 14, 2016https://github.com/microsoft/TypeScript/pull/8548#issuecomment-219231326
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
https://github.com/malibuzios
malibuzioshttps://github.com/malibuzios
May 15, 2016https://github.com/microsoft/TypeScript/pull/8548#issuecomment-219271258
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
https://github.com/malibuzios
malibuzioshttps://github.com/malibuzios
May 16, 2016https://github.com/microsoft/TypeScript/pull/8548#issuecomment-219482783
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
https://github.com/malibuzios
malibuzioshttps://github.com/malibuzios
May 17, 2016https://github.com/microsoft/TypeScript/pull/8548#issuecomment-219755231
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Jun 5, 2016 https://github.com/microsoft/TypeScript/pull/8548#ref-issue-158534343
null comparison fails in switch statement with --strictNullChecks #8971 https://github.com/microsoft/TypeScript/issues/8971
Incorrect discriminated union narrowing following exhaustive if/else #9246 https://github.com/microsoft/TypeScript/issues/9246
Strange type narrowing with Discriminated union types #9254 https://github.com/microsoft/TypeScript/issues/9254
https://github.com/yortus
Troy Gerwien (yortus)https://github.com/yortus
Jun 20, 2016 https://github.com/microsoft/TypeScript/pull/8548#ref-issue-161103355
Narrowing inconsistencies #9260 https://github.com/microsoft/TypeScript/issues/9260
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Jul 21, 2016 https://github.com/microsoft/TypeScript/pull/8548#ref-issue-166855679
Mutually exclusive guard constraints and 'never' #9869 https://github.com/microsoft/TypeScript/issues/9869
object possibly null in short circuit evaluation #10087 https://github.com/microsoft/TypeScript/issues/10087
Limit "type guards as assertions" behavior #10118 https://github.com/microsoft/TypeScript/pull/10118
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
Aug 30, 2016 https://github.com/microsoft/TypeScript/pull/8548#ref-issue-174100001
T | U var with initial type T, set to a U inside lambda always deduced as T #10613 https://github.com/microsoft/TypeScript/issues/10613
https://github.com/microsoft
Microsoft (microsoft)https://github.com/microsoft
Jun 19, 2018https://github.com/microsoft/TypeScript/pull/8548#event-1689835256
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%2F8548
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
why does initialization narrow type? https://github.com/microsoft/TypeScript/issues/8513
Please reload this pagehttps://github.com/microsoft/TypeScript/pull/8548
https://github.com/ahejlsberg
https://github.com/mhegazy
https://github.com/DanielRosenwasser
https://github.com/Arnavion
https://github.com/malibuzios
https://github.com/msftclas
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.