René's URL Explorer Experiment


Title: strictNullChecks blocks safe typeof capture · Issue #16108 · microsoft/TypeScript · GitHub

Open Graph Title: strictNullChecks blocks safe typeof capture · Issue #16108 · microsoft/TypeScript

X Title: strictNullChecks blocks safe typeof capture · Issue #16108 · microsoft/TypeScript

Description: Sorry if this is a dupe - I tried searching but github's search isn't great. TypeScript Version: 2.3.1 Code interface Nested { child: { prop: string } } declare function maybeGetNestedValue(): Nested | null const nested = maybeGetNestedV...

Open Graph Description: Sorry if this is a dupe - I tried searching but github's search isn't great. TypeScript Version: 2.3.1 Code interface Nested { child: { prop: string } } declare function maybeGetNestedValue(): Nest...

X Description: Sorry if this is a dupe - I tried searching but github's search isn't great. TypeScript Version: 2.3.1 Code interface Nested { child: { prop: string } } declare function maybeGetNestedValue...

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

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":"strictNullChecks blocks safe typeof capture","articleBody":"\u003c!-- BUGS: Please use this template. -->\r\n\u003c!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\r\n\u003c!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\r\n\r\nSorry if this is a dupe - I tried searching but github's search isn't great.\r\n\r\n**TypeScript Version:**  2.3.1\r\n\r\n**Code**\r\n\r\n```ts\r\ninterface Nested {\r\n    child: {\r\n        prop: string\r\n    }\r\n}\r\n\r\ndeclare function maybeGetNestedValue(): Nested | null\r\n\r\nconst nested = maybeGetNestedValue()\r\n\r\nconst child: typeof nested.child = {\r\n    prop: 'value'\r\n}\r\n```\r\n\r\n[TypeScript Playground link](http://www.typescriptlang.org/play/#src=interface%20Nested%20%7B%0D%0A%20%20%20%20child%3A%20%7B%0D%0A%20%20%20%20%20%20%20%20prop%3A%20string%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%0D%0Adeclare%20function%20maybeGetNestedValue()%3A%20Nested%20%7C%20null%0D%0A%0D%0Aconst%20nested%20%3D%20maybeGetNestedValue()%0D%0A%0D%0Aconst%20child%3A%20typeof%20nested.child%20%3D%20%7B%0D%0A%20%20%20%20prop%3A%20'value'%0D%0A%7D)\r\n**Note**: You need to manually enable strictNullChecks under the options for this link. If I enable it and try to share it says the text buffer is too big to share.\r\n\r\n\r\n**Expected behavior:** I would expect to be able to use `typeof` to capture the type of this nested field, since as you can see in the emitted code in the TypeScript Playground link, there is no dereference of the `nested` field emitted, so the code should always be safe.\r\n\r\n**Actual behavior:** The strictNullChecks flag raises an error because the `nested` field may be `null`.","author":{"url":"https://github.com/dylanscott","@type":"Person","name":"dylanscott"},"datePublished":"2017-05-26T18:04:02Z","url":"https://github.com/microsoft/TypeScript/issues/16108"}

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:f8da4d27-d214-6bb5-6e6b-3c468064dcfa
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id979E:81C86:1AFF3E:2568F1:6B0466E1
html-safe-noncefec5d68fe93bc182d86b775088592abd26fd3ba769d4ec34e81786404c077d57
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzlFOjgxQzg2OjFBRkYzRToyNTY4RjE6NkIwNDY2RTEiLCJ2aXNpdG9yX2lkIjoiNTMzNTA0MzI4MjYzODc1OTY0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac910034a2476a6f0ba0f2ba3661ae4bb0c4096580c52cf64cb56caad173d9f5d5
hovercard-subject-tagissue:231696582
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/16108/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c88c0d43b5698dcf09bfca85c7cf6871145ebe2f854883c47378a68f805627ab/microsoft/TypeScript/issues/16108
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c88c0d43b5698dcf09bfca85c7cf6871145ebe2f854883c47378a68f805627ab/microsoft/TypeScript/issues/16108
og:image:altSorry if this is a dupe - I tried searching but github's search isn't great. TypeScript Version: 2.3.1 Code interface Nested { child: { prop: string } } declare function maybeGetNestedValue(): Nest...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedylanscott
hostnamegithub.com
expected-hostnamegithub.com
None83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f
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
releaseca4d07a7cef4e4b75f821dc25e7300d80c1450a9
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/16108#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F16108
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%2F16108
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/16108
Reloadhttps://github.com/microsoft/TypeScript/issues/16108
Reloadhttps://github.com/microsoft/TypeScript/issues/16108
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
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/16108
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/16108
strictNullChecks blocks safe typeof capturehttps://github.com/microsoft/TypeScript/issues/16108#top
DeclinedThe issue was declined as something which matches the TypeScript visionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Declined%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com/dylanscott
Dylan Scott (dylanscott)https://github.com/dylanscott
on May 26, 2017https://github.com/microsoft/TypeScript/issues/16108#issue-231696582
TypeScript Playground linkhttp://www.typescriptlang.org/play/#src=interface%20Nested%20%7B%0D%0A%20%20%20%20child%3A%20%7B%0D%0A%20%20%20%20%20%20%20%20prop%3A%20string%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%0D%0Adeclare%20function%20maybeGetNestedValue()%3A%20Nested%20%7C%20null%0D%0A%0D%0Aconst%20nested%20%3D%20maybeGetNestedValue()%0D%0A%0D%0Aconst%20child%3A%20typeof%20nested.child%20%3D%20%7B%0D%0A%20%20%20%20prop%3A%20'value'%0D%0A%7D
https://github.com/dylanscott
Dylan Scott (dylanscott)https://github.com/dylanscott
on May 26, 2017https://github.com/microsoft/TypeScript/issues/16108#issuecomment-304351814
https://github.com/aluanhaddad
Aluan Haddad (aluanhaddad)https://github.com/aluanhaddad
on May 26, 2017https://github.com/microsoft/TypeScript/issues/16108#issuecomment-304352569
https://github.com/dylanscott
Dylan Scott (dylanscott)https://github.com/dylanscott
on May 26, 2017https://github.com/microsoft/TypeScript/issues/16108#issuecomment-304355049
https://github.com/aluanhaddad
Aluan Haddad (aluanhaddad)https://github.com/aluanhaddad
on May 26, 2017https://github.com/microsoft/TypeScript/issues/16108#issuecomment-304404422
https://github.com/aluanhaddad
Aluan Haddad (aluanhaddad)https://github.com/aluanhaddad
on May 27, 2017https://github.com/microsoft/TypeScript/issues/16108#issuecomment-304458575
Andy (Andrewkraft) (@Andy-MS)https://github.com/Andy-MS
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
on May 30, 2017https://github.com/microsoft/TypeScript/issues/16108#event-1101590281
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on May 30, 2017https://github.com/microsoft/TypeScript/issues/16108#issuecomment-304762072
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
help wantedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
on Jan 30, 2018https://github.com/microsoft/TypeScript/issues/16108#event-1447545472
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 2.8https://github.com/microsoft/TypeScript/milestone/61
on Jan 30, 2018https://github.com/microsoft/TypeScript/issues/16108#event-1447545994
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
good first issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22
on Jan 30, 2018https://github.com/microsoft/TypeScript/issues/16108#event-1447546115
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Jan 30, 2018https://github.com/microsoft/TypeScript/issues/16108#issuecomment-361434136
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
on Jan 30, 2018https://github.com/microsoft/TypeScript/issues/16108#event-1447570392
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Mar 9, 2018https://github.com/microsoft/TypeScript/issues/16108#issuecomment-371951308
#22445https://github.com/microsoft/TypeScript/issues/22445
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Mar 9, 2018https://github.com/microsoft/TypeScript/issues/16108#event-1514176608
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
DeclinedThe issue was declined as something which matches the TypeScript visionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Declined%22
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
good first issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22
help wantedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
on Mar 9, 2018https://github.com/microsoft/TypeScript/issues/16108#event-1514176849
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
on Mar 9, 2018https://github.com/microsoft/TypeScript/issues/16108#event-1514176891
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 2.8https://github.com/microsoft/TypeScript/milestone/61
on Mar 9, 2018https://github.com/microsoft/TypeScript/issues/16108#event-1514176978
microsofthttps://github.com/microsoft
on Jul 25, 2018https://github.com/microsoft/TypeScript/issues/16108#event-1753411536
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/16108
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/16108
DeclinedThe issue was declined as something which matches the TypeScript visionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Declined%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
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.