Title: Design Meeting Notes, 2026-09-01 · Issue #64129 · microsoft/TypeScript · GitHub
Open Graph Title: Design Meeting Notes, 2026-09-01 · Issue #64129 · microsoft/TypeScript
X Title: Design Meeting Notes, 2026-09-01 · Issue #64129 · microsoft/TypeScript
Description: Conditional Distributions Allow Constraint Violation #63708 type Issue = A extends unknown ? B extends unknown ? Show : never : never; type Show = [A, B] & {}; type X = Issue<0 | 1, 0 | 1>; // ^? The problem i...
Open Graph Description: Conditional Distributions Allow Constraint Violation #63708 type Issue = A extends unknown ? B extends unknown ? Show : never : never; type Show = [A, B] & {}; type X = ...
X Description: Conditional Distributions Allow Constraint Violation #63708 type Issue<A, B extends A> = A extends unknown ? B extends unknown ? Show<A, B> : never : never; type Show<A, B> = [A, ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/64129
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design Meeting Notes, 2026-09-01","articleBody":"# Conditional Distributions Allow Constraint Violation\n\nhttps://github.com/microsoft/TypeScript/issues/63708\n\n```ts\ntype Issue\u003cA, B extends A> =\n A extends unknown ?\n B extends unknown ?\n Show\u003cA, B> :\n never :\n never;\n\ntype Show\u003cA, B> = [A, B] & {};\n\ntype X = Issue\u003c0 | 1, 0 | 1>;\n// ^?\n```\n\n* The problem is that when we distribute on `A` and `B`, then we should create a new type parameter for each one with an identical name.\n* So we are prototyping this.\n* This is a little complicated by the fact that this now also becomes a declaration site rather than just a usage.\n * We would need to introduce something in the binder for this.\n * So that would say \"this is a distribution site with a new type variable\".\n* But that would have broader implications beyond just type variables on the left side of `extends`.\n* Doing something like this would changing the semantics of type distribution because we'd now operate over any identifier-named type.\n\n ```ts\n // TODO\n ```\n* When explaining to others, we've explained this as \"there's a new type variable that is created for distribution\", so surprised it didn't work this way.\n * Really there's a mix of substitution types and other instantiation mechanics at play here.\n* Do we need substitution types?\n * Yes. You need \"learned information\"/\"conditional narrowing\" to be tracked along to satisfy other constraints in true branches.\n * Wait really? Why can't `T extends number` become `T' extends T & number`?\n* How does this work over type references that alias bare identifiers\n\n ```ts\n type Foo\u003cT> = T;\n \n type Blah\u003cT> = Foo\u003cT> extends any ? { b: Foo\u003cT> } : undefined;\n \n type What = Blah\u003c1 | 0>;\n ```\n * Today, this *does* distribute; it no longer would with the suggested change...\n * Oh... that's probably very breaky!\n * Who does this?\n * Someone, guaranteed.\n* Feels like people should at least have a way to distribute explicitly since we might be changing things here?\n* You are binding a new type parameter at the top; there's no reason you couldn't other than efficiency.\n * No - we use substitution types to track learned information and conditional narrowing.\n * There are differences in type comparisons when you have substitution types, and they differ in how they act on type comparisons.\n * So while they feel similar, type parameters with added constraints are treated differently in practice.\n * `T'' extends T' & (1 | 2) extends T & number` isn't reasoned about quite the same as `T'' & (1 | 2) & number`.\n* Why don't we just introduce syntax to avoid breaking people?\n * The problem is that we are trying to fix a soundness hole and we want that to be fixed by default.\n* Prototype will tell us what breaks in top 999.\n\n# API Bikeshed\n\n```ts\nimport { version, versionMajorMinor } from \"typescript\";\nimport * as ts from \"typescript/async\"; // or sync\nimport * as ast from \"typescript/ast\";\n```\n\n* Currently there's a bunch of subpath exports in the `typescript` package.\n * `ast`\n * `factory`\n * `is`\n * ...\n* As we prototyped replacements with the new API, we noticed old API usage was annoying to go through different imports.\n * Feedback from early API users is that it's less overwhelming than having one import with everything.\n* One of the things we don't like with the \"siloing\" is that it kind of draws boundaries that we might be fixing ourselves into.\n * Can't really have a single barrel given the sync/async split.\n * If you want a single barrel, you can do it yourself!\n\n ```ts\n // ./src/typescript.ts\n\n // Single barrel export for convenience\n export * from \"typescript\";\n export * from \"typescript/ast\";\n export * from \"typescript/async\";\n ```\n\n ```json5\n // package.json\n {\n // ...\n \"imports\": {\n \"#ts\": \"./dist/typescript.js\"\n }\n }\n ```\n\n ```ts\n // Other usage\n import * as ts from \"#ts\";\n ```\n* What about identical types imported through different paths?\n * e.g. `ModuleKind` comes from both `\"typescript\"` and `\"typescript/async\"`.\n * What do people want from this?\n* Do the names overlap between sync/async modules?\n * Yes, they have identical names.\n * It'd be annoying if they all had an `Async` postifx.\n* Could we just simplify this all into `typescript/async` and `typescript/sync`, and re-export common stuff from both?\n * What do you do if you have a function that acts only on the common stuff?\n * Any AST walker.\n* Aside: do we have `forEachChildAsync`?\n * Currently a problem because `forEachChild` short-circuits on truthy results. `Promise`s are always truthy, so a walk always exits early.\n* If we had the FIFO prototype resurrected (come back to this @JakeBailey?), would people even want async because the context switching is so high?\n * Async is just painful\n * But it's the only way to *easily* do things concurrently.\n * Wonder how easy it is to use workers and just use the sync layer.\n* Out of time - really need to build some prototypes and get feedback from others.\n","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2026-09-01T22:14:48Z","url":"https://github.com/microsoft/TypeScript/issues/64129"}
| 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:9b766339-23e4-0e8e-bdb0-e9a9bec8deb8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A5F6:27D3AD:BA2271:EDA282:6B00F969 |
| html-safe-nonce | 1e325a9a7224c0b84d371bef62ea7a4997965dbb3cac46938d3a8382fb9866d7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUY2OjI3RDNBRDpCQTIyNzE6RURBMjgyOjZCMDBGOTY5IiwidmlzaXRvcl9pZCI6IjQ2OTUwMjc2MTQzMzM1OTgwNTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1a005a434a8f42aa6a62e82691c4cc23c9160b84af625131592bec30ad1ecac8 |
| hovercard-subject-tag | issue:5317370775 |
| 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/64129/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bb61587fa4210a1947e7337033c30a9b983dabca7e3385b179d8be2636f374ac/microsoft/TypeScript/issues/64129 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bb61587fa4210a1947e7337033c30a9b983dabca7e3385b179d8be2636f374ac/microsoft/TypeScript/issues/64129 |
| og:image:alt | Conditional Distributions Allow Constraint Violation #63708 type Issue = A extends unknown ? B extends unknown ? Show : never : never; type Show = [A, B] & {}; type X = ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DanielRosenwasser |
| hostname | github.com |
| expected-hostname | github.com |
| None | e208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187 |
| 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 | 7dafd017fb7809a839c443dba08622af38e63c09 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width