GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Type parameter not usable as type argument in identical type; union in constraint becomes intersection · Issue #60892 · microsoft/TypeScript Open Labels BugA bug in TypeScriptA bug in TypeScriptDomain: Indexed Access TypesThe issue relates to accessing subtypes via index accessThe issue relates to accessing subtypes via index access Milestone Description🔎 Search Termsindexed access, constraints, generic, unions, ts2344 🕗 Version & Regression Information
⏯ Playground Link💻 Codeinterface Foo<T extends { x: string }, U extends (T | { x: "a" })['x']> { z: Foo<T, U> // error! // ~ Type 'U' does not satisfy the constraint 'T["x"] & "a"'. 🙃 } 🙁 Actual behaviorThe 🙂 Expected behaviorThe Additional information about the issueDistilled from SO question. I expect this is a consequence of #30769 as per #31731 (comment), but it is at least somewhat surprising that this should happen when the types involved are identical. One could rewrite the constraint to Activity
MetadataMetadataAssigneesLabelsBugA bug in TypeScriptA bug in TypeScriptDomain: Indexed Access TypesThe issue relates to accessing subtypes via index accessThe issue relates to accessing subtypes via index access TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |