René's URL Explorer Experiment


Title: Type narrowing bug in empty interfaces · Issue #18196 · microsoft/TypeScript · GitHub

Open Graph Title: Type narrowing bug in empty interfaces · Issue #18196 · microsoft/TypeScript

X Title: Type narrowing bug in empty interfaces · Issue #18196 · microsoft/TypeScript

Description: Reproduction (turn on strictNullChecks to see the red line) let x: {} = ""; if (!x) { // x is `never` O_O }

Open Graph Description: Reproduction (turn on strictNullChecks to see the red line) let x: {} = ""; if (!x) { // x is `never` O_O }

X Description: Reproduction (turn on strictNullChecks to see the red line) let x: {} = ""; if (!x) { // x is `never` O_O }

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Type narrowing bug in empty interfaces","articleBody":"[Reproduction](https://www.typescriptlang.org/play/#src=type%20Opaque%20%3D%20%7B%7D%20%7C%20null%20%7C%20undefined%20%7C%20void%3B%0D%0A%0D%0Afunction%20foo(value%3A%20Opaque)%3A%20void%20%7B%0D%0A%20%20if%20(value%20%7C%7C%20value%20%3D%3D%3D%200)%20%7B%0D%0A%20%20%20%20%2F%2F%20...%0D%0A%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%2F%2F%20...%0D%0A%20%20%7D%0D%0A%7D%0D%0A%0D%0A%2F%2F%20You%20can%20see%20what%20is%20causing%20this%20bug%20here%3A%0D%0A%0D%0Ainterface%20Anything%20%7B%20%7D%0D%0A%0D%0Afunction%20bar(value%3A%20Anything)%20%7B%0D%0A%20%20if%20(value%20%7C%7C%20%2F*%20hover%20here%20-%3E%20*%2F%20value%20%2F*%20%3C-%20value%20is%20%22never%22%20*%2F%20%3D%3D%3D%200)%20%7B%20%0D%0A%0D%0A%20%20%7D%0D%0A%7D%0D%0A) (turn on `strictNullChecks` to see the red line)\r\n\r\n```ts\r\nlet x: {} = \"\";\r\n\r\nif (!x) {\r\n  // x is `never` O_O\r\n}\r\n```","author":{"url":"https://github.com/chancancode","@type":"Person","name":"chancancode"},"datePublished":"2017-09-01T00:58:00Z","url":"https://github.com/microsoft/TypeScript/issues/18196"}

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:aff89817-45ee-39bc-b045-5fd3b1fc2d6d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id92D8:181E33:1A00D9:23A2F9:6B04B432
html-safe-nonce64051bb01c159c67e6b80fcce42256ee3adb23a5e654cd9d12f4465d4d0571dd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MkQ4OjE4MUUzMzoxQTAwRDk6MjNBMkY5OjZCMDRCNDMyIiwidmlzaXRvcl9pZCI6Ijg0OTA4MTc1MDc0OTY4NjY4NjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac0f84627c0e70a114e8b18fb38b90a9f689a5f89523a5f6ee59a98e55c3dfedf8
hovercard-subject-tagissue:254508233
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/18196/issue_layout
twitter:imagehttps://opengraph.githubassets.com/64d2ff2e71cc449289c0c855e89d7fdfccc71d07dc711d4a7f9b1d256dd9d9f1/microsoft/TypeScript/issues/18196
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/64d2ff2e71cc449289c0c855e89d7fdfccc71d07dc711d4a7f9b1d256dd9d9f1/microsoft/TypeScript/issues/18196
og:image:altReproduction (turn on strictNullChecks to see the red line) let x: {} = ""; if (!x) { // x is `never` O_O }
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamechancancode
hostnamegithub.com
expected-hostnamegithub.com
None378bd702ac792b3550e484ad39d9a898fcd25bb52ba6962b0c9cc457c1ea71c7
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
releaseb032e77f1ea437ede6c115446a0a467709b468e7
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/18196#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F18196
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%2F18196
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/18196
Reloadhttps://github.com/microsoft/TypeScript/issues/18196
Reloadhttps://github.com/microsoft/TypeScript/issues/18196
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests317 (317)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/18196
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/18196
#27157https://github.com/microsoft/TypeScript/pull/27157
Type narrowing bug in empty interfaceshttps://github.com/microsoft/TypeScript/issues/18196#top
#27157https://github.com/microsoft/TypeScript/pull/27157
https://github.com/ahejlsberg
Bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Fixedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
TypeScript 3.2https://github.com/microsoft/TypeScript/milestone/77
https://github.com/chancancode
Godfrey Chan (chancancode)https://github.com/chancancode
on Sep 1, 2017https://github.com/microsoft/TypeScript/issues/18196#issue-254508233
Reproductionhttps://www.typescriptlang.org/play/#src=type%20Opaque%20%3D%20%7B%7D%20%7C%20null%20%7C%20undefined%20%7C%20void%3B%0D%0A%0D%0Afunction%20foo(value%3A%20Opaque)%3A%20void%20%7B%0D%0A%20%20if%20(value%20%7C%7C%20value%20%3D%3D%3D%200)%20%7B%0D%0A%20%20%20%20%2F%2F%20...%0D%0A%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%2F%2F%20...%0D%0A%20%20%7D%0D%0A%7D%0D%0A%0D%0A%2F%2F%20You%20can%20see%20what%20is%20causing%20this%20bug%20here%3A%0D%0A%0D%0Ainterface%20Anything%20%7B%20%7D%0D%0A%0D%0Afunction%20bar(value%3A%20Anything)%20%7B%0D%0A%20%20if%20(value%20%7C%7C%20%2F*%20hover%20here%20-%3E%20*%2F%20value%20%2F*%20%3C-%20value%20is%20%22never%22%20*%2F%20%3D%3D%3D%200)%20%7B%20%0D%0A%0D%0A%20%20%7D%0D%0A%7D%0D%0A
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Sep 1, 2017https://github.com/microsoft/TypeScript/issues/18196#issuecomment-326465612
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Sep 1, 2017https://github.com/microsoft/TypeScript/issues/18196#issuecomment-326465751
https://github.com/wycats
Yehuda Katz (wycats)https://github.com/wycats
on Sep 1, 2017https://github.com/microsoft/TypeScript/issues/18196#issuecomment-326466003
https://github.com/chancancode
Godfrey Chan (chancancode)https://github.com/chancancode
on Sep 1, 2017https://github.com/microsoft/TypeScript/issues/18196#issuecomment-326489466
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Sep 5, 2017https://github.com/microsoft/TypeScript/issues/18196#issuecomment-327293479
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
Bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Sep 5, 2017https://github.com/microsoft/TypeScript/issues/18196#event-1235642549
https://github.com/wycats
Yehuda Katz (wycats)https://github.com/wycats
on Sep 5, 2017https://github.com/microsoft/TypeScript/issues/18196#issuecomment-327306761
https://camo.githubusercontent.com/c03fd3b9d0f2c8118e5835b2ad5310254a70064d91b8f6c511a822ca1944e6d2/687474703a2f2f69302e6b796d2d63646e2e636f6d2f70686f746f732f696d616765732f6e657773666565642f3030302f3930392f3939312f3438632e6a7067
Mohamed Hegazy (@mhegazy)https://github.com/mhegazy
ts-stdhttps://github.com/tildeio/ts-std
ts-std/src/core.tshttps://github.com/tildeio/ts-std/blob/master/src/core.ts
Mohamed Hegazy (@mhegazy)https://github.com/mhegazy
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Sep 5, 2017https://github.com/microsoft/TypeScript/issues/18196#issuecomment-327332352
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Sep 7, 2017https://github.com/microsoft/TypeScript/issues/18196#issuecomment-327650118
https://github.com/chancancode
Godfrey Chan (chancancode)https://github.com/chancancode
on Sep 7, 2017https://github.com/microsoft/TypeScript/issues/18196#issuecomment-327650920
Daniel Rosenwasser (@DanielRosenwasser)https://github.com/DanielRosenwasser
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Sep 7, 2017https://github.com/microsoft/TypeScript/issues/18196#issuecomment-327926889
https://github.com/wycats
Yehuda Katz (wycats)https://github.com/wycats
on Sep 7, 2017https://github.com/microsoft/TypeScript/issues/18196#issuecomment-327940353
Mohamed Hegazy (@mhegazy)https://github.com/mhegazy
BigInthttps://tc39.github.io/proposal-bigint/
Godfrey Chan (chancancode)https://github.com/chancancode
on Sep 13, 2017https://github.com/microsoft/TypeScript/issues/18196#event-1246358229
Fix `unknown` as per microsoft/TypeScript#18196https://github.com/tildeio/ts-std/commit/6ceb55926feb745a3d05411b17f6d4aac14e89c2
microsoft/TypeScript#18196https://github.com/microsoft/TypeScript/issues/18196
6ceb559https://github.com/tildeio/ts-std/commit/6ceb55926feb745a3d05411b17f6d4aac14e89c2
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Apr 13, 2018https://github.com/microsoft/TypeScript/issues/18196#event-1572212545
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Sep 14, 2018https://github.com/microsoft/TypeScript/issues/18196#issuecomment-421500572
Godfrey Chan (@chancancode)https://github.com/chancancode
Yehuda Katz (@wycats)https://github.com/wycats
https://github.com/ljharb
Jordan Harband (ljharb)https://github.com/ljharb
on Sep 14, 2018https://github.com/microsoft/TypeScript/issues/18196#issuecomment-421501194
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
on Sep 17, 2018https://github.com/microsoft/TypeScript/issues/18196#event-1850653522
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Futurehttps://github.com/microsoft/TypeScript/milestone/29
TypeScript 3.2https://github.com/microsoft/TypeScript/milestone/77
on Sep 17, 2018https://github.com/microsoft/TypeScript/issues/18196#event-1850801928
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Fixedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
on Sep 17, 2018https://github.com/microsoft/TypeScript/issues/18196#event-1850802406
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#27157https://github.com/microsoft/TypeScript/pull/27157
on Sep 18, 2018https://github.com/microsoft/TypeScript/issues/18196#event-1852883868
microsofthttps://github.com/microsoft
on Oct 21, 2025https://github.com/microsoft/TypeScript/issues/18196#event-20415497055
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/18196
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/18196
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Fixedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
TypeScript 3.2https://github.com/microsoft/TypeScript/milestone/77
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.