Title: Regression for omitted lambda parameter with tuple args · Issue #30301 · microsoft/TypeScript · GitHub
Open Graph Title: Regression for omitted lambda parameter with tuple args · Issue #30301 · microsoft/TypeScript
X Title: Regression for omitted lambda parameter with tuple args · Issue #30301 · microsoft/TypeScript
Description: TypeScript Version: 3.4.0-dev.20190309 Search Terms: 3.4 tuple lambda Code The following snippet compiles fine in TS 3.3 whereas it emits an error in TS 3.4. type MyTupleItem = {}; type MyTuple = [MyTupleItem, ...MyTupleItem[]]; type Gen...
Open Graph Description: TypeScript Version: 3.4.0-dev.20190309 Search Terms: 3.4 tuple lambda Code The following snippet compiles fine in TS 3.3 whereas it emits an error in TS 3.4. type MyTupleItem = {}; type MyTuple = [...
X Description: TypeScript Version: 3.4.0-dev.20190309 Search Terms: 3.4 tuple lambda Code The following snippet compiles fine in TS 3.3 whereas it emits an error in TS 3.4. type MyTupleItem = {}; type MyTuple = [...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/30301
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Regression for omitted lambda parameter with tuple args","articleBody":"\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** 3.4.0-dev.20190309\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** 3.4 tuple lambda\r\n\r\n**Code**\r\n\r\nThe following snippet compiles fine in TS 3.3 whereas it emits an error in TS 3.4.\r\n\r\n```ts\r\ntype MyTupleItem = {};\r\ntype MyTuple = [MyTupleItem, ...MyTupleItem[]];\r\n\r\ntype GenericFunction\u003cT extends MyTuple> = (...fromArgs: T) => void;\r\n\r\nclass GenericClass\u003cT extends MyTuple> {\r\n from: T | undefined;\r\n}\r\n\r\nfunction createClass\u003cT extends MyTuple>(f: GenericFunction\u003cT>): GenericClass\u003cT> {\r\n return new GenericClass\u003cT>(/* ... use f */);\r\n}\r\n\r\nfunction consumeClass(c: GenericClass\u003c[string, boolean]>) { }\r\n\r\n// ERROR:\r\nconsumeClass(createClass(str => console.log(str.length)));\r\n\r\n// WORKS:\r\nconsumeClass(createClass((str, _unused_num) => console.log(str.length)));\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nNo compile error.\r\n\r\n**Actual behavior:**\r\n\r\n```plain\r\n>npx tsc TypeScriptIssueNext.ts\r\nTypeScriptIssueNext.ts:18:14 - error TS2345: Argument of type 'GenericClass\u003c[string]>' is not assignable to parameter of type 'GenericClass\u003c[string, boolean]>'.\r\n Property '1' is missing in type '[string]' but required in type '[string, boolean]'.\r\n\r\n18 consumeClass(createClass(str => console.log(str.length)));\r\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n```\r\n\r\n**Playground Link:** [Link](https://www.typescriptlang.org/play/#src=type%20MyTupleItem%20%3D%20%7B%7D%3B%0Atype%20MyTuple%20%3D%20%5BMyTupleItem%2C%20...MyTupleItem%5B%5D%5D%3B%0A%0Atype%20GenericFunction%3CT%20extends%20MyTuple%3E%20%3D%20(...fromArgs%3A%20T)%20%3D%3E%20void%3B%0A%0Aclass%20GenericClass%3CT%20extends%20MyTuple%3E%20%7B%0A%20%20%20%20from%3A%20T%20%7C%20undefined%3B%0A%7D%0A%0Afunction%20createClass%3CT%20extends%20MyTuple%3E(f%3A%20GenericFunction%3CT%3E)%3A%20GenericClass%3CT%3E%20%7B%0A%20%20%20%20return%20new%20GenericClass%3CT%3E(%2F*%20...%20use%20f%20*%2F)%3B%0A%7D%0A%0Afunction%20consumeClass(c%3A%20GenericClass%3C%5Bstring%2C%20boolean%5D%3E)%20%7B%20%7D%0A%0A%2F%2F%20ERROR%3A%0AconsumeClass(createClass(str%20%3D%3E%20console.log(str.length)))%3B%0A%0A%2F%2F%20WORKS%3A%0AconsumeClass(createClass((str%2C%20num)%20%3D%3E%20console.log(str.length)))%3B%0A)","author":{"url":"https://github.com/ulrichb","@type":"Person","name":"ulrichb"},"datePublished":"2019-03-10T01:03:06Z","url":"https://github.com/microsoft/TypeScript/issues/30301"}
| 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:900950aa-d749-35f2-c050-71c140ddfd34 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BCE8:24645:116036D:16F39B5:6B01E387 |
| html-safe-nonce | 26be447cf92dbb0e58b436f9a437ebe53197394dd2bf3d028770a10602cbaa19 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0U4OjI0NjQ1OjExNjAzNkQ6MTZGMzlCNTo2QjAxRTM4NyIsInZpc2l0b3JfaWQiOiI4NjE5ODE2NTQ5NTg0MzMxNjU1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e80de427b019eb9e40a1227cc5df464655630c55f3938049a22c8a35bbef731e |
| hovercard-subject-tag | issue:419133082 |
| 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/30301/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6b85f7a7105d8b84254168560d1f98145f3982cbb1921c742af0e4b94e95e200/microsoft/TypeScript/issues/30301 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6b85f7a7105d8b84254168560d1f98145f3982cbb1921c742af0e4b94e95e200/microsoft/TypeScript/issues/30301 |
| og:image:alt | TypeScript Version: 3.4.0-dev.20190309 Search Terms: 3.4 tuple lambda Code The following snippet compiles fine in TS 3.3 whereas it emits an error in TS 3.4. type MyTupleItem = {}; type MyTuple = [... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ulrichb |
| 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