TypeScript Version: 3.6.3, 3.7-Beta
Code
type AnyFunction = (...args: any[]) => any;
type ExtractSomething<T extends AnyFunction> = never
type ExtractSomethings<T extends AnyFunction[]> =
T extends Array<infer U>
? ExtractSomething<U> // Type 'U' does not satisfy the constraint 'AnyFunction'
: never
Expected behavior:
Inferred array element from a constrained array generic should pass the same constraint again.
Actual behavior:
Type 'U' does not satisfy the constraint 'AnyFunction'. (2344)
Playground Link: : http://www.typescriptlang.org/play/?ts=3.7-Beta#code/C4TwDgpgBAggdiAYgVzgY2ASwPZygXigAoA6MgQwCcBzAZwC4pyEBtAXQEoCA+JhAbgCwAKBGhIUAKIAPYJXIYAytgC2EYAAtMcagB4AKlAiyIcACa1YCFOiy5ehOBABuESiLHhoMuQuDK1TW06AyMTc0t4JFQMHDh2BygRKChDY2BTC1hKeRBdbQAzNygAVW5klKgAfilZeSVVdS0dXTKKlMYnV0ogA