why TS requires single arg to call one of two functions with different parameter count?

Viewed 55

Given the code

const funcs = {
    f1: (s: string) => {},
    f2: (s1: string, s2?: string) => {},
    f3: (s1?: string, s2?: string) => {}
};

funcs['' as 'f1' | 'f2']('x', 'y');   // OK
funcs['' as 'f1' | 'f3']('x', 'y');   // Expected 1 arguments, but got 2.

why TS requires exactly one argument for function merged from f1, f3?

Playground Link

0 Answers
Related