Title: Support for skipping type parameter constraints when merging interfaces is order dependent · Issue #23909 · microsoft/TypeScript · GitHub
Open Graph Title: Support for skipping type parameter constraints when merging interfaces is order dependent · Issue #23909 · microsoft/TypeScript
X Title: Support for skipping type parameter constraints when merging interfaces is order dependent · Issue #23909 · microsoft/TypeScript
Description: TypeScript Version: master (618da24) Search Terms: type parameter same merging constraint Code // Error: "All declarations of 'A' must have identical type parameters." interface A
Open Graph Description: TypeScript Version: master (618da24) Search Terms: type parameter same merging constraint Code // Error: "All declarations of 'A' must have identical type parameters." interface A
X Description: TypeScript Version: master (618da24) Search Terms: type parameter same merging constraint Code // Error: "All declarations of 'A' must have identical type parameters." interface A...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/23909
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support for skipping type parameter constraints when merging interfaces is order dependent","articleBody":"\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** master (618da24)\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** type parameter same merging constraint\r\n\r\n**Code**\r\n\r\n```ts\r\n// Error: \"All declarations of 'A' must have identical type parameters.\"\r\ninterface A\u003cT> { }\r\ninterface A\u003cT extends string> { }\r\n\r\n// No error\r\ninterface B\u003cT extends string> { }\r\ninterface B\u003cT> { }\r\n```\r\n\r\n**Expected behavior:** Same for A and B.\r\n\r\n**Actual behavior:** Different behavior for A and B as indicated.\r\n\r\n**Playground Link:** [link](https://www.typescriptlang.org/play/#src=%2F%2F%20Error%3A%20%22All%20declarations%20of%20'A'%20must%20have%20identical%20type%20parameters.%22%0D%0Ainterface%20A%3CT%3E%20%7B%20%7D%0D%0Ainterface%20A%3CT%20extends%20string%3E%20%7B%20%7D%0D%0A%0D%0A%2F%2F%20No%20error%0D%0Ainterface%20B%3CT%20extends%20string%3E%20%7B%20%7D%0D%0Ainterface%20B%3CT%3E%20%7B%20%7D)\r\n\r\n**Related Issues:** #20018\r\n\r\nI noticed this while trying to understand the code of `areTypeParametersIdentical` for another project. The problem is that `getConstraintDeclaration` always looks at the first declaration.","author":{"url":"https://github.com/mattmccutchen","@type":"Person","name":"mattmccutchen"},"datePublished":"2018-05-04T22:45:22Z","url":"https://github.com/microsoft/TypeScript/issues/23909"}
| 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:ab8f2fd0-48a8-6694-f431-6a50d098b076 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AF56:222D8A:22DACD:3133DA:6B0468E7 |
| html-safe-nonce | 669db762ef03cffd005f387484bc219b5adbebcd5a30d17881cc533876770023 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjU2OjIyMkQ4QToyMkRBQ0Q6MzEzM0RBOjZCMDQ2OEU3IiwidmlzaXRvcl9pZCI6IjMxODI4MzU2OTc4NzMzMjgzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4cfaf8cc4080728bb14cbce189ce2d9563e340b5cf4cd1c221171a1679b9a499 |
| hovercard-subject-tag | issue:320451123 |
| 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/23909/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9bbdd7c6bf2399db682b32f99b026e22d7b03ead6e294fd02f7cd3f0bd69fcaf/microsoft/TypeScript/issues/23909 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9bbdd7c6bf2399db682b32f99b026e22d7b03ead6e294fd02f7cd3f0bd69fcaf/microsoft/TypeScript/issues/23909 |
| og:image:alt | TypeScript Version: master (618da24) Search Terms: type parameter same merging constraint Code // Error: "All declarations of 'A' must have identical type parameters." interface A |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mattmccutchen |
| hostname | github.com |
| expected-hostname | github.com |
| None | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| 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 | ca4d07a7cef4e4b75f821dc25e7300d80c1450a9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width