Title: block scoped variables erroneously error on declaration order · Issue #4244 · microsoft/TypeScript · GitHub
Open Graph Title: block scoped variables erroneously error on declaration order · Issue #4244 · microsoft/TypeScript
X Title: block scoped variables erroneously error on declaration order · Issue #4244 · microsoft/TypeScript
Description: The following example does not compile, claiming the block-scoped variables are used before declaration, which is not true. The equivalent JavaScript version executes correctly. function foo() { a = 13; var c = b; } let a: number; const ...
Open Graph Description: The following example does not compile, claiming the block-scoped variables are used before declaration, which is not true. The equivalent JavaScript version executes correctly. function foo() { a ...
X Description: The following example does not compile, claiming the block-scoped variables are used before declaration, which is not true. The equivalent JavaScript version executes correctly. function foo() { a ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/4244
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"block scoped variables erroneously error on declaration order","articleBody":"The following example does not compile, claiming the block-scoped variables are used before declaration, which is not true. The equivalent JavaScript version executes correctly.\n\n``` typescript\nfunction foo() {\n a = 13;\n var c = b;\n}\n\nlet a: number;\nconst b = 42;\n```\n\n[Playground Example](http://www.typescriptlang.org/Playground#src=function%20foo%28%29%20%7B%0A%09a%20%3D%2013%3B%0A%09var%20c%20%3D%20b%3B%0A%7D%0A%0Alet%20a%3A%20number%3B%0Aconst%20b%20%3D%2042%3B)\n","author":{"url":"https://github.com/sccolbert","@type":"Person","name":"sccolbert"},"datePublished":"2015-08-09T19:27:38Z","url":"https://github.com/microsoft/TypeScript/issues/4244"}
| 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:4bf2fde8-2ada-8d3e-987b-98acf62d1146 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E54A:2679E9:1FFC79B:2AA4296:6B018121 |
| html-safe-nonce | 92976531c56309dee24ea563d14b71440e88b82a0531e8f187eefc1a89e0a5ea |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTRBOjI2NzlFOToxRkZDNzlCOjJBQTQyOTY6NkIwMTgxMjEiLCJ2aXNpdG9yX2lkIjoiMTI0OTY5ODI5MDc5MDkyNDU3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0a075b4297f509b5eb2a5c547231fc35eacec2089e473a0f2b0786399a55e692 |
| hovercard-subject-tag | issue:99921469 |
| 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/4244/issue_layout |
| twitter:image | https://opengraph.githubassets.com/256c11f6b613e91a29a1fa6aadbe63a5efa7848b824111766127bf0b57184396/microsoft/TypeScript/issues/4244 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/256c11f6b613e91a29a1fa6aadbe63a5efa7848b824111766127bf0b57184396/microsoft/TypeScript/issues/4244 |
| og:image:alt | The following example does not compile, claiming the block-scoped variables are used before declaration, which is not true. The equivalent JavaScript version executes correctly. function foo() { a ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sccolbert |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width