René's URL Explorer Experiment


Title: Erroneous type narrowing in finally · Issue #18478 · microsoft/TypeScript · GitHub

Open Graph Title: Erroneous type narrowing in finally · Issue #18478 · microsoft/TypeScript

X Title: Erroneous type narrowing in finally · Issue #18478 · microsoft/TypeScript

Description: TypeScript Version: Version 2.6.0-dev.20170914 Code function test() { type YesNo = ('No' | 'Yes'); let answer: YesNo = 'No'; // Bug disappears after adding 'as YesNo'. try { answer = 'Yes'; return; // Bug disappears after removing the re...

Open Graph Description: TypeScript Version: Version 2.6.0-dev.20170914 Code function test() { type YesNo = ('No' | 'Yes'); let answer: YesNo = 'No'; // Bug disappears after adding 'as YesNo'. try { answer = 'Yes'; return;...

X Description: TypeScript Version: Version 2.6.0-dev.20170914 Code function test() { type YesNo = ('No' | 'Yes'); let answer: YesNo = 'No'; // Bug disappears after adding 'as YesNo'...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Erroneous type narrowing in finally","articleBody":"\r\n**TypeScript Version:**  Version 2.6.0-dev.20170914\r\n\r\n**Code**\r\n\r\n```ts\r\nfunction test() {\r\n    type YesNo = ('No' | 'Yes');\r\n    let answer: YesNo = 'No'; // Bug disappears after adding 'as YesNo'.\r\n    try {\r\n        answer = 'Yes';\r\n        return; // Bug disappears after removing the return.\r\n    } finally {\r\n        if (answer === 'Yes') { // Bug: Operator === cannot be applied to types 'No' and 'Yes'\r\n        } else if (answer === 'No') {\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\nNo compilation errors.\r\n\r\n**Actual behavior:**\r\nCompilation error:\r\nbug.ts(8,13): error TS2365: Operator '===' cannot be applied to types '\"No\"' and '\"Yes\"'.\r\n\r\n**Note:**\r\nThis bug is similar to \"Erroneous control flow type narrowing in loops\": https://github.com/Microsoft/TypeScript/issues/15835","author":{"url":"https://github.com/Zbyl","@type":"Person","name":"Zbyl"},"datePublished":"2017-09-14T20:00:02Z","url":"https://github.com/microsoft/TypeScript/issues/18478"}

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:048c50b9-8655-93bd-d2ad-f8cdf3f7cb06
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEDEC:399E4B:E42EFB:12FDF39:6B01026D
html-safe-nonce94f9292b1577cb6730a2aa0e23d8b34f7bf03672b1054779976ccf2ac9a98d0f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFREVDOjM5OUU0QjpFNDJFRkI6MTJGREYzOTo2QjAxMDI2RCIsInZpc2l0b3JfaWQiOiIyNTkyODc5NTYyMzQ2MDA1MTAxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacde05f1a4df2cba62e8b909cee8bdb8cb930fe2450c2587fd281ca5c3c0fa52f2
hovercard-subject-tagissue:257838685
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/18478/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1399a3542eb9cfedc87baabe8286b463d37b322f4dc9e268f7868330dd0a0bed/microsoft/TypeScript/issues/18478
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1399a3542eb9cfedc87baabe8286b463d37b322f4dc9e268f7868330dd0a0bed/microsoft/TypeScript/issues/18478
og:image:altTypeScript Version: Version 2.6.0-dev.20170914 Code function test() { type YesNo = ('No' | 'Yes'); let answer: YesNo = 'No'; // Bug disappears after adding 'as YesNo'. try { answer = 'Yes'; return;...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameZbyl
hostnamegithub.com
expected-hostnamegithub.com
Nonecb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124
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
release2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/18478#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F18478
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%2F18478
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/18478
Reloadhttps://github.com/microsoft/TypeScript/issues/18478
Reloadhttps://github.com/microsoft/TypeScript/issues/18478
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests309 (309)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/18478
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/18478
Erroneous type narrowing in finallyhttps://github.com/microsoft/TypeScript/issues/18478#top
https://github.com/ahejlsberg
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
Backloghttps://github.com/microsoft/TypeScript/milestone/29
https://github.com/Zbyl
Zbylhttps://github.com/Zbyl
on Sep 14, 2017https://github.com/microsoft/TypeScript/issues/18478#issue-257838685
#15835https://github.com/microsoft/TypeScript/issues/15835
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Sep 14, 2017https://github.com/microsoft/TypeScript/issues/18478#event-1249931393
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
on Sep 14, 2017https://github.com/microsoft/TypeScript/issues/18478#event-1249931468
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 2.9https://github.com/microsoft/TypeScript/milestone/67
on Apr 12, 2018https://github.com/microsoft/TypeScript/issues/18478#event-1572153173
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 2.9https://github.com/microsoft/TypeScript/milestone/67
TypeScript 3.0https://github.com/microsoft/TypeScript/milestone/70
on Apr 26, 2018https://github.com/microsoft/TypeScript/issues/18478#event-1597504490
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 3.0https://github.com/microsoft/TypeScript/milestone/70
Futurehttps://github.com/microsoft/TypeScript/milestone/29
on Jul 2, 2018https://github.com/microsoft/TypeScript/issues/18478#event-1712734902
https://github.com/rdsedmundo
Edmundo Santos (rdsedmundo)https://github.com/rdsedmundo
on Feb 6, 2019https://github.com/microsoft/TypeScript/issues/18478#issuecomment-461093377
https://github.com/dtiziani
Daniel Tiziani (dtiziani)https://github.com/dtiziani
on Dec 12, 2019https://github.com/microsoft/TypeScript/issues/18478#issuecomment-564891951
http://www.typescriptlang.org/play/?ssl=1&ssc=1&pln=29&pc=4#code/FAMwrgdgxgLglgewgAhHCATAQgTwHICGAtgKYAUExJAXMgM4wBO6A5gJS0BuCcGyA3sGTDkAGxIxkUJBBKxEEWg2YQWyAD7IIYUaOQBeLTtEBuYEJFMcAiyKky58JAa1UzdgL5SCMKAAtkMhI2Gzs7aQg6BHEAOlEEFiC2WzCYP0YEAHdkEncRLzRKXWtBMOQ4EDII2XlnAEJDbV0QiKjY+MTqxwU4klU05M8LD3NQSFqUQuwcAEkMMl4lJlYOemXVDSNdUJFxSS6JpZU1TSa9RuMzFKsd8IcJl14rsuFGCTBGFAOnCDzhLygPn8gWCtzCrWiJDiCSSKTsaQy2VyKQK6AIxTBwgqVXuP2QDS2ohaSDaUI6OIgNR+vX6fkG+WGQAhttp://www.typescriptlang.org/play/?ssl=1&ssc=1&pln=29&pc=4#code/FAMwrgdgxgLglgewgAhHCATAQgTwHICGAtgKYAUExJAXMgM4wBO6A5gJS0BuCcGyA3sGTDkAGxIxkUJBBKxEEWg2YQWyAD7IIYUaOQBeLTtEBuYEJFMcAiyKky58JAa1UzdgL5SCMKAAtkMhI2Gzs7aQg6BHEAOlEEFiC2WzCYP0YEAHdkEncRLzRKXWtBMOQ4EDII2XlnAEJDbV0QiKjY+MTqxwU4klU05M8LD3NQSFqUQuwcAEkMMl4lJlYOemXVDSNdUJFxSS6JpZU1TSa9RuMzFKsd8IcJl14rsuFGCTBGFAOnCDzhLygPn8gWCtzCrWiJDiCSSKTsaQy2VyKQK6AIxTBwgqVXuP2QDS2ohaSDaUI6OIgNR+vX6fkG+WGQA
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
on Jan 7, 2020https://github.com/microsoft/TypeScript/issues/18478#event-2929406743
https://github.com/SlurpTheo
SlurpTheohttps://github.com/SlurpTheo
on Jan 9, 2020https://github.com/microsoft/TypeScript/issues/18478#issuecomment-572588856
Daniel Tiziani (@dtiziani)https://github.com/dtiziani
this CFA conversationhttps://github.com/microsoft/TypeScript/issues/11498#issuecomment-567708432
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Jan 9, 2020https://github.com/microsoft/TypeScript/issues/18478#issuecomment-572713262
SlurpTheohttps://github.com/SlurpTheo
#34880https://github.com/microsoft/TypeScript/pull/34880
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
on Jan 9, 2020https://github.com/microsoft/TypeScript/issues/18478#event-2936148115
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
on Jan 9, 2020https://github.com/microsoft/TypeScript/issues/18478#event-2936148270
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jan 9, 2020https://github.com/microsoft/TypeScript/issues/18478#event-2936148694
microsofthttps://github.com/microsoft
on Oct 21, 2025https://github.com/microsoft/TypeScript/issues/18478#event-20415504347
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/18478
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/18478
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
BacklogNo due datehttps://github.com/microsoft/TypeScript/milestone/29
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.