Title: Destructuring array into an object is assignable to an array type · Issue #34780 · microsoft/TypeScript · GitHub
Open Graph Title: Destructuring array into an object is assignable to an array type · Issue #34780 · microsoft/TypeScript
X Title: Destructuring array into an object is assignable to an array type · Issue #34780 · microsoft/TypeScript
Description: TypeScript Version: 3.8.0-dev.20191026 Search Terms: array destructuring object array destructure assign Code let bar = [1, 2, 3] let foo: any[] = { ...bar } console.log(Array.isArray(foo)) // false Expected behavior: Typescript errors a...
Open Graph Description: TypeScript Version: 3.8.0-dev.20191026 Search Terms: array destructuring object array destructure assign Code let bar = [1, 2, 3] let foo: any[] = { ...bar } console.log(Array.isArray(foo)) // fals...
X Description: TypeScript Version: 3.8.0-dev.20191026 Search Terms: array destructuring object array destructure assign Code let bar = [1, 2, 3] let foo: any[] = { ...bar } console.log(Array.isArray(foo)) // fals...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/34780
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Destructuring array into an object is assignable to an array type","articleBody":"**TypeScript Version:** 3.8.0-dev.20191026\r\n\r\n**Search Terms:**\r\n- array destructuring object\r\n- array destructure assign\r\n\r\n**Code**\r\n\r\n```ts\r\nlet bar = [1, 2, 3]\r\n\r\nlet foo: any[] = { ...bar }\r\n\r\nconsole.log(Array.isArray(foo)) // false\r\n```\r\n\r\n**Expected behavior:** Typescript errors about type mismatch.\r\n\r\n**Actual behavior:** Typescript does neither warn nor error about this and `foo` is no longer an array.\r\n\r\n**Playground Link:** https://www.typescriptlang.org/play/?ts=3.8.0-dev.20191026\u0026ssl=1\u0026ssc=18\u0026pln=1\u0026pc=8#code/DYUwLgBARghgThAvBA2gRgDQQExYMwC6AUEaJAGYD2lAXBDAHYCeKBSEA3hAHS+wIBfEgGNKDAM6VQ3YJQDmACgCCcODCbcAluJVqmCqpQCURiAHozEcjGDiQQA\r\n\r\n**Related Issues:** #14768","author":{"url":"https://github.com/strawberry-choco","@type":"Person","name":"strawberry-choco"},"datePublished":"2019-10-28T19:53:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/34780/TypeScript/issues/34780"}
| 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:f91be74f-15a3-b9a3-58dc-6636af3d0a0f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9190:31F68:10FD06:186799:6A621704 |
| html-safe-nonce | c694d1e469b92a11120adc6190354115c8ed16c728a5f05cdd7043ebee7fc144 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTkwOjMxRjY4OjEwRkQwNjoxODY3OTk6NkE2MjE3MDQiLCJ2aXNpdG9yX2lkIjoiNDk2MTMwMTY3MDk4MTE0NjM3MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4aea566c5373f49fb8f3a19435c6c37553de53c5566c7a7de1b2ae7646b05965 |
| hovercard-subject-tag | issue:513521768 |
| 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/34780/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ebc4902c3401776078144764a843202e63aa08a9f26ecc2700210bb6c5c5929d/microsoft/TypeScript/issues/34780 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ebc4902c3401776078144764a843202e63aa08a9f26ecc2700210bb6c5c5929d/microsoft/TypeScript/issues/34780 |
| og:image:alt | TypeScript Version: 3.8.0-dev.20191026 Search Terms: array destructuring object array destructure assign Code let bar = [1, 2, 3] let foo: any[] = { ...bar } console.log(Array.isArray(foo)) // fals... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | strawberry-choco |
| hostname | github.com |
| expected-hostname | github.com |
| None | ccf61cb7ab435725b916ed640f57c45b2c4721db9469bc32656080efc5214b3e |
| 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 | a7585b3d2ee639495a70ce464d0a18bad88ea12c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width