Title: Unrelated interface causes assignability to change · Issue #56099 · microsoft/TypeScript · GitHub
Open Graph Title: Unrelated interface causes assignability to change · Issue #56099 · microsoft/TypeScript
X Title: Unrelated interface causes assignability to change · Issue #56099 · microsoft/TypeScript
Description: 🔎 Search Terms 5.3 regression 🕗 Version & Regression Information This changed between versions 5.3.0-dev.20230823 and 5.3.0-dev.20230824 ⏯ Playground Link Playground Link 💻 Code export { } interface Map
Open Graph Description: 🔎 Search Terms 5.3 regression 🕗 Version & Regression Information This changed between versions 5.3.0-dev.20230823 and 5.3.0-dev.20230824 ⏯ Playground Link Playground Link 💻 Code export { } interfac...
X Description: 🔎 Search Terms 5.3 regression 🕗 Version & Regression Information This changed between versions 5.3.0-dev.20230823 and 5.3.0-dev.20230824 ⏯ Playground Link Playground Link 💻 Code export { } inte...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/56099
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unrelated interface causes assignability to change ","articleBody":"### 🔎 Search Terms\r\n\r\n 5.3 regression \r\n\r\n### 🕗 Version & Regression Information\r\n\r\n- This changed between versions 5.3.0-dev.20230823 and 5.3.0-dev.20230824\r\n\r\n\r\n### ⏯ Playground Link\r\n\r\n[Playground Link](https://www.typescriptlang.org/play?ts=5.3.0-dev.20230824#code/KYDwDg9gTgLgBAbzgXwFAEsB2NhQGYCGAxsHALIFgA8AagHxyg6YAmAznAMIQA2PwRGOgiZaDBKjhS4eHgRgVqNMnQAUASgBc5SrRUBuVGgzZchEl179Bw0fUSTpANwI8ArsG019cAPS+4NjAoLABrfkCIAFtSIggXEIJMEkcpKMptRTFDaTg45PkNbW4+ASERKjdMUMwIAHdMOhzpWXlFIstSmwr6ZqlWhV1lNS1O63K7AyNUVH9LKJjsOAg3eCSWOHR4OuhQjh50UNIsOABWADoAJhMcfGJSAGlgAE9gDaZgVg4S8dsqTDcUQARrhxKk8iIiIVRk9XixDMYYM8wKQAEpwAC8OmomGATlBjBAzHYYzKfyweFwcHsAH5qXBtAAiAByAHlGYZUPk2PAoJi4AC+ABCOAEDiowzc+AwJlsxn8qCc1BAA)\r\n\r\n### 💻 Code\r\n\r\n```ts\r\nexport { }\r\ninterface Map\u003cV> extends Collection\u003cV> {\r\n flatMap\u003cVM>(): Map\u003cVM>;\r\n}\r\n\r\ninterface Collection\u003cV> {\r\n value: V; // sprinkle some covariance\r\n map: Map\u003cV>;\r\n concat(): Collection\u003cunknown>;\r\n flatMap(): Collection\u003cV>;\r\n flatMap\u003cVM>(): Collection\u003cVM>;\r\n}\r\n\r\n// Comment out and it works like in 5.2\r\ninterface Keyed extends Collection\u003cnumber> {\r\n concat(): Keyed;\r\n}\r\n\r\ntype R = Map\u003cnever> extends Collection\u003cinfer V> ? V : \"NO\";\r\n\r\nconst r = null! as R;\r\nconst t: \"NO\" = r;\r\n```\r\n\r\n\r\n### 🙁 Actual behavior\r\n\r\nR is `unknown`. Removing `Keyed` makes `R` `\"NO\"`, even though `Keyed` is unused otherwise. \r\n\r\n### 🙂 Expected behavior\r\n\r\nNot really sure. I'd settle for the stable 5.2 behavior, which is for `R` to be `\"NO\"` although that also seems wrong (Why doesn't `Map\u003cnever> extends Collection`? If we remove `flatMap(): Collection\u003cV>` from `Collection` then `Map\u003cnever>` extends `Collection`. This seems like the correct behavior.)\r\n\r\n### Additional information about the issue\r\n\r\n_No response_","author":{"url":"https://github.com/dragomirtitian","@type":"Person","name":"dragomirtitian"},"datePublished":"2023-10-13T16:31:20Z","url":"https://github.com/microsoft/TypeScript/issues/56099"}
| 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:6f978e31-63a9-f9e2-ebb5-eec1717415bf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9D12:8196C:A47EF7:DB9477:6B00E9DB |
| html-safe-nonce | 96d9627b851e748236472612847991f195b43d79dd93196b47ba58d44c2ab2cc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDEyOjgxOTZDOkE0N0VGNzpEQjk0Nzc6NkIwMEU5REIiLCJ2aXNpdG9yX2lkIjoiNTUwNTEyMDM3MTE5NzY2NzgwMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fc2a621af6134719239ace02e9e2c0589b766c2202d4256af065af7ba6b90028 |
| hovercard-subject-tag | issue:1942257310 |
| 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/56099/issue_layout |
| twitter:image | https://opengraph.githubassets.com/494ad70e902880d5fadf31d5ea3f0ed478669a1515547938892e07c34f88c7a3/microsoft/TypeScript/issues/56099 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/494ad70e902880d5fadf31d5ea3f0ed478669a1515547938892e07c34f88c7a3/microsoft/TypeScript/issues/56099 |
| og:image:alt | 🔎 Search Terms 5.3 regression 🕗 Version & Regression Information This changed between versions 5.3.0-dev.20230823 and 5.3.0-dev.20230824 ⏯ Playground Link Playground Link 💻 Code export { } interfac... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dragomirtitian |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width