tests/cases/compiler/promisePermutations.ts(74,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'number' is not assignable to type 'IPromise'. Property 'then' is missing in type 'Number'. tests/cases/compiler/promisePermutations.ts(79,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(82,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(83,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'x' and 'value' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(84,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(88,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. tests/cases/compiler/promisePermutations.ts(93,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations.ts(97,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations.ts(100,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations.ts(101,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. tests/cases/compiler/promisePermutations.ts(102,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations.ts(106,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type '(a: T) => T' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(109,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type '(a: T) => T' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(110,19): error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'cb' and 'value' are incompatible. Type '(a: T) => T' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(111,19): error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type '(a: T) => T' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(117,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations.ts(120,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations.ts(121,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations.ts(122,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations.ts(126,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations.ts(129,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations.ts(132,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations.ts(133,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations.ts(134,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations.ts(137,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations.ts(144,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations.ts(152,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Types of property 'then' are incompatible. Type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }' is not assignable to type '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. Types of parameters 'success' and 'success' are incompatible. Type '(value: string) => IPromise' is not assignable to type '(value: number) => Promise'. Types of parameters 'value' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations.ts(156,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(158,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(159,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'Promise' is not assignable to type 'IPromise'. Types of property 'then' are incompatible. Type '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. Types of parameters 'success' and 'success' are incompatible. Type '(value: number) => Promise' is not assignable to type '(value: string) => IPromise'. Types of parameters 'value' and 'value' are incompatible. Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/promisePermutations.ts (33 errors) ==== interface Promise { then(success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; then(success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; then(success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; done(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; } interface IPromise { then(success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; then(success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; then(success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; done? (success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; } declare function testFunction(): IPromise; declare function testFunctionP(): Promise; declare function testFunction2(): IPromise<{ x: number }>; declare function testFunction2P(): Promise<{ x: number }>; declare function testFunction3(x: number): IPromise; declare function testFunction3P(x: number): Promise; declare function testFunction4(x: number, y?: string): IPromise; declare function testFunction4P(x: number, y?: string): Promise; declare function testFunction5(x: number, cb: (a: string) => string): IPromise; declare function testFunction5P(x: number, cb: (a: string) => string): Promise; declare function testFunction6(x: number, cb: (a: T) => T): IPromise; declare function testFunction6P(x: number, cb: (a: T) => T): Promise; declare function testFunction7(cb: (a: T) => T): IPromise; declare function testFunction7P(cb: (a: T) => T): Promise; declare function testFunction8(x: T, cb: (a: T) => T): IPromise; declare function testFunction8P(x: T, cb: (a: T) => T): Promise; declare function testFunction9(x: T, cb: (a: U) => U): IPromise; declare function testFunction9P(x: T, cb: (a: U) => U): Promise; declare function testFunction10(cb: (a: U) => U): IPromise; declare function testFunction10P(cb: (a: U) => U): Promise; declare function testFunction11(x: number): IPromise; declare function testFunction11(x: string): IPromise; declare function testFunction11P(x: number): Promise; declare function testFunction11P(x: string): Promise; declare function testFunction12(x: T): IPromise; declare function testFunction12(x: T, y: T): IPromise; declare function testFunction12P(x: T): IPromise; declare function testFunction12P(x: T, y: T): Promise; var r1: IPromise; var r1a = r1.then(testFunction, testFunction, testFunction); var r1b = r1.then(testFunction, testFunction, testFunction).then(testFunction, testFunction, testFunction); var r1c = r1.then(testFunctionP, testFunctionP, testFunctionP); var s1: Promise; var s1a = s1.then(testFunction, testFunction, testFunction); var s1b = s1.then(testFunctionP, testFunctionP, testFunctionP); var s1c = s1.then(testFunctionP, testFunction, testFunction); var s1d = s1.then(testFunctionP, testFunction, testFunction).then(testFunction, testFunction, testFunction); var r2: IPromise<{ x: number; }>; var r2a = r2.then(testFunction2, testFunction2, testFunction2); var r2b = r2.then(testFunction2, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); var s2: Promise<{ x: number; }>; var s2a = s2.then(testFunction2, testFunction2, testFunction2); var s2b = s2.then(testFunction2P, testFunction2P, testFunction2P); var s2c = s2.then(testFunction2P, testFunction2, testFunction2); var s2d = s2.then(testFunction2P, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); var r3: IPromise; var r3a = r3.then(testFunction3, testFunction3, testFunction3); var r3b = r3.then(testFunction3, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); var s3: Promise; var s3a = s3.then(testFunction3, testFunction3, testFunction3); var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); var s3c = s3.then(testFunction3P, testFunction3, testFunction3); var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. !!! error TS2345: Types of parameters 'x' and 'value' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'IPromise'. !!! error TS2345: Property 'then' is missing in type 'Number'. var r4: IPromise; var sIPromise: (x: any) => IPromise; var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2345: Types of parameters 'x' and 'value' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2345: Types of parameters 'x' and 'value' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. !!! error TS2345: Types of parameters 'x' and 'value' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2345: Types of parameters 'x' and 'value' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. !!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. !!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. !!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. !!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. !!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; var nIPromise: (x: any) => IPromise; var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok ~~~~~~~ !!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Type 'string' is not assignable to type 'number'. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~ !!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Type 'string' is not assignable to type 'number'. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var r10 = testFunction10(x => x); var r10a = r10.then(testFunction10, testFunction10, testFunction10); // ok var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok ~~~~~~~~ !!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Type 'string' is not assignable to type 'number'. var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s10 = testFunction10P(x => x); var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok var s10d = s10.then(sPromise, sPromise, sPromise); // ok var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error ~~~~~~~~ !!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Types of property 'then' are incompatible. !!! error TS2453: Type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }' is not assignable to type '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. !!! error TS2453: Types of parameters 'success' and 'success' are incompatible. !!! error TS2453: Type '(value: string) => IPromise' is not assignable to type '(value: number) => Promise'. !!! error TS2453: Types of parameters 'value' and 'value' are incompatible. !!! error TS2453: Type 'string' is not assignable to type 'number'. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. !!! error TS2345: Type 'number' is not assignable to type 'string'. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. !!! error TS2345: Type 'number' is not assignable to type 'string'. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. !!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. !!! error TS2345: Type 'number' is not assignable to type 'string'. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2345: Type 'Promise' is not assignable to type 'IPromise'. !!! error TS2345: Types of property 'then' are incompatible. !!! error TS2345: Type '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. !!! error TS2345: Types of parameters 'success' and 'success' are incompatible. !!! error TS2345: Type '(value: number) => Promise' is not assignable to type '(value: string) => IPromise'. !!! error TS2345: Types of parameters 'value' and 'value' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok var s12 = testFunction12(x => x); var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok