Title: Weird uninitialized variable error for destructured members of type parameter constrained to homomorphic mapped type where member is declared optional · Issue #20994 · microsoft/TypeScript · GitHub
Open Graph Title: Weird uninitialized variable error for destructured members of type parameter constrained to homomorphic mapped type where member is declared optional · Issue #20994 · microsoft/TypeScript
X Title: Weird uninitialized variable error for destructured members of type parameter constrained to homomorphic mapped type where member is declared optional · Issue #20994 · microsoft/TypeScript
Description: Found in Formik by Wesley Wigham (@weswigham) who patiently worked with me to find the minimal repro. Run the following with strictNullChecks interface Options { a?: number | object; b: () => void; } class C
Open Graph Description: Found in Formik by Wesley Wigham (@weswigham) who patiently worked with me to find the minimal repro. Run the following with strictNullChecks interface Options { a?: number | object; b: () => void;...
X Description: Found in Formik by Wesley Wigham (@weswigham) who patiently worked with me to find the minimal repro. Run the following with strictNullChecks interface Options { a?: number | object; b: () => vo...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/20994
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Weird uninitialized variable error for destructured members of type parameter constrained to homomorphic mapped type where member is declared optional","articleBody":"Found in Formik by @weswigham who patiently worked with me to find the minimal repro.\r\n\r\nRun the following with `strictNullChecks`\r\n\r\n```ts\r\ninterface Options {\r\n a?: number | object;\r\n b: () => void;\r\n}\r\n\r\nclass C\u003cT extends Options> {\r\n foo!: { [P in keyof T]: T[P] }\r\n\r\n method() {\r\n let { a, b } = this.foo;\r\n !(a && b)\r\n a\r\n // TypeScript issues an error on 'a' above:\r\n // Variable 'a' is used before being assigned.'\r\n }\r\n}\r\n```","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2018-01-03T23:52:37Z","url":"https://github.com/microsoft/TypeScript/issues/20994"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9c2df72d-38dc-7aff-b72a-3e4df708c3d5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C176:91CF4:91F7E5:C35A52:6B00E1C7 |
| html-safe-nonce | 95a2334baaee8586344ff2ea70d7a1747d17331eeccc263ed8523a202cfe568c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTc2OjkxQ0Y0OjkxRjdFNTpDMzVBNTI6NkIwMEUxQzciLCJ2aXNpdG9yX2lkIjoiMzAzODMxNzI3NzgxMzQ2NTU0NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3efe2ce0e9b9a5838282766810f5b7d7b6cedc3cf2b57e7a8e078360a4e80bbf |
| hovercard-subject-tag | issue:285844166 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/20994/issue_layout |
| twitter:image | https://opengraph.githubassets.com/831bb96b100d4eb956d863def75f8c8011289c0f6ef969530895198ed244a091/microsoft/TypeScript/issues/20994 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/831bb96b100d4eb956d863def75f8c8011289c0f6ef969530895198ed244a091/microsoft/TypeScript/issues/20994 |
| og:image:alt | Found in Formik by Wesley Wigham (@weswigham) who patiently worked with me to find the minimal repro. Run the following with strictNullChecks interface Options { a?: number | object; b: () => void;... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DanielRosenwasser |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width