I have the following function:
type SomeType<T> = Record<string, T>;
declare function test<T>(...args: SomeType<T>[]): T;
I would like to call it like that (a should be of type number|string):
const a = test({a: 3}, {b: "as"});
but that way I get an error: Type 'string' is not assignable to type 'number'.
can I make this work without explicitly passing the generic argument number|string or using conditional types?
const a = test<string|number>({a: 3}, {b: "as"});, but not sure enough to make it an answer. :-)