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 — Key remapping breaks tuple support for mapped types · Issue #42122 · microsoft/TypeScript Closed DescriptionBug Report🔎 Search Termskey remapping tuples mapped types 🕗 Version & Regression InformationTypescript 4.1
⏯ Playground LinkPlayground link with relevant code 💻 Codetype NoBoolean<K, T> = T extends boolean ? never : K type FilterBooleans<T> = { [K in keyof T as NoBoolean<K, T[K]>]: T[K] } type Filtered = FilterBooleans<[string, boolean, number, boolean]> // should only accept ["1", 3] const f: Filtered = ["1", true, 3, false] type Length = Filtered["length"]; // should only accept 2, not 4 const l: Length = 4; 🙁 Actual behavior#26063 introduced mapped type support for arrays and tuples. This breaks when using the new "key remapping" feature added to TypeScript 🙂 Expected behaviorA filtered tuple type should be produced. Activity
MetadataMetadataAssigneesLabelsNo labels 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. |