Bug Report
🔎 Search Terms
homomorphic mapped tuples, variadic tuple, parallel lists, zip tuples together, pipeline, compose function, keyof array.
🕗 Version & Regression Information
- This is the behaviour in every version of the playground from
4.0.5 up to nightly v4.6.0-dev2021-11-05- This is not applicable before
4.0.5 since tuple spread [A,...V] doesn't exist that far back - and I reviewed the FAQ for entries about mapped types, I don't have primitives here.
⏯ Playground Link and Explanation
Playground link with relevant code
💻 Code
interfaceA{a:any}interfaceB{b:any}interfaceC{c:any}typeCombine<X,Y>={[KinkeyofX]: [X[K],Y[K&keyofY]]}typeXX=[A,B,C]typeYY=[1,2,3]declareconstexample_value: [["x","y"],[A,1],[B,2],[C,3]]letworks_as_expected: Combine<['x',...XX],['y',...YY]>=example_value// let works_as_expected: [["x", "y"], [A, 1], [B, 2], [C, 3]]typeAlias<Xextendsany[],Yextendsany[]>=Combine<['x',...X],['y',...Y]>letdoesnt_work: Alias<XX,YY>=example_value// let doesnt_work: [["x", "y"], [A, "y"], [B, 1], [C, 2]]🙁 Actual behavior
works_as_expected is correctly the type [['x','y'], [A, 1], [B, 2], [C, 3]] but doesnt_work which is basically defined the exact same way except the spreading is done inside another type alias gives a totally different and incorrect type [["x", "y"], [A, "y"], [B, 1], [C, 2]]
🙂 Expected behavior
example should compile without errors, the type of doesnt_work should be the same as works_as_expected.
Bug Report
🔎 Search Terms
homomorphic mapped tuples, variadic tuple, parallel lists, zip tuples together, pipeline, compose function, keyof array.
🕗 Version & Regression Information
4.0.5up to nightlyv4.6.0-dev2021-11-054.0.5since tuple spread[A,...V]doesn't exist that far back⏯ Playground Link and Explanation
Playground link with relevant code
💻 Code
🙁 Actual behavior
works_as_expectedis correctly the type[['x','y'], [A, 1], [B, 2], [C, 3]]butdoesnt_workwhich is basically defined the exact same way except the spreading is done inside another type alias gives a totally different and incorrect type[["x", "y"], [A, "y"], [B, 1], [C, 2]]🙂 Expected behavior
example should compile without errors, the type of
doesnt_workshould be the same asworks_as_expected.