Title: Using rest parameters in JavaScript type annotations seems broken in 3.1 · Issue #28637 · microsoft/TypeScript · GitHub
Open Graph Title: Using rest parameters in JavaScript type annotations seems broken in 3.1 · Issue #28637 · microsoft/TypeScript
X Title: Using rest parameters in JavaScript type annotations seems broken in 3.1 · Issue #28637 · microsoft/TypeScript
Description: TypeScript Version: 3.3.0-dev.20181121 Search Terms: js, javascript, A rest parameter must be of an array type Code //@ts-check /** @type {(...bar: string[]) => void} */ function foo(...bar) {} Expected behavior: Doesn't report any error...
Open Graph Description: TypeScript Version: 3.3.0-dev.20181121 Search Terms: js, javascript, A rest parameter must be of an array type Code //@ts-check /** @type {(...bar: string[]) => void} */ function foo(...bar) {} Exp...
X Description: TypeScript Version: 3.3.0-dev.20181121 Search Terms: js, javascript, A rest parameter must be of an array type Code //@ts-check /** @type {(...bar: string[]) => void} */ function foo(...bar) {} ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/28637
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Using rest parameters in JavaScript type annotations seems broken in 3.1","articleBody":"\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** 3.3.0-dev.20181121\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** js, javascript, A rest parameter must be of an array type\r\n\r\n**Code**\r\n\r\n```ts\r\n//@ts-check\r\n/** @type {(...bar: string[]) => void} */\r\nfunction foo(...bar) {}\r\n```\r\n\r\n**Expected behavior:**\r\nDoesn't report any errors. Type of `bar` parameter is `string[]`.\r\n\r\n**Actual behavior:**\r\n```\r\nasdf.js:3:14 - error TS2370: A rest parameter must be of an array type.\r\n\r\n3 function foo(...bar) {}\r\n ~~~~~~\r\n\r\nFound 1 error.\r\n```\r\n\r\nVS Code intellisense shows `bar` is `string` instead of `string[]`.\r\n\r\nTypeScript 3.0.3 works as expected, 3.1.1 and later versions don't.\r\n","author":{"url":"https://github.com/the-ress","@type":"Person","name":"the-ress"},"datePublished":"2018-11-21T19:03:37Z","url":"https://github.com/microsoft/TypeScript/issues/28637"}
| 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:fe5f5124-0ae3-f463-e3a0-337560e5ef2e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 92A4:2D40DE:27C3AA:3248BF:6B01001A |
| html-safe-nonce | be2f48900f87b9be7db0a9aadc4fe464bcabc099e8248faf9bd4c64bea9be7c7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MkE0OjJENDBERToyN0MzQUE6MzI0OEJGOjZCMDEwMDFBIiwidmlzaXRvcl9pZCI6IjQ1NzEzNDQ4OTEzNTQ4NzM4ODIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e206384c53f34e39fc7a2ea708fc8b4d38847b5002f176fd005e411fa2ad5455 |
| hovercard-subject-tag | issue:383255915 |
| 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/28637/issue_layout |
| twitter:image | https://opengraph.githubassets.com/45138d3e735ea1bf9a4712623b6b723f8f3f781f19b264608368373ef79fd668/microsoft/TypeScript/issues/28637 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/45138d3e735ea1bf9a4712623b6b723f8f3f781f19b264608368373ef79fd668/microsoft/TypeScript/issues/28637 |
| og:image:alt | TypeScript Version: 3.3.0-dev.20181121 Search Terms: js, javascript, A rest parameter must be of an array type Code //@ts-check /** @type {(...bar: string[]) => void} */ function foo(...bar) {} Exp... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | the-ress |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| 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 | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width