René's URL Explorer Experiment


Title: Error when destructuring with literal initializers as fallback · Issue #26235 · microsoft/TypeScript · GitHub

Open Graph Title: Error when destructuring with literal initializers as fallback · Issue #26235 · microsoft/TypeScript

X Title: Error when destructuring with literal initializers as fallback · Issue #26235 · microsoft/TypeScript

Description: TypeScript Version: 3.0.1 Destructuring with a fallback empty object literal is a common practice, especially in function arguments (which works), but not always: Code type Options = { color?: string; width?: number; }; function A({ colo...

Open Graph Description: TypeScript Version: 3.0.1 Destructuring with a fallback empty object literal is a common practice, especially in function arguments (which works), but not always: Code type Options = { color?: stri...

X Description: TypeScript Version: 3.0.1 Destructuring with a fallback empty object literal is a common practice, especially in function arguments (which works), but not always: Code type Options = { color?: stri...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error when destructuring with literal initializers as fallback","articleBody":"**TypeScript Version:**  3.0.1\r\n\r\nDestructuring with a fallback empty object literal is a common practice, especially in function arguments (which works), but not always:\r\n\r\n**Code**\r\n```ts\r\ntype Options = { color?: string; width?: number; };\r\n\r\nfunction A({ color, width }: Options = {}) {\r\n    //\r\n}\r\n\r\nfunction B(options: Options) {\r\n    options = options || {};\r\n    let { color, width } = options;\r\n}\r\n\r\nfunction C(options: Options) {\r\n    let { color, width } = options || {};\r\n}\r\n```\r\n\r\n**Expected behavior:** All three functions type-check and behave the same.\r\n\r\n**Actual behavior:** \"Initializer provides no value for this binding element\" Error.\r\n\r\nWhich is simply incorrect, ES spec clearly defines the value when an object key is missing as `undefined`.  Furthermore, I would argue TS should even accept `let { color } = {};` though it's obviously not as common/important.\r\n\r\n**Related Issues:** \r\n[Issue #4598 - Improved checking of destructuring with literal initializers](4598) fixed the same problem, but only for destructuring function arguments (example A).\r\n\r\n**Playground Link:** [here](https://www.typescriptlang.org/play/#src=%0D%0Atype%20Options%20%3D%20%7B%20color%3F%3A%20string%3B%20width%3F%3A%20number%3B%20%7D%3B%0D%0A%0D%0Afunction%20A(%7B%20color%2C%20width%20%7D%3A%20Options%20%3D%20%7B%7D)%20%7B%0D%0A%20%20%20%20%2F%2F%0D%0A%7D%0D%0A%0D%0Afunction%20B(options%3A%20Options)%20%7B%0D%0A%20%20%20%20options%20%3D%20options%20%7C%7C%20%7B%7D%3B%0D%0A%20%20%20%20let%20%7B%20color%2C%20width%20%7D%20%3D%20options%3B%0D%0A%7D%0D%0A%0D%0Afunction%20C(options%3A%20Options)%20%7B%0D%0A%20%20%20%20let%20%7B%20color%2C%20width%20%7D%20%3D%20options%20%7C%7C%20%7B%7D%3B%0D%0A%7D%0D%0A)","author":{"url":"https://github.com/zombie","@type":"Person","name":"zombie"},"datePublished":"2018-08-06T16:53:47Z","url":"https://github.com/microsoft/TypeScript/issues/26235"}

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:9e1c8d54-839f-5456-12ee-002bdbdb6b02
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC376:B1B84:8D410:B1C79:6B00F59E
html-safe-noncee629be1a32667ab0ac3fde635a3c847a6d5386a9167ff4d37bfcf02047d23347
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzc2OkIxQjg0OjhENDEwOkIxQzc5OjZCMDBGNTlFIiwidmlzaXRvcl9pZCI6IjIwODI4NzUyMjk4NTU2MTAyNzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac125edee537a1d28b8ed73fbb6716abe4af40594e4521a59a7aa0c6ddc5e40048
hovercard-subject-tagissue:348002194
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/26235/issue_layout
twitter:imagehttps://opengraph.githubassets.com/90e7277b495a0220a1b947b370f408aab7e690395ee412e1600fa98695c03824/microsoft/TypeScript/issues/26235
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/90e7277b495a0220a1b947b370f408aab7e690395ee412e1600fa98695c03824/microsoft/TypeScript/issues/26235
og:image:altTypeScript Version: 3.0.1 Destructuring with a fallback empty object literal is a common practice, especially in function arguments (which works), but not always: Code type Options = { color?: stri...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamezombie
hostnamegithub.com
expected-hostnamegithub.com
None4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc
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
release9983dd5da06943f833c971dd5b6bc988e2858be5
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/26235#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F26235
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%2F26235
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/26235
Reloadhttps://github.com/microsoft/TypeScript/issues/26235
Reloadhttps://github.com/microsoft/TypeScript/issues/26235
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests308 (308)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/26235
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/26235
#31711https://github.com/microsoft/TypeScript/pull/31711
Error when destructuring with literal initializers as fallbackhttps://github.com/microsoft/TypeScript/issues/26235#top
#31711https://github.com/microsoft/TypeScript/pull/31711
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
TypeScript 3.6.0https://github.com/microsoft/TypeScript/milestone/93
https://github.com/zombie
Tomislav Jovanovic (zombie)https://github.com/zombie
on Aug 6, 2018https://github.com/microsoft/TypeScript/issues/26235#issue-348002194
Issue #4598 - Improved checking of destructuring with literal initializershttps://github.com/microsoft/TypeScript/issues/4598
herehttps://www.typescriptlang.org/play/#src=%0D%0Atype%20Options%20%3D%20%7B%20color%3F%3A%20string%3B%20width%3F%3A%20number%3B%20%7D%3B%0D%0A%0D%0Afunction%20A(%7B%20color%2C%20width%20%7D%3A%20Options%20%3D%20%7B%7D)%20%7B%0D%0A%20%20%20%20%2F%2F%0D%0A%7D%0D%0A%0D%0Afunction%20B(options%3A%20Options)%20%7B%0D%0A%20%20%20%20options%20%3D%20options%20%7C%7C%20%7B%7D%3B%0D%0A%20%20%20%20let%20%7B%20color%2C%20width%20%7D%20%3D%20options%3B%0D%0A%7D%0D%0A%0D%0Afunction%20C(options%3A%20Options)%20%7B%0D%0A%20%20%20%20let%20%7B%20color%2C%20width%20%7D%20%3D%20options%20%7C%7C%20%7B%7D%3B%0D%0A%7D%0D%0A
Nexthttps://github.com/microsoft/TypeScript/issues/26235?timeline_page=1
Tomislav Jovanovic (zombie)https://github.com/zombie
on Aug 6, 2018https://github.com/microsoft/TypeScript/issues/26235#event-1773379972
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Aug 6, 2018https://github.com/microsoft/TypeScript/issues/26235#event-1773892319
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
on Aug 8, 2018https://github.com/microsoft/TypeScript/issues/26235#event-1779000163
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Aug 8, 2018https://github.com/microsoft/TypeScript/issues/26235#issuecomment-411584497
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 3.2https://github.com/microsoft/TypeScript/milestone/77
on Aug 8, 2018https://github.com/microsoft/TypeScript/issues/26235#event-1779001472
https://github.com/zombie
Tomislav Jovanovic (zombie)https://github.com/zombie
on Aug 9, 2018https://github.com/microsoft/TypeScript/issues/26235#issuecomment-411717137
Tomislav Jovanovic (zombie)https://github.com/zombie
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Aug 9, 2018https://github.com/microsoft/TypeScript/issues/26235#event-1779885954
https://github.com/zombie
Tomislav Jovanovic (zombie)https://github.com/zombie
on Aug 9, 2018https://github.com/microsoft/TypeScript/issues/26235#issuecomment-411717213
Tomislav Jovanovic (zombie)https://github.com/zombie
on Aug 9, 2018https://github.com/microsoft/TypeScript/issues/26235#event-1779886337
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
TypeScript 3.2https://github.com/microsoft/TypeScript/milestone/77
TypeScript 3.2.1https://github.com/microsoft/TypeScript/milestone/84
on Nov 13, 2018https://github.com/microsoft/TypeScript/issues/26235#event-1964088658
https://github.com/rambabusaravanan
Andro Babu (rambabusaravanan)https://github.com/rambabusaravanan
on Nov 24, 2018https://github.com/microsoft/TypeScript/issues/26235#issuecomment-441374064
playgroundhttps://www.typescriptlang.org/play/#src=let%20value%3A%20any%3B%0D%0Alet%20%7B%20subject%2C%20topic%2C%20subTopic%20%7D%20%3D%20value%20%7C%7C%20%7B%7D%3B
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
TypeScript 3.2.1https://github.com/microsoft/TypeScript/milestone/84
TypeScript 3.3.0https://github.com/microsoft/TypeScript/milestone/79
on Nov 29, 2018https://github.com/microsoft/TypeScript/issues/26235#event-1994045995
https://github.com/kgregory
Ken Gregory (kgregory)https://github.com/kgregory
on May 17, 2019https://github.com/microsoft/TypeScript/issues/26235#issuecomment-493525090
#4598https://github.com/microsoft/TypeScript/pull/4598
playgroundhttps://www.typescriptlang.org/play/#src='use%20strict'%0D%0Ainterface%20Props%20%7B%0D%0A%20%20innerObject%3F%3A%20%7B%0D%0A%20%20%20%20name%3F%3A%20string%3B%0D%0A%20%20%20%20email%3F%3A%20string%3B%0D%0A%20%20%7D%3B%0D%0A%7D%0D%0A%0D%0A%2F%2F%20won't%20let%20name%20and%20email%20default%20to%20undefined%0D%0A%2F%2F%20Initializer%20provides%20no%20value%20for%20this%20binding%20element%20and%20the%20binding%20element%20has%20no%20default%20value.%20%0D%0Aexport%20const%20nestedDestructure1%20%3D%20(props%3A%20Props)%20%3D%3E%20%7B%0D%0A%20%20const%20%7B%20innerObject%3A%20%7B%20name%2C%20email%20%7D%20%3D%20%7B%7D%20%7D%20%3D%20props%3B%0D%0A%20%20console.log(name%2C%20email)%3B%0D%0A%7D%3B%0D%0A%0D%0A%2F%2F%20no%20errors%2C%20but%20is%20a%20little%20annoying%0D%0Aexport%20const%20nestedDestructure2%20%3D%20(props%3A%20Props)%20%3D%3E%20%7B%0D%0A%20%20const%20%7B%20innerObject%3A%20%7B%20name%20%3D%20undefined%2C%20email%20%3D%20undefined%20%7D%20%3D%20%7B%7D%20%7D%20%3D%20props%3B%0D%0A%20%20console.log(name%2C%20email)%3B%0D%0A%7D%3B%0D%0A%0D%0A%2F%2F%20no%20errors%2C%20but%20is%20a%20little%20annoying%0D%0Aexport%20const%20nestedDestructure3%20%3D%20(props%3A%20Props)%20%3D%3E%20%7B%0D%0A%20%20const%20%7B%20innerObject%20%3D%20%7B%7D%20%7D%20%3D%20props%3B%0D%0A%20%20const%20%7B%20name%2C%20email%20%7D%20%3D%20innerObject%3B%0D%0A%20%20console.log(name%2C%20email)%3B%0D%0A%7D%3B
codesandboxhttps://codesandbox.io/s/strictnullchecks-and-nested-destructuring-2bjyj
https://github.com/mihailik
mihailikhttps://github.com/mihailik
on May 23, 2019https://github.com/microsoft/TypeScript/issues/26235#issuecomment-495310442
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
this examplehttps://github.com/Microsoft/TypeScript/issues/26235#issuecomment-411584497
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#31711https://github.com/microsoft/TypeScript/pull/31711
on Jun 2, 2019https://github.com/microsoft/TypeScript/issues/26235#event-2382949085
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
on Jun 2, 2019https://github.com/microsoft/TypeScript/issues/26235#event-2382949617
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
TypeScript 3.4.0https://github.com/microsoft/TypeScript/milestone/86
TypeScript 3.6.0https://github.com/microsoft/TypeScript/milestone/93
on Jun 2, 2019https://github.com/microsoft/TypeScript/issues/26235#event-2382949673
Haroen Viaene (Haroenv)https://github.com/Haroenv
on Nov 13, 2019https://github.com/microsoft/TypeScript/issues/26235#event-2795284228
chore(TS): add correct default valuehttps://github.com/algolia/instantsearch/commit/cf7525a5f62640190f0c7f5ae346a402e0ac3162
cf7525ahttps://github.com/algolia/instantsearch/commit/cf7525a5f62640190f0c7f5ae346a402e0ac3162
Haroen Viaene (Haroenv)https://github.com/Haroenv
on Nov 21, 2019https://github.com/microsoft/TypeScript/issues/26235#event-2819656338
refactor(utils): migrate remaining utils to TypeScript (#4196)https://github.com/algolia/instantsearch/commit/d9dc425d3b55bfc930699fc66c53b6933ec0f814
#4196https://github.com/algolia/instantsearch/pull/4196
d9dc425https://github.com/algolia/instantsearch/commit/d9dc425d3b55bfc930699fc66c53b6933ec0f814
Youcef Mammar (tkrugg)https://github.com/tkrugg
on Nov 26, 2019https://github.com/microsoft/TypeScript/issues/26235#event-2832826504
refactor(utils): migrate remaining utils to TypeScript (#4196)https://github.com/algolia/instantsearch/commit/2027a81701915eb49c22f0d901189379987e0e07
#4196https://github.com/algolia/instantsearch/pull/4196
2027a81https://github.com/algolia/instantsearch/commit/2027a81701915eb49c22f0d901189379987e0e07
https://github.com/fardad-dev
Fardad Mohammadi (fardad-dev)https://github.com/fardad-dev
on Nov 12, 2020https://github.com/microsoft/TypeScript/issues/26235#issuecomment-726305321
https://github.com/ignacio-nacho-barbano
Ignacio (Nacho) Barbano (ignacio-nacho-barbano)https://github.com/ignacio-nacho-barbano
on Feb 4, 2021https://github.com/microsoft/TypeScript/issues/26235#issuecomment-773436769
#26235 (comment)https://github.com/microsoft/TypeScript/issues/26235#issuecomment-452955161
https://github.com/k-funk
Kevin Funk (k-funk)https://github.com/k-funk
on Mar 11, 2022https://github.com/microsoft/TypeScript/issues/26235#issuecomment-1065618828
https://github.com/xsjcTony
Aelita (xsjcTony)https://github.com/xsjcTony
on May 10, 2023https://github.com/microsoft/TypeScript/issues/26235#issuecomment-1541320161
#4598https://github.com/microsoft/TypeScript/pull/4598
playgroundhttps://www.typescriptlang.org/play/#src='use%20strict'%0D%0Ainterface%20Props%20%7B%0D%0A%20%20innerObject%3F%3A%20%7B%0D%0A%20%20%20%20name%3F%3A%20string%3B%0D%0A%20%20%20%20email%3F%3A%20string%3B%0D%0A%20%20%7D%3B%0D%0A%7D%0D%0A%0D%0A%2F%2F%20won't%20let%20name%20and%20email%20default%20to%20undefined%0D%0A%2F%2F%20Initializer%20provides%20no%20value%20for%20this%20binding%20element%20and%20the%20binding%20element%20has%20no%20default%20value.%20%0D%0Aexport%20const%20nestedDestructure1%20%3D%20(props%3A%20Props)%20%3D%3E%20%7B%0D%0A%20%20const%20%7B%20innerObject%3A%20%7B%20name%2C%20email%20%7D%20%3D%20%7B%7D%20%7D%20%3D%20props%3B%0D%0A%20%20console.log(name%2C%20email)%3B%0D%0A%7D%3B%0D%0A%0D%0A%2F%2F%20no%20errors%2C%20but%20is%20a%20little%20annoying%0D%0Aexport%20const%20nestedDestructure2%20%3D%20(props%3A%20Props)%20%3D%3E%20%7B%0D%0A%20%20const%20%7B%20innerObject%3A%20%7B%20name%20%3D%20undefined%2C%20email%20%3D%20undefined%20%7D%20%3D%20%7B%7D%20%7D%20%3D%20props%3B%0D%0A%20%20console.log(name%2C%20email)%3B%0D%0A%7D%3B%0D%0A%0D%0A%2F%2F%20no%20errors%2C%20but%20is%20a%20little%20annoying%0D%0Aexport%20const%20nestedDestructure3%20%3D%20(props%3A%20Props)%20%3D%3E%20%7B%0D%0A%20%20const%20%7B%20innerObject%20%3D%20%7B%7D%20%7D%20%3D%20props%3B%0D%0A%20%20const%20%7B%20name%2C%20email%20%7D%20%3D%20innerObject%3B%0D%0A%20%20console.log(name%2C%20email)%3B%0D%0A%7D%3B
codesandboxhttps://codesandbox.io/s/strictnullchecks-and-nested-destructuring-2bjyj
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on May 12, 2023https://github.com/microsoft/TypeScript/issues/26235#issuecomment-1546005901
microsofthttps://github.com/microsoft
on May 12, 2023https://github.com/microsoft/TypeScript/issues/26235#event-9234811047
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/26235
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/26235
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
TypeScript 3.6.0https://github.com/microsoft/TypeScript/milestone/93
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.