- Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
Bug Report
🔎 Search Terms
function, method, generic, parameters, does not satisfy constraint, 4.5
🕗 Version & Regression Information
- This changed between versions 4.4.4 and 4.5.0
⏯ Playground Link
Playground link with relevant code
☝🏼 Switch the version to v4.4.4 and this compiles fine; v4.5.0-beta errors (as does v4.5.2, but the Playground doesn't offer this version)
💻 Code
typeMethods<T>={[KinkeyofT]: T[K]extendsFunction ? K : never;}[keyofT];classTest{foo='';bar(a: string,b: number): void{}}functiondoSomeProxying<T,MethodextendsMethods<T>,ArgsextendsParameters<T[Method]>,>(type: T,method: Method, ...args: Args): void{}doSomeProxying(newTest(),'bar','arg',123);🙁 Actual behavior
Compiler errors in v4.5.0, even though it was fine in v4.4.4.
🙂 Expected behavior
Expect to be able to use the built-in Parameters<> type on properties I have narrowed down as functions.
noahtallen, sirreal, DScheglov and mernen
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug