Title: StrictNullCheck incorrectly prevents the use of the indexed access operator · Issue #20141 · microsoft/TypeScript · GitHub
Open Graph Title: StrictNullCheck incorrectly prevents the use of the indexed access operator · Issue #20141 · microsoft/TypeScript
X Title: StrictNullCheck incorrectly prevents the use of the indexed access operator · Issue #20141 · microsoft/TypeScript
Description: TypeScript Version: 2.6.1 Code class Klass { prop1:{innerNumber:number} | null; setInnerNumber(newInnerNumber:Klass['prop1']['innerNumber']){ this.prop1 = {innerNumber:newInnerNumber} } } //Compile with --strictNullCheck Expected behavio...
Open Graph Description: TypeScript Version: 2.6.1 Code class Klass { prop1:{innerNumber:number} | null; setInnerNumber(newInnerNumber:Klass['prop1']['innerNumber']){ this.prop1 = {innerNumber:newInnerNumber} } } //Compile...
X Description: TypeScript Version: 2.6.1 Code class Klass { prop1:{innerNumber:number} | null; setInnerNumber(newInnerNumber:Klass['prop1']['innerNumber']){ this.prop1 = {innerNumber:newInnerNumbe...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/20141
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"StrictNullCheck incorrectly prevents the use of the indexed access operator","articleBody":"**TypeScript Version:** 2.6.1\r\n\r\n**Code**\r\n\r\n```ts\r\nclass Klass {\r\n prop1:{innerNumber:number} | null;\r\n setInnerNumber(newInnerNumber:Klass['prop1']['innerNumber']){\r\n this.prop1 = {innerNumber:newInnerNumber}\r\n }\r\n}\r\n//Compile with --strictNullCheck\r\n\r\n```\r\n\r\n**Expected behavior:**\r\nNo error.\r\n\r\n**Actual behavior:**\r\nProperty `innerNumber` does not exist on type `'{ innerNumber:number;} | null'`\r\n\r\nStrict null check should not be checked for indexed access operator.","author":{"url":"https://github.com/RainingChain","@type":"Person","name":"RainingChain"},"datePublished":"2017-11-19T17:26:04Z","url":"https://github.com/microsoft/TypeScript/issues/20141"}
| 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:f65b46f6-0d26-8b6a-08b2-58d41509a788 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B2C4:1EC9BC:4EBFD8:662627:6B00D994 |
| html-safe-nonce | 1bdf50ea937cf6c3cdced9a8fad22b30064289813e8a0e621aa459e556f61cfd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMkM0OjFFQzlCQzo0RUJGRDg6NjYyNjI3OjZCMDBEOTk0IiwidmlzaXRvcl9pZCI6IjUxMjQ3OTE1NDY3MzM5NzU5NTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 357fad1d72ad695597849524d0d7960a5dd6e508aade0f5fb026f17bc538f5f2 |
| hovercard-subject-tag | issue:275176030 |
| 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/20141/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0ab762614d1d1c7925913822b5e65cabde238951ad1fd7ce1d1570a1853d7bfa/microsoft/TypeScript/issues/20141 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0ab762614d1d1c7925913822b5e65cabde238951ad1fd7ce1d1570a1853d7bfa/microsoft/TypeScript/issues/20141 |
| og:image:alt | TypeScript Version: 2.6.1 Code class Klass { prop1:{innerNumber:number} | null; setInnerNumber(newInnerNumber:Klass['prop1']['innerNumber']){ this.prop1 = {innerNumber:newInnerNumber} } } //Compile... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | RainingChain |
| hostname | github.com |
| expected-hostname | github.com |
| None | a481f62a1e04c9b9bdcb5628230682c66d59006f5b13b080f79cba84a176905b |
| 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 | 84c8c5cc25e2fb7f2308428458538436baecc6d2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width