Title: TS2719 "Two different types with this name exist" between identical generic signatures with a distributive conditional parameter type (regression from #64237) · Issue #64673 · microsoft/TypeScript · GitHub
Open Graph Title: TS2719 "Two different types with this name exist" between identical generic signatures with a distributive conditional parameter type (regression from #64237) · Issue #64673 · microsoft/TypeScript
X Title: TS2719 "Two different types with this name exist" between identical generic signatures with a distributive conditional parameter type (regression from #64237) · Issue #64673 · microsoft/TypeScript
Description: 🔎 Search Terms TS2719 distributive, TS2719 conditional type, TS2719 generic signature, "Two different types with this name exist" conditional, "has been distributed here", distributed type parameter, "non-distributed", distributive condi...
Open Graph Description: 🔎 Search Terms TS2719 distributive, TS2719 conditional type, TS2719 generic signature, "Two different types with this name exist" conditional, "has been distributed here", distributed type paramete...
X Description: 🔎 Search Terms TS2719 distributive, TS2719 conditional type, TS2719 generic signature, "Two different types with this name exist" conditional, "has been distributed here", distr...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/64673
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TS2719 \"Two different types with this name exist\" between identical generic signatures with a distributive conditional parameter type (regression from #64237)","articleBody":"### 🔎 Search Terms\n\nTS2719 distributive, TS2719 conditional type, TS2719 generic signature, \"Two different types with this name exist\" conditional, \"has been distributed here\", distributed type parameter, \"non-distributed\", distributive conditional identical signature, 64237, 64307\n\n### 🕗 Version & Regression Information\n\n- This changed in commit or PR #64237: tsc 6.0.3 accepts the code; tsgo built from `main` at d61a7d23590 reports TS2719.\n- PR #64307 fixes it. I built its head and the error goes away. The PR has no linked issue, so this is that issue.\n\n### ⏯ Playground Link\n\nhttps://tsgo.sxzz.dev/#eNqlk91u2zAMhV/lQAOWFnDdLC0a1F07BNguNqDo0PUuDhDFph1timRIcn5Q9N1HxUnarZe5sWmS+kgeys+iEtl4LBZSmTR4kYjzc5yd+eBUEVJMqymkKTGtp5jLJUGVZIIqpEbYNOQTeAvpvaqNMjWsIQSLMCdYfrjcMM3PbatLSL2SG4+VdX/S6N/Gvq0bKgKVOAm+wFXaTy9OMxgLcs6617xREVquyVm15ZrKFIQPV5eDi+ENKrVmwGyDn4/Rd9EfnmbbQ+goePo1GH66zvDEHaP3eXR3ssgwSuAynEi2QOtApvSIU/MUX9iVoX+K2zssrSoPRm+HVZ5bDLu55Ux3Qx9NT3f4p5VFqaqKHGvd6YyVCnPWNVaWC2Km8iHBrA1R7A2kI7TGkZYs5p4DpOmr3dvV/4hRL05gjd78PwLvzVhzVqqYy3DWtTfqJQdGrMcOvgoeMyKDt5m8b+JyuSmp0LEhTQFVhiMkuckNrRvrwpZVH8XCLSrmiUkyFnzZrKlUnf721vCdf84NkIvCLhqlyT00QVnjc5FhG4mxIF1NIbpyQZ7bYjvZBxe2bDV1wcaRJ7ekd+FH8la3kdwlzlpTcrE3ed1fF6PBtXRwk7/fAr6bQM427+K2DV+V66BxIW+I3Srkvug/x1zsZ0k/WIL7Q/8xIya85OZFTCaJKEQmWKElvwb9wVV6nQ4u+XslskpqTy9/AUEAUsk=\n\n### 💻 Code\n\n```ts\n// --strict\ndeclare let f: \u003cA>(m: A, r: (a: A extends string ? A : 0) => void) => void;\nexport let g: \u003cA>(m: A, r: (a: A extends string ? A : 0) => void) => void = f;\n```\n\n### 🙁 Actual behavior\n\n```\nmain.ts(2,12): error TS2719: Type '\u003cA>(m: A, r: (a: A extends string ? A : 0) => void) => void' is not assignable to type '\u003cA>(m: A, r: (a: A extends string ? A : 0) => void) => void'. Two different types with this name exist, but they are unrelated.\n Types of parameters 'r' and 'r' are incompatible.\n Types of parameters 'a' and 'a' are incompatible.\n Type 'A extends string ? A : 0' is not assignable to type 'A extends string ? A : 0'. Two different types with this name exist, but they are unrelated.\n Type '0 | A' is not assignable to type 'A extends string ? A : 0'.\n Type '0' is not assignable to type 'A extends string ? A : 0'.\n Type 'string & A' is not assignable to type 'A'.\n 'string & A' is only assignable to the non-distributed 'A', but 'A' has been distributed here.\n```\n\n### 🙂 Expected behavior\n\nNo error: the two signatures are identical. tsc 6.0.3 accepts this.\n\n### Additional information about the issue\n\n#64237 gave each type parameter a \"distributed\" twin, which references inside a distributive conditional type resolve to. When the checker compares a generic signature with an identical one, inference maps the source's distributed parameter to the target's *plain* parameter, while the target keeps its distributed one. The two identical conditional types then fail to relate.\n\n@Andarist's #64307 fixes this by instantiating the target side of the comparison too, so both distributed parameters map back to the non-distributed one. The PR is open, and the bot asked for an issue that references it, so I'm filing this one.\n\nmicrosoft/typescript-go#3488 reported a similar TS2719 between identical conditional types earlier this year. It was closed as fixed in April, and its repro still compiles cleanly on current `main`, so this is a new regression rather than that bug coming back.\n\nThis breaks real code. Compiling the source of [redux-toolkit](https://github.com/reduxjs/redux-toolkit) v2 fails at [`builderCallback(builder)` in `mapBuilders.ts`](https://github.com/reduxjs/redux-toolkit/blob/75b4f698e1c58efa6b19096abe5850da0a431da0/packages/toolkit/src/mapBuilders.ts#L200). There the builder object, whose [`addMatcher`](https://github.com/reduxjs/redux-toolkit/blob/75b4f698e1c58efa6b19096abe5850da0a431da0/packages/toolkit/src/mapBuilders.ts#L176-L178) takes a type-predicate matcher plus a reducer typed `A extends Action ? A : A & Action`, is checked against the [`ActionReducerMapBuilder.addMatcher`](https://github.com/reduxjs/redux-toolkit/blob/75b4f698e1c58efa6b19096abe5850da0a431da0/packages/toolkit/src/mapBuilders.ts#L99-L102) declaration with the same reducer type. VS Code's configuration resolver (`resolveAsync` in `src/vs/workbench/services/configurationResolver/common/variableResolver.ts`) fails the same way. We're carrying #64307 as a local patch in the meantime.","author":{"url":"https://github.com/trevorade","@type":"Person","name":"trevorade"},"datePublished":"2026-10-07T17:03:53Z","url":"https://github.com/microsoft/TypeScript/issues/64673"}
| 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:eeb505fa-9c8a-f0df-573a-1c9346b4e5b2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A5B2:2F4BD9:17A192D:1F28C31:6B013664 |
| html-safe-nonce | 626bb7a9c30081dea3f5acd3f3ba3f8554ad9ba7d110f3a91918205a0004c1c5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUIyOjJGNEJEOToxN0ExOTJEOjFGMjhDMzE6NkIwMTM2NjQiLCJ2aXNpdG9yX2lkIjoiNDYyODk1MDcxMDcxNTc1ODE4MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3938d11604ed59855e5071deb824b4349a139f17c8f06d064fedf7b22abadb38 |
| hovercard-subject-tag | issue:5748747883 |
| 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/64673/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bad1ea3894ba5061c8d99728b9c996e9e63f6cf1c1915130485e57345adb67e2/microsoft/TypeScript/issues/64673 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bad1ea3894ba5061c8d99728b9c996e9e63f6cf1c1915130485e57345adb67e2/microsoft/TypeScript/issues/64673 |
| og:image:alt | 🔎 Search Terms TS2719 distributive, TS2719 conditional type, TS2719 generic signature, "Two different types with this name exist" conditional, "has been distributed here", distributed type paramete... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | trevorade |
| 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