我在同一个Typescript类中定义了以下两个函数签名,即:.,
public emit<T1>(event: string, arg1: T1): void {}
和
public emit<T1,T2>(event: string, arg1: T1, arg2: T2): void {}
然而,当传输typescript时,我得到了以下错误
error TS2393: Duplicate function implementation.
I thought you could overload functions in typescript providing the number of parameters in the function signature were different. Given that the above signatures have 2 和 3 parameters respectively, why am I getting this transpilation error?