Title: strictNullChecks mode - Variable is used before being assigned. · Issue #10641 · microsoft/TypeScript · GitHub
Open Graph Title: strictNullChecks mode - Variable is used before being assigned. · Issue #10641 · microsoft/TypeScript
X Title: strictNullChecks mode - Variable is used before being assigned. · Issue #10641 · microsoft/TypeScript
Description: TypeScript Version: nightly (2.0.2) In strictNullChecks mode only: Code const CONFIG = { foo: '', setFoo: function(foo: string) { // accessing (reading or writing) CONFIG.foo is not allowed! CONFIG.foo = foo; // <-- Error: Variable 'CONF...
Open Graph Description: TypeScript Version: nightly (2.0.2) In strictNullChecks mode only: Code const CONFIG = { foo: '', setFoo: function(foo: string) { // accessing (reading or writing) CONFIG.foo is not allowed! CONFIG...
X Description: TypeScript Version: nightly (2.0.2) In strictNullChecks mode only: Code const CONFIG = { foo: '', setFoo: function(foo: string) { // accessing (reading or writing) CONFIG.foo is not allowed...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/10641
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"strictNullChecks mode - Variable is used before being assigned.","articleBody":"\u003c!-- BUGS: Please use this template. -->\n\n\u003c!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\n\n\u003c!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\n\n**TypeScript Version:** nightly (2.0.2)\n\nIn strictNullChecks mode only:\n\n**Code**\n\n``` ts\nconst CONFIG = {\n foo: '',\n setFoo: function(foo: string) {\n // accessing (reading or writing) CONFIG.foo is not allowed!\n CONFIG.foo = foo; // \u003c-- Error: Variable 'CONFIG' is used before being assigned.\n }\n};\n```\n\n**Expected behavior:**\n\nI don't see why this is not a valid statement.\n\n**Actual behavior:** \n\nTrying to access any _defined_ member of `CONFIG` in a method, defined within the object itself, raises an error: _Variable 'CONFIG' is used before being assigned._\n","author":{"url":"https://github.com/aliai","@type":"Person","name":"aliai"},"datePublished":"2016-08-31T14:27:08Z","url":"https://github.com/microsoft/TypeScript/issues/10641"}
| 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:c49a7b8c-22c0-15be-d3dc-9d9d4be14ece |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E77C:2DBB21:B47014:F1E5ED:6B00F501 |
| html-safe-nonce | 31c3b83ad83f2c646a9891dee1c071c1edf9371fd5d358ed4c22e5614f880b04 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzdDOjJEQkIyMTpCNDcwMTQ6RjFFNUVEOjZCMDBGNTAxIiwidmlzaXRvcl9pZCI6IjIwMTMyMzg0NTExODQzOTk2MTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 83afcb9a1cbdacffed7fa61e34dd6fb1d750db05685cdd2e193f2cbdcc83efc2 |
| hovercard-subject-tag | issue:174287901 |
| 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/10641/issue_layout |
| twitter:image | https://opengraph.githubassets.com/55940ac7b9ae234fb20a4274c36b9e1333c6effc4c3e0c0c26e659f7bce86f76/microsoft/TypeScript/issues/10641 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/55940ac7b9ae234fb20a4274c36b9e1333c6effc4c3e0c0c26e659f7bce86f76/microsoft/TypeScript/issues/10641 |
| og:image:alt | TypeScript Version: nightly (2.0.2) In strictNullChecks mode only: Code const CONFIG = { foo: '', setFoo: function(foo: string) { // accessing (reading or writing) CONFIG.foo is not allowed! CONFIG... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | aliai |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width