Title: 3.5.1 strictFunctionTypes broke code. · Issue #31698 · microsoft/TypeScript · GitHub
Open Graph Title: 3.5.1 strictFunctionTypes broke code. · Issue #31698 · microsoft/TypeScript
X Title: 3.5.1 strictFunctionTypes broke code. · Issue #31698 · microsoft/TypeScript
Description: TypeScript Version: 3.6.0-dev.20190531 Search Terms: strictFunctionTypes Code Repo: https://github.com/deskoh/sinon-ts-issue Updated code: interface MyType
Open Graph Description: TypeScript Version: 3.6.0-dev.20190531 Search Terms: strictFunctionTypes Code Repo: https://github.com/deskoh/sinon-ts-issue Updated code: interface MyType
X Description: TypeScript Version: 3.6.0-dev.20190531 Search Terms: strictFunctionTypes Code Repo: https://github.com/deskoh/sinon-ts-issue Updated code: interface MyType<T extends any[]> { (...args: T): an...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/31698
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"3.5.1 strictFunctionTypes broke code.","articleBody":"\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** 3.6.0-dev.20190531\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** strictFunctionTypes\r\n\r\n**Code**\r\n\r\nRepo: https://github.com/deskoh/sinon-ts-issue\r\n\r\nUpdated code:\r\n\r\n```ts\r\ninterface MyType\u003cT extends any[]> {\r\n (...args: T): any;\r\n}\r\n\r\ndeclare let a: MyType\u003c[any]>;\r\ndeclare let b: MyType\u003cany[]>;\r\n\r\n// Following is an error in 3.5.1 but not 3.4.5 with `strictFunctionTypes: true`\r\n// Type 'MyType\u003c[any]>' is not assignable to type 'MyType\u003cany[]>'.\r\n// Property '0' is missing in type 'any[]' but required in type '[any]'.\r\nb = a;\r\n```\r\n\r\nOriginal example:\r\n```ts\r\n// Original example\r\nimport { SinonStub } from 'sinon';\r\n\r\nlet y: SinonStub\u003c[any], any> = {} as any;\r\n\r\n// Following is an error in 3.5.1 but not 3.4.5 with `strictFunctionTypes: true`\r\n// Type 'SinonStub\u003c[any], any>' is not assignable to type 'SinonStub\u003cany[], any>'.\r\n// Property '0' is missing in type 'any[]' but required in type '[any]'.\r\nlet x: SinonStub\u003cany[], any> = y;\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nAs described above.\r\n\r\n**Actual behavior:**\r\n\r\nAs described above.\r\n\r\n**Playground Link:** N.A. (TS 3.5.1 not available yet, see code repo above)\r\n\r\n**Related Issues:** N.A.\r\n","author":{"url":"https://github.com/deskoh","@type":"Person","name":"deskoh"},"datePublished":"2019-05-31T13:17:18Z","url":"https://github.com/microsoft/TypeScript/issues/31698"}
| 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:7cf79c43-fa60-d345-60c7-88e1df6906d3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8714:EA06E:33B7522:41C1FA4:6B01C141 |
| html-safe-nonce | c8ce7c6a133edb8398e805eedd670d1f2ab45b8e631fd83cea779c98424529e6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzE0OkVBMDZFOjMzQjc1MjI6NDFDMUZBNDo2QjAxQzE0MSIsInZpc2l0b3JfaWQiOiIxMjUyMDc5MTg0NDM2NjQyMTEzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 056a7d95a59dbf4e4396199d2631b638b4d23c2ef06cdb3abeee8539d44f2f49 |
| hovercard-subject-tag | issue:450794899 |
| 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/31698/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b8d11a525b84e05891b43a1a4a744036e33b6560192454bd906a986b891f1136/microsoft/TypeScript/issues/31698 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b8d11a525b84e05891b43a1a4a744036e33b6560192454bd906a986b891f1136/microsoft/TypeScript/issues/31698 |
| og:image:alt | TypeScript Version: 3.6.0-dev.20190531 Search Terms: strictFunctionTypes Code Repo: https://github.com/deskoh/sinon-ts-issue Updated code: interface MyType |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | deskoh |
| 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