Title: Incorrect intersection narrowing of nongeneric type in conditional type · Issue #43427 · microsoft/TypeScript · GitHub
Open Graph Title: Incorrect intersection narrowing of nongeneric type in conditional type · Issue #43427 · microsoft/TypeScript
X Title: Incorrect intersection narrowing of nongeneric type in conditional type · Issue #43427 · microsoft/TypeScript
Description: Bug Report 🔎 Search Terms conditional type narrow nongeneric 🕗 Version & Regression Information This changed between versions 3.8 and 3.9 ⏯ Playground Link Playground link with relevant code 💻 Code type Q
Open Graph Description: Bug Report 🔎 Search Terms conditional type narrow nongeneric 🕗 Version & Regression Information This changed between versions 3.8 and 3.9 ⏯ Playground Link Playground link with relevant code 💻 Code...
X Description: Bug Report 🔎 Search Terms conditional type narrow nongeneric 🕗 Version & Regression Information This changed between versions 3.8 and 3.9 ⏯ Playground Link Playground link with relevant code 💻 ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/43427
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect intersection narrowing of nongeneric type in conditional type","articleBody":"# Bug Report\r\n\r\n### 🔎 Search Terms\r\n\r\nconditional type narrow nongeneric\r\n\r\n### 🕗 Version & Regression Information\r\n\r\n- This changed between versions 3.8 and 3.9\r\n\r\n### ⏯ Playground Link\r\n\r\n[Playground link with relevant code](https://www.typescriptlang.org/play?ts=3.9.7#code/C4TwDgpgBAigPAFQHxQLxQHYFcC2AjCAJyggA9gIMATAZygSgH4oAKDALk1wMIEo0UANwD2ASypROGCIKIBuALAAoAGZYMAY2CjhGKCoyIkLAIaEA5p3jJ+Ab2VQoZ8ywCMABl6KlAX2UG4GmBCUQxzKAAfLnwiYxwBKBwAOmBhADFRUggqFl4vf0NsGMI4hOTUjKycvO8gA)\r\n\r\n### 💻 Code\r\n\r\n```ts\r\ntype Q\u003cT> = number extends T ? (n: number) => void : never;\r\nfunction fn\u003cT>(arg: Q\u003cT>) {\r\n // Expected: OK\r\n // Actual: Cannot convert 10 to number & T\r\n arg(10);\r\n}\r\n// Legal invocations are not problematic\r\nfn\u003cstring | number>(m => m.toFixed());\r\nfn\u003cnumber>(m => m.toFixed());\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\nError issued at `arg(10)`, even though by inspection this is always a legal call.\r\n\r\n### 🙂 Expected behavior\r\n\r\nHonestly, not sure.","author":{"url":"https://github.com/RyanCavanaugh","@type":"Person","name":"RyanCavanaugh"},"datePublished":"2021-03-29T23:58:20Z","url":"https://github.com/microsoft/TypeScript/issues/43427"}
| 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:ab0ccc9a-c395-2b11-7494-9904686b35ff |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C610:22DB35:269871B:313FB75:6B0183AC |
| html-safe-nonce | 003b7aeeac9f97e8cf52132ae6c9375f0e518c7ef6464abcdf15262715c09e7d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjEwOjIyREIzNToyNjk4NzFCOjMxM0ZCNzU6NkIwMTgzQUMiLCJ2aXNpdG9yX2lkIjoiNDU4MzUwNjYxNTIzOTU0MTY3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 633a04a9289975b23fc4162c18359b201e306883b21c72c6661f7d9d30586382 |
| hovercard-subject-tag | issue:843925286 |
| 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/43427/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e3e25e1674d462df7818d78383d10f22566ad5a6667b56b72a03a930e03a4662/microsoft/TypeScript/issues/43427 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e3e25e1674d462df7818d78383d10f22566ad5a6667b56b72a03a930e03a4662/microsoft/TypeScript/issues/43427 |
| og:image:alt | Bug Report 🔎 Search Terms conditional type narrow nongeneric 🕗 Version & Regression Information This changed between versions 3.8 and 3.9 ⏯ Playground Link Playground link with relevant code 💻 Code... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | RyanCavanaugh |
| 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