Title: Bad error message for assigning empty array to tuple type · Issue #6524 · microsoft/TypeScript · GitHub
Open Graph Title: Bad error message for assigning empty array to tuple type · Issue #6524 · microsoft/TypeScript
X Title: Bad error message for assigning empty array to tuple type · Issue #6524 · microsoft/TypeScript
Description: Reported in the IRC channel against 1.7.5. Still exists in 1.8.0-dev.20160117 var x: [number] = []; foo.ts(1,5): error TS2322: Type 'undefined[]' is not assignable to type '[number]'. Property '0' is missing in type 'undefined[]'. I gues...
Open Graph Description: Reported in the IRC channel against 1.7.5. Still exists in 1.8.0-dev.20160117 var x: [number] = []; foo.ts(1,5): error TS2322: Type 'undefined[]' is not assignable to type '[number]'. Property '0' ...
X Description: Reported in the IRC channel against 1.7.5. Still exists in 1.8.0-dev.20160117 var x: [number] = []; foo.ts(1,5): error TS2322: Type 'undefined[]' is not assignable to type '[number]'...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/6524
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bad error message for assigning empty array to tuple type","articleBody":"Reported in the IRC channel against 1.7.5. Still exists in 1.8.0-dev.20160117\n\n``` typescript\nvar x: [number] = [];\n```\n\n```\nfoo.ts(1,5): error TS2322: Type 'undefined[]' is not assignable to type '[number]'.\n Property '0' is missing in type 'undefined[]'.\n```\n\nI guess `undefined` comes from the fact that the RHS array is empty, so its element type is left uninitialized. Maybe you want to detect that and have a different error message? \"An empty array is not assignable to type [number].\" or something.\n","author":{"url":"https://github.com/Arnavion","@type":"Person","name":"Arnavion"},"datePublished":"2016-01-18T00:16:27Z","url":"https://github.com/microsoft/TypeScript/issues/6524"}
| 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:c2398abc-37ac-abc9-609d-d5a5270509b4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DA9E:17FB7:1624B5:1BE707:6B00FA04 |
| html-safe-nonce | 097e7e8561eff30753a59297defd4647edd41cb78d318496d0e6f8813e4b81c6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTlFOjE3RkI3OjE2MjRCNToxQkU3MDc6NkIwMEZBMDQiLCJ2aXNpdG9yX2lkIjoiMTIyODE3NzQ0MTMwMzQxMzgxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f69f0bad3e35e44d01dce1e322876541dc6e84dfe4d6af9c2734e2bab7def384 |
| hovercard-subject-tag | issue:127134649 |
| 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/6524/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dc7a128dd5c19c3c5dc55fa6984564159a808c8e32766a562f2712d2e0a5ff2f/microsoft/TypeScript/issues/6524 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dc7a128dd5c19c3c5dc55fa6984564159a808c8e32766a562f2712d2e0a5ff2f/microsoft/TypeScript/issues/6524 |
| og:image:alt | Reported in the IRC channel against 1.7.5. Still exists in 1.8.0-dev.20160117 var x: [number] = []; foo.ts(1,5): error TS2322: Type 'undefined[]' is not assignable to type '[number]'. Property '0' ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Arnavion |
| hostname | github.com |
| expected-hostname | github.com |
| None | e208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187 |
| 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 | 7dafd017fb7809a839c443dba08622af38e63c09 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width