declare class Test {
constructor(a: number)
constructor(a: string)
}
// T is [a: string], not [a: string | number]
type T = ConstructorParameters<typeof Test>
class Test2 extends Test {
constructor(...args: ConstructorParameters<typeof Test>) {
super(...args)
}
}
// argument of type "number" is not assignable to type "string"
const t = new Test2(1)
In this example I wish the ConstructorParameters to include all the overload types, instead of just the last overload