Bug Report
🔎 Search Terms
- extends
- contain
- constraint
🕗 Version & Regression Information
4.3.0-dev.20210407
This was working in the TS 4.3 beta
⏯ Playground Link
https://www.typescriptlang.org/play?#code/KYDwDg9gTgLgBDAnmYcCCATDAxAllAZxgAUBDKUgW2BmCgBUJsBXAOwGMZcJWCAeeuQDmNAHxwAvHADeAKDgK4AbQDScXKzgBrYIggAzOIKgiYAXQBcR4TVVm4oWqwwE4ACgB0X4QSulWiEpmAJSS4gBuELgY8opxAPzuXh4+VmQU1LSEAjYwdqKhEhFRMXFxVpHRsgC+ANyyQA
💻 Code
export type AddFirstParameterToFunctions<Target> = {
[K in keyof Target]: Target[K] extends (...args: any[]) => void
? (...args: Parameters<Target[K]>) => void
: void
};
🙁 Actual behavior
Parameters<Target[K]> has the error:
Type 'Target[K]' does not satisfy the constraint '(...args: any) => any'.
Type 'Target[keyof Target]' is not assignable to type '(...args: any) => any'.
Type 'Target[string] | Target[number] | Target[symbol]' is not assignable to type '(...args: any) => any'.
Type 'Target[string]' is not assignable to type '(...args: any) => any'
🙂 Expected behavior
This code previously compiled without errors in the TS 4.3-beta
Bug Report
🔎 Search Terms
🕗 Version & Regression Information
4.3.0-dev.20210407
This was working in the TS 4.3 beta
⏯ Playground Link
https://www.typescriptlang.org/play?#code/KYDwDg9gTgLgBDAnmYcCCATDAxAllAZxgAUBDKUgW2BmCgBUJsBXAOwGMZcJWCAeeuQDmNAHxwAvHADeAKDgK4AbQDScXKzgBrYIggAzOIKgiYAXQBcR4TVVm4oWqwwE4ACgB0X4QSulWiEpmAJSS4gBuELgY8opxAPzuXh4+VmQU1LSEAjYwdqKhEhFRMXFxVpHRsgC+ANyyQA
💻 Code
🙁 Actual behavior
Parameters<Target[K]>has the error:🙂 Expected behavior
This code previously compiled without errors in the TS 4.3-beta