tests/cases/conformance/types/conditional/inferTypes1.ts(34,23): error TS2344: Type 'string' does not satisfy the constraint 'Function'.
tests/cases/conformance/types/conditional/inferTypes1.ts(43,25): error TS2344: Type '(x: string, y: string) => number' does not satisfy the constraint '(x: any) => any'.
tests/cases/conformance/types/conditional/inferTypes1.ts(44,25): error TS2344: Type 'Function' does not satisfy the constraint '(x: any) => any'.
  Type 'Function' provides no match for the signature '(x: any): any'.
tests/cases/conformance/types/conditional/inferTypes1.ts(70,12): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type.
tests/cases/conformance/types/conditional/inferTypes1.ts(71,15): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type.
tests/cases/conformance/types/conditional/inferTypes1.ts(71,41): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type.
tests/cases/conformance/types/conditional/inferTypes1.ts(71,51): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type.
tests/cases/conformance/types/conditional/inferTypes1.ts(72,15): error TS2304: Cannot find name 'U'.
tests/cases/conformance/types/conditional/inferTypes1.ts(72,15): error TS4081: Exported type alias 'T62' has or is using private name 'U'.
tests/cases/conformance/types/conditional/inferTypes1.ts(72,43): error TS2304: Cannot find name 'U'.
tests/cases/conformance/types/conditional/inferTypes1.ts(72,43): error TS4081: Exported type alias 'T62' has or is using private name 'U'.


==== tests/cases/conformance/types/conditional/inferTypes1.ts (11 errors) ====
    type Unpacked<T> =
        T extends (infer U)[] ? U :
        T extends (...args: any[]) => infer U ? U :
        T extends Promise<infer U> ? U :
        T;
    
    type T00 = Unpacked<string>;  // string
    type T01 = Unpacked<string[]>;  // string
    type T02 = Unpacked<() => string>;  // string
    type T03 = Unpacked<Promise<string>>;  // string
    type T04 = Unpacked<Unpacked<Promise<string>[]>>;  // string
    type T05 = Unpacked<any>;  // any
    type T06 = Unpacked<never>;  // never
    
    type ReturnType<T extends Function> = T extends ((...args: any[]) => infer R) | (new (...args: any[]) => infer R) ? R : any;
    
    function f1(s: string) {
        return { a: 1, b: s };
    }
    
    class C {
        x = 0;
        y = 0;
    }
    
    type T10 = ReturnType<() => string>;  // string
    type T11 = ReturnType<(s: string) => void>;  // void
    type T12 = ReturnType<(<T>() => T)>;  // {}
    type T13 = ReturnType<(<T extends U, U extends number[]>() => T)>;  // number[]
    type T14 = ReturnType<typeof f1>;  // { a: number, b: string }
    type T15 = ReturnType<typeof C>;  // C
    type T16 = ReturnType<any>;  // any
    type T17 = ReturnType<never>;  // any
    type T18 = ReturnType<string>;  // Error
                          ~~~~~~
!!! error TS2344: Type 'string' does not satisfy the constraint 'Function'.
    type T19 = ReturnType<Function>;  // any
    
    type ArgumentType<T extends (x: any) => any> = T extends (a: infer A) => any ? A : any;
    
    type T20 = ArgumentType<() => void>;  // never
    type T21 = ArgumentType<(x: string) => number>;  // string
    type T22 = ArgumentType<(x?: string) => number>;  // string | undefined
    type T23 = ArgumentType<(...args: string[]) => number>;  // string
    type T24 = ArgumentType<(x: string, y: string) => number>;  // Error
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2344: Type '(x: string, y: string) => number' does not satisfy the constraint '(x: any) => any'.
    type T25 = ArgumentType<Function>;  // Error
                            ~~~~~~~~
!!! error TS2344: Type 'Function' does not satisfy the constraint '(x: any) => any'.
!!! error TS2344:   Type 'Function' provides no match for the signature '(x: any): any'.
    type T26 = ArgumentType<any>;  // any
    type T27 = ArgumentType<never>;  // any
    
    type X1<T extends { x: any, y: any }> = T extends { x: infer X, y: infer Y } ? [X, Y] : any;
    
    type T30 = X1<{ x: any, y: any }>;  // [any, any]
    type T31 = X1<{ x: number, y: string }>;  // [number, string]
    type T32 = X1<{ x: number, y: string, z: boolean }>;  // [number, string]
    
    type X2<T> = T extends { a: infer U, b: infer U } ? U : never;
    
    type T40 = X2<{}>;  // never
    type T41 = X2<{ a: string }>;  // never
    type T42 = X2<{ a: string, b: string }>;  // string
    type T43 = X2<{ a: number, b: string }>;  // string | number
    type T44 = X2<{ a: number, b: string, c: boolean }>;  // string | number
    
    type X3<T> = T extends { a: (x: infer U) => void, b: (x: infer U) => void } ? U : never;
    
    type T50 = X3<{}>;  // never
    type T51 = X3<{ a: (x: string) => void }>;  // never
    type T52 = X3<{ a: (x: string) => void, b: (x: string) => void }>;  // string
    type T53 = X3<{ a: (x: number) => void, b: (x: string) => void }>;  // string & number
    type T54 = X3<{ a: (x: number) => void, b: () => void }>;  // number
    
    type T60 = infer U;  // Error
               ~~~~~~~
!!! error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type.
    type T61<T> = infer A extends infer B ? infer C : infer D;  // Error
                  ~~~~~~~
!!! error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type.
                                            ~~~~~~~
!!! error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type.
                                                      ~~~~~~~
!!! error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type.
    type T62<T> = U extends (infer U)[] ? U : U;  // Error
                  ~
!!! error TS2304: Cannot find name 'U'.
                  ~
!!! error TS4081: Exported type alias 'T62' has or is using private name 'U'.
                                              ~
!!! error TS2304: Cannot find name 'U'.
                                              ~
!!! error TS4081: Exported type alias 'T62' has or is using private name 'U'.
    