I can't understand why the type of nVal1 can be inferred on each position, while nVal2 can't be.
function rSelf1<T extends unknown[] | [unknown]>(vs: T): T {
return vs;
}
function rSelf2<T extends unknown[]>(vs: T): T {
return vs;
}
const nVal1 = rSelf1(["a", 1, 2, true]);
const nVal2 = rSelf2(["a", 1, 2, true]);
code link: https://codesandbox.io/s/typescript-playground-export-forked-t1d8o?file=/index.ts
