Title: "Used before assigned" error with arrow functions and strict null checks · Issue #9382 · microsoft/TypeScript · GitHub
Open Graph Title: "Used before assigned" error with arrow functions and strict null checks · Issue #9382 · microsoft/TypeScript
X Title: "Used before assigned" error with arrow functions and strict null checks · Issue #9382 · microsoft/TypeScript
Description: TypeScript Version: 1.9.0-dev.20160627-1.0 Code const f = () => { return f; }; Compiled with --strictNullChecks. Expected behavior: No errors. Actual behavior: foo.ts(1,26): error TS2454: Variable 'f' is used before being assigned. It se...
Open Graph Description: TypeScript Version: 1.9.0-dev.20160627-1.0 Code const f = () => { return f; }; Compiled with --strictNullChecks. Expected behavior: No errors. Actual behavior: foo.ts(1,26): error TS2454: Variable ...
X Description: TypeScript Version: 1.9.0-dev.20160627-1.0 Code const f = () => { return f; }; Compiled with --strictNullChecks. Expected behavior: No errors. Actual behavior: foo.ts(1,26): error TS2454: Variab...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/9382
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"Used before assigned\" error with arrow functions and strict null checks","articleBody":"**TypeScript Version:** \n\n1.9.0-dev.20160627-1.0\n\n**Code**\n\n``` ts\nconst f = () => { return f; };\n```\n\nCompiled with `--strictNullChecks`.\n\n**Expected behavior:**\n\nNo errors.\n\n**Actual behavior:** \n\n```\nfoo.ts(1,26): error TS2454: Variable 'f' is used before being assigned.\n```\n\nIt sems to be impossible to call `f` before `f` is assigned, so I don't think this should trigger an error.\n","author":{"url":"https://github.com/Christoph-D","@type":"Person","name":"Christoph-D"},"datePublished":"2016-06-27T22:37:52Z","url":"https://github.com/microsoft/TypeScript/issues/9382"}
| 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:6993d95d-0f5b-77c4-8d6d-606485e0a5c9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E362:22DB35:C0B932:F94494:6B00ED1A |
| html-safe-nonce | 7f7cf8c26ec21af6b2d49ebc32f9c644643083c54a86131dc0d81066151c63f3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzYyOjIyREIzNTpDMEI5MzI6Rjk0NDk0OjZCMDBFRDFBIiwidmlzaXRvcl9pZCI6IjU2NzY3MTMyOTU0NDk0ODQ1NzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6bc0425810ea313ca9f49095f356e2fd12953e4efb2b53d14496100408b463d4 |
| hovercard-subject-tag | issue:162564356 |
| 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/9382/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cd17f81fcc40005305cd97b9c03c492104eb05ab4ac3789bb52b62fbc585ac4c/microsoft/TypeScript/issues/9382 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cd17f81fcc40005305cd97b9c03c492104eb05ab4ac3789bb52b62fbc585ac4c/microsoft/TypeScript/issues/9382 |
| og:image:alt | TypeScript Version: 1.9.0-dev.20160627-1.0 Code const f = () => { return f; }; Compiled with --strictNullChecks. Expected behavior: No errors. Actual behavior: foo.ts(1,26): error TS2454: Variable ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Christoph-D |
| 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