Title: type cast in tuples · Issue #28700 · microsoft/TypeScript · GitHub
Open Graph Title: type cast in tuples · Issue #28700 · microsoft/TypeScript
X Title: type cast in tuples · Issue #28700 · microsoft/TypeScript
Description: TypeScript Version: 3.1.6 Code const a1:[number, number, boolean] = [1, 0, false]; //... code if (a1[2]) { a1[2] = false; //error TS2322 } Expected behavior: no error (run in TypeScript 2.9.2) Actual behavior: TS2322: Type 'false' is not...
Open Graph Description: TypeScript Version: 3.1.6 Code const a1:[number, number, boolean] = [1, 0, false]; //... code if (a1[2]) { a1[2] = false; //error TS2322 } Expected behavior: no error (run in TypeScript 2.9.2) Actu...
X Description: TypeScript Version: 3.1.6 Code const a1:[number, number, boolean] = [1, 0, false]; //... code if (a1[2]) { a1[2] = false; //error TS2322 } Expected behavior: no error (run in TypeScript 2.9.2) Actu...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/28700
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":" type cast in tuples","articleBody":"**TypeScript Version:** 3.1.6\r\n\r\n**Code**\r\n\r\n```ts\r\n\t\tconst a1:[number, number, boolean] = [1, 0, false];\r\n\t\t//... code\r\n\t\tif (a1[2]) {\r\n\t\t\ta1[2] = false; //error TS2322\r\n\t\t}\r\n```\r\n\r\n**Expected behavior:**\r\nno error (run in TypeScript 2.9.2)\r\n\r\n**Actual behavior:**\r\nTS2322: Type 'false' is not assignable to type 'true'.\r\n\r\nwhy is the type cast to true ?\r\n\r\n","author":{"url":"https://github.com/midiusRed","@type":"Person","name":"midiusRed"},"datePublished":"2018-11-28T09:30:46Z","url":"https://github.com/microsoft/TypeScript/issues/28700"}
| 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:efcc1569-ecaf-c34e-fa9d-0ba4341c8320 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BD26:3CEE1E:188BAC:22C38C:6B04666D |
| html-safe-nonce | 2b9c4fe6829fc341637705e3449d29d6a42ccc17aa02b34745ecd00fc62d7cf6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDI2OjNDRUUxRToxODhCQUM6MjJDMzhDOjZCMDQ2NjZEIiwidmlzaXRvcl9pZCI6IjI2OTczMDYxOTQ1OTAzMjg0MjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4fd8447458ece4d1f0fd3373f7bb64e8d8acecb1e289e685ae5691d2e25a1606 |
| hovercard-subject-tag | issue:385176082 |
| 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/28700/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ba65117638c420e2655b7a78f3b0c37a20c0cea537057d9bf0ba4518f175d8be/microsoft/TypeScript/issues/28700 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ba65117638c420e2655b7a78f3b0c37a20c0cea537057d9bf0ba4518f175d8be/microsoft/TypeScript/issues/28700 |
| og:image:alt | TypeScript Version: 3.1.6 Code const a1:[number, number, boolean] = [1, 0, false]; //... code if (a1[2]) { a1[2] = false; //error TS2322 } Expected behavior: no error (run in TypeScript 2.9.2) Actu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | midiusRed |
| hostname | github.com |
| expected-hostname | github.com |
| None | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| 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 | ca4d07a7cef4e4b75f821dc25e7300d80c1450a9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width