Improve error message and update baselines

This commit is contained in:
Nathan Shively-Sanders
2019-06-21 13:15:32 -07:00
parent b85796cba0
commit 720ad5bf22
34 changed files with 1027 additions and 509 deletions
+16 -8
View File
@@ -21120,13 +21120,20 @@ namespace ts {
* @param signature a candidate signature we are trying whether it is a call signature
* @param relation a relationship to check parameter and argument type
*/
function checkApplicableSignatureForJsxOpeningLikeElement(node: JsxOpeningLikeElement, signature: Signature, relation: Map<RelationComparisonResult>, checkMode: CheckMode, reportErrors: boolean) {
function checkApplicableSignatureForJsxOpeningLikeElement(
node: JsxOpeningLikeElement,
signature: Signature,
relation: Map<RelationComparisonResult>,
checkMode: CheckMode,
reportErrors: boolean,
containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined,
) {
// Stateless function components can have maximum of three arguments: "props", "context", and "updater".
// However "context" and "updater" are implicit and can't be specify by users. Only the first parameter, props,
// can be specified by users through attributes property.
const paramType = getEffectiveFirstArgumentForJsxSignature(signature, node);
const attributesType = checkExpressionWithContextualType(node.attributes, paramType, /*inferenceContext*/ undefined, checkMode);
return checkTypeRelatedToAndOptionallyElaborate(attributesType, paramType, relation, reportErrors ? node.tagName : undefined, node.attributes, undefined, undefined, /*breakdown*/ true);
return checkTypeRelatedToAndOptionallyElaborate(attributesType, paramType, relation, reportErrors ? node.tagName : undefined, node.attributes, undefined, containingMessageChain, /*breakdown*/ true);
}
function getSignatureApplicabilityError(
@@ -21139,8 +21146,7 @@ namespace ts {
containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined,
) {
if (isJsxOpeningLikeElement(node)) {
// TODO: Maybe containingMessageChain too?
return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors);
return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain);
}
const thisType = getThisTypeOfSignature(signature);
if (thisType && thisType !== voidType && node.kind !== SyntaxKind.NewExpression) {
@@ -21151,7 +21157,7 @@ namespace ts {
const thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType;
const errorNode = reportErrors ? (thisArgumentNode || node) : undefined;
const headMessage = Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1;
const r = checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage, undefined, undefined, /*breakdown*/ true);
const r = checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage, containingMessageChain, undefined, /*breakdown*/ true);
if (r) {
return r;
}
@@ -21512,7 +21518,7 @@ namespace ts {
let chain: DiagnosticMessageChain | undefined = undefined;
if (candidatesForArgumentError.length > 3) {
chain = chainDiagnosticMessages(chain, Diagnostics.The_last_overload_gave_the_following_error);
chain = chainDiagnosticMessages(chain, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call_from_0_overloads, candidatesForArgumentError.length);
chain = chainDiagnosticMessages(chain, Diagnostics.No_suitable_overload_for_this_call);
}
const r = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain);
Debug.assert(!!r && !!r[0], "No error for last signature");
@@ -21522,15 +21528,17 @@ namespace ts {
}
else {
const related: DiagnosticRelatedInformation[] = [];
let i = 0;
for (const c of candidatesForArgumentError) {
const chain = chainDiagnosticMessages(undefined, Diagnostics.Overload_0_gave_the_following_error, signatureToString(c));
i++;
const chain = chainDiagnosticMessages(undefined, Diagnostics.Overload_0_of_1_2_gave_the_following_error, i, candidates.length, signatureToString(c));
const r = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain);
Debug.assert(!!r && !!r[0], "No error for signature (1)");
if (r) {
related.push(createDiagnosticForNodeFromMessageChain(...r));
}
}
diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call_from_0_overloads, candidatesForArgumentError.length), related));
diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.No_suitable_overload_for_this_call), related));
}
}
else if (candidateForArgumentArityError) {
+2 -2
View File
@@ -2621,7 +2621,7 @@
"category": "Error",
"code": 2754
},
"Failed to find a suitable overload for this call from {0} overloads.": {
"No suitable overload for this call.": {
"category": "Error",
"code": 2755
},
@@ -2629,7 +2629,7 @@
"category": "Error",
"code": 2756
},
"Overload '{0}' gave the following error.": {
"Overload {0} of {1}, '{2}', gave the following error.": {
"category": "Error",
"code": 2757
},
@@ -1,9 +1,7 @@
tests/cases/compiler/bigintWithLib.ts(4,1): error TS2350: Only a void function can be called with the 'new' keyword.
tests/cases/compiler/bigintWithLib.ts(16,33): error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag]
tests/cases/compiler/bigintWithLib.ts(16,15): error TS2755: No suitable overload for this call.
tests/cases/compiler/bigintWithLib.ts(21,13): error TS2540: Cannot assign to 'length' because it is a read-only property.
tests/cases/compiler/bigintWithLib.ts(28,35): error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
Type 'number[]' is not assignable to type 'SharedArrayBuffer'.
tests/cases/compiler/bigintWithLib.ts(28,16): error TS2755: No suitable overload for this call.
tests/cases/compiler/bigintWithLib.ts(33,13): error TS2540: Cannot assign to 'length' because it is a read-only property.
tests/cases/compiler/bigintWithLib.ts(40,25): error TS2345: Argument of type '-1' is not assignable to parameter of type 'bigint'.
tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '123' is not assignable to parameter of type 'bigint'.
@@ -28,9 +26,22 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12
bigIntArray = new BigInt64Array(10);
bigIntArray = new BigInt64Array([1n, 2n, 3n]);
bigIntArray = new BigInt64Array([1, 2, 3]); // should error
~~~~~~~~~
!!! error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
!!! error TS2345: Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error.
Argument of type 'number[]' is not assignable to parameter of type 'number'.
!!! related TS2757 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 2 of 3, '(array: Iterable<bigint>): BigInt64Array', gave the following error.
Argument of type 'number[]' is not assignable to parameter of type 'Iterable<bigint>'.
Types of property '[Symbol.iterator]' are incompatible.
Type '() => IterableIterator<number>' is not assignable to type '() => Iterator<bigint>'.
Type 'IterableIterator<number>' is not assignable to type 'Iterator<bigint>'.
Types of property 'next' are incompatible.
Type '(value?: any) => IteratorResult<number>' is not assignable to type '(value?: any) => IteratorResult<bigint>'.
Type 'IteratorResult<number>' is not assignable to type 'IteratorResult<bigint>'.
Type 'number' is not assignable to type 'bigint'.
!!! related TS2757 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error.
Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag]
bigIntArray = new BigInt64Array(new ArrayBuffer(80));
bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8);
bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8, 3);
@@ -45,9 +56,15 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12
bigUintArray = new BigUint64Array(10);
bigUintArray = new BigUint64Array([1n, 2n, 3n]);
bigUintArray = new BigUint64Array([1, 2, 3]); // should error
~~~~~~~~~
!!! error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
!!! error TS2345: Type 'number[]' is not assignable to type 'SharedArrayBuffer'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error.
Argument of type 'number[]' is not assignable to parameter of type 'number'.
!!! related TS2757 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 2 of 3, '(array: Iterable<bigint>): BigUint64Array', gave the following error.
Argument of type 'number[]' is not assignable to parameter of type 'Iterable<bigint>'.
!!! related TS2757 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error.
Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
Type 'number[]' is not assignable to type 'SharedArrayBuffer'.
bigUintArray = new BigUint64Array(new ArrayBuffer(80));
bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8);
bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8, 3);
@@ -1,8 +1,4 @@
tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,18): error TS2322: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly<ResizablePanelProps>'.
Types of property 'children' are incompatible.
Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'.
Types of property 'length' are incompatible.
Type '3' is not assignable to type '2'.
tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2755: No suitable overload for this call.
==== tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx (1 errors) ====
@@ -23,12 +19,18 @@ tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,18): error TS2
</ResizablePanel>
const testErr = <ResizablePanel>
~~~~~~~~~~~~~~
!!! error TS2322: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly<ResizablePanelProps>'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'.
!!! error TS2322: Types of property 'length' are incompatible.
!!! error TS2322: Type '3' is not assignable to type '2'.
~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx:17:18: Overload 1 of 2, '(props: Readonly<ResizablePanelProps>): ResizablePanel', gave the following error.
Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly<ResizablePanelProps>'.
Types of property 'children' are incompatible.
Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'.
Types of property 'length' are incompatible.
Type '3' is not assignable to type '2'.
!!! related TS2757 tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx:17:18: Overload 2 of 2, '(props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error.
Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly<ResizablePanelProps>'.
Types of property 'children' are incompatible.
Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'.
<div />
<div />
<div />
@@ -2,8 +2,8 @@ tests/cases/compiler/constructorOverloads1.ts(2,5): error TS2392: Multiple const
tests/cases/compiler/constructorOverloads1.ts(3,5): error TS2392: Multiple constructor implementations are not allowed.
tests/cases/compiler/constructorOverloads1.ts(4,5): error TS2392: Multiple constructor implementations are not allowed.
tests/cases/compiler/constructorOverloads1.ts(7,5): error TS2392: Multiple constructor implementations are not allowed.
tests/cases/compiler/constructorOverloads1.ts(16,18): error TS2345: Argument of type 'Foo' is not assignable to parameter of type 'number'.
tests/cases/compiler/constructorOverloads1.ts(17,18): error TS2345: Argument of type 'any[]' is not assignable to parameter of type 'number'.
tests/cases/compiler/constructorOverloads1.ts(16,10): error TS2755: No suitable overload for this call.
tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2755: No suitable overload for this call.
==== tests/cases/compiler/constructorOverloads1.ts (6 errors) ====
@@ -35,11 +35,19 @@ tests/cases/compiler/constructorOverloads1.ts(17,18): error TS2345: Argument of
var f1 = new Foo("hey");
var f2 = new Foo(0);
var f3 = new Foo(f1);
~~
!!! error TS2345: Argument of type 'Foo' is not assignable to parameter of type 'number'.
~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/constructorOverloads1.ts:16:18: Overload 1 of 2, '(s: string): Foo', gave the following error.
Argument of type 'Foo' is not assignable to parameter of type 'string'.
!!! related TS2757 tests/cases/compiler/constructorOverloads1.ts:16:18: Overload 2 of 2, '(n: number): Foo', gave the following error.
Argument of type 'Foo' is not assignable to parameter of type 'number'.
var f4 = new Foo([f1,f2,f3]);
~~~~~~~~~~
!!! error TS2345: Argument of type 'any[]' is not assignable to parameter of type 'number'.
~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/constructorOverloads1.ts:17:18: Overload 1 of 2, '(s: string): Foo', gave the following error.
Argument of type 'any[]' is not assignable to parameter of type 'string'.
!!! related TS2757 tests/cases/compiler/constructorOverloads1.ts:17:18: Overload 2 of 2, '(n: number): Foo', gave the following error.
Argument of type 'any[]' is not assignable to parameter of type 'number'.
f1.bar1();
f1.bar2();
@@ -1,11 +1,7 @@
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,13): error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,13): error TS2322: Type '{ onClick: (k: any) => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,13): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,13): error TS2322: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,12): error TS2755: No suitable overload for this call.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,12): error TS2755: No suitable overload for this call.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,12): error TS2755: No suitable overload for this call.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,12): error TS2755: No suitable overload for this call.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(33,13): error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
@@ -40,21 +36,41 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): err
}
const b0 = <MainButton {...{onClick: (k) => {console.log(k)}}} extra />; // k has type "left" | "right"
~~~~~~~~~~
!!! error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
!!! error TS2322: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:27:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:27:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
const b2 = <MainButton onClick={(k)=>{console.log(k)}} extra />; // k has type "left" | "right"
~~~~~~~~~~
!!! error TS2322: Type '{ onClick: (k: any) => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
!!! error TS2322: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:28:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:28:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'.
const b3 = <MainButton {...{goTo:"home"}} extra />; // goTo has type"home" | "contact"
~~~~~~~~~~
!!! error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
!!! error TS2322: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:29:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:29:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
const b4 = <MainButton goTo="home" extra />; // goTo has type "home" | "contact"
~~~~~~~~~~
!!! error TS2322: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
!!! error TS2322: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:30:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'.
!!! related TS2757 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:30:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
export function NoOverload(buttonProps: ButtonProps): JSX.Element { return undefined }
const c1 = <NoOverload {...{onClick: (k) => {console.log(k)}}} extra />; // k has type any
@@ -81,14 +81,14 @@ const b2 = <MainButton onClick={(k)=>{console.log(k)}} extra />; // k has type
>b2 : JSX.Element
><MainButton onClick={(k)=>{console.log(k)}} extra /> : JSX.Element
>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; }
>onClick : (k: any) => void
>(k)=>{console.log(k)} : (k: any) => void
>k : any
>onClick : (k: "left" | "right") => void
>(k)=>{console.log(k)} : (k: "left" | "right") => void
>k : "left" | "right"
>console.log(k) : void
>console.log : (message?: any, ...optionalParams: any[]) => void
>console : Console
>log : (message?: any, ...optionalParams: any[]) => void
>k : any
>k : "left" | "right"
>extra : true
const b3 = <MainButton {...{goTo:"home"}} extra />; // goTo has type"home" | "contact"
@@ -2,10 +2,8 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(11,17): error
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(22,17): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string'.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(34,17): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,17): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(34,13): error TS2755: No suitable overload for this call.
tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error TS2755: No suitable overload for this call.
==== tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts (4 errors) ====
@@ -49,9 +47,14 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,17): error
x = "";
while (cond) {
x = foo(x);
~
!!! error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:34:17: Overload 1 of 2, '(x: string): number', gave the following error.
Argument of type 'string | number' is not assignable to parameter of type 'string'.
Type 'number' is not assignable to type 'string'.
!!! related TS2757 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:34:17: Overload 2 of 2, '(x: number): string', gave the following error.
Argument of type 'string | number' is not assignable to parameter of type 'number'.
Type 'string' is not assignable to type 'number'.
x;
}
x;
@@ -63,9 +66,14 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,17): error
while (cond) {
x;
x = foo(x);
~
!!! error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:45:17: Overload 1 of 2, '(x: string): number', gave the following error.
Argument of type 'string | number' is not assignable to parameter of type 'string'.
Type 'number' is not assignable to type 'string'.
!!! related TS2757 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:45:17: Overload 2 of 2, '(x: number): string', gave the following error.
Argument of type 'string | number' is not assignable to parameter of type 'number'.
Type 'string' is not assignable to type 'number'.
}
x;
}
@@ -1,4 +1,4 @@
tests/cases/compiler/functionOverloads2.ts(4,13): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'.
tests/cases/compiler/functionOverloads2.ts(4,9): error TS2755: No suitable overload for this call.
==== tests/cases/compiler/functionOverloads2.ts (1 errors) ====
@@ -6,5 +6,9 @@ tests/cases/compiler/functionOverloads2.ts(4,13): error TS2345: Argument of type
function foo(bar: number): number;
function foo(bar: any): any { return bar };
var x = foo(true);
~~~~
!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'.
~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/functionOverloads2.ts:4:13: Overload 1 of 2, '(bar: string): string', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'string'.
!!! related TS2757 tests/cases/compiler/functionOverloads2.ts:4:13: Overload 2 of 2, '(bar: number): number', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'number'.
@@ -1,15 +1,9 @@
tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(23,38): error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(52,38): error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(68,38): error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }' is not assignable to parameter of type '(x: number) => Promise<boolean>'.
Type 'Promise<number>' is not assignable to type 'Promise<boolean>'.
Type 'number' is not assignable to type 'boolean'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(52,22): error TS2755: No suitable overload for this call.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(68,22): error TS2755: No suitable overload for this call.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(84,22): error TS2755: No suitable overload for this call.
==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts (4 errors) ====
@@ -69,10 +63,15 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl
var numPromise: Promise<number>;
var newPromise = numPromise.then(testFunction);
~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
!!! error TS2345: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
!!! error TS2345: Type 'number' is not assignable to type 'string'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:52:38: Overload 1 of 2, '(cb: (x: number) => Promise<string>): Promise<string>', gave the following error.
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
Type 'number' is not assignable to type 'string'.
!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:52:38: Overload 2 of 2, '(cb: (x: number) => Promise<string>, error?: (error: any) => Promise<string>): Promise<string>', gave the following error.
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
}
//////////////////////////////////////
@@ -89,10 +88,18 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl
var numPromise: Promise<number>;
var newPromise = numPromise.then(testFunction);
~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
!!! error TS2345: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
!!! error TS2345: Type 'number' is not assignable to type 'string'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 1 of 3, '(cb: (x: number) => Promise<string>): Promise<string>', gave the following error.
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
Type 'number' is not assignable to type 'string'.
!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 2 of 3, '(cb: (x: number) => Promise<string>, error?: (error: any) => Promise<string>): Promise<string>', gave the following error.
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 3 of 3, '(cb: (x: number) => Promise<string>, error?: (error: any) => string, progress?: (preservation: any) => void): Promise<string>', gave the following error.
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
}
//////////////////////////////////////
@@ -109,9 +116,14 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl
var numPromise: Promise<number>;
var newPromise = numPromise.then(testFunction);
~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }' is not assignable to parameter of type '(x: number) => Promise<boolean>'.
!!! error TS2345: Type 'Promise<number>' is not assignable to type 'Promise<boolean>'.
!!! error TS2345: Type 'number' is not assignable to type 'boolean'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:84:38: Overload 1 of 2, '(cb: (x: number) => Promise<boolean>): Promise<boolean>', gave the following error.
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }' is not assignable to parameter of type '(x: number) => Promise<boolean>'.
Type 'Promise<number>' is not assignable to type 'Promise<boolean>'.
Type 'number' is not assignable to type 'boolean'.
!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:84:38: Overload 2 of 2, '(cb: (x: number) => Promise<boolean>, error?: (error: any) => Promise<boolean>): Promise<boolean>', gave the following error.
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }' is not assignable to parameter of type '(x: number) => Promise<boolean>'.
Type 'Promise<number>' is not assignable to type 'Promise<boolean>'.
}
@@ -9,12 +9,8 @@ tests/cases/compiler/incompatibleTypes.ts(26,12): error TS2416: Property 'p1' in
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/incompatibleTypes.ts(34,12): error TS2416: Property 'p1' in type 'C4' is not assignable to the same property in base type 'IFoo4'.
Type '{ c: { b: string; }; d: string; }' is missing the following properties from type '{ a: { a: string; }; b: string; }': a, b
tests/cases/compiler/incompatibleTypes.ts(42,5): error TS2345: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'.
Types of property 'p1' are incompatible.
Type '() => string' is not assignable to type '(s: string) => number'.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/incompatibleTypes.ts(49,7): error TS2345: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'.
Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'.
tests/cases/compiler/incompatibleTypes.ts(42,1): error TS2755: No suitable overload for this call.
tests/cases/compiler/incompatibleTypes.ts(49,1): error TS2755: No suitable overload for this call.
tests/cases/compiler/incompatibleTypes.ts(66,47): error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'.
Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'.
tests/cases/compiler/incompatibleTypes.ts(72,5): error TS2322: Type '5' is not assignable to type '() => string'.
@@ -79,11 +75,18 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) =>
var c1: C1;
var c2: C2;
if1(c1);
~~
!!! error TS2345: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'.
!!! error TS2345: Types of property 'p1' are incompatible.
!!! error TS2345: Type '() => string' is not assignable to type '(s: string) => number'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/incompatibleTypes.ts:42:5: Overload 1 of 2, '(i: IFoo1): void', gave the following error.
Argument of type 'C1' is not assignable to parameter of type 'IFoo1'.
Types of property 'p1' are incompatible.
Type '() => string' is not assignable to type '() => number'.
Type 'string' is not assignable to type 'number'.
!!! related TS2757 tests/cases/compiler/incompatibleTypes.ts:42:5: Overload 2 of 2, '(i: IFoo2): void', gave the following error.
Argument of type 'C1' is not assignable to parameter of type 'IFoo2'.
Types of property 'p1' are incompatible.
Type '() => string' is not assignable to type '(s: string) => number'.
Type 'string' is not assignable to type 'number'.
function of1(n: { a: { a: string; }; b: string; }): number;
@@ -91,9 +94,14 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) =>
function of1(a: any) { return null; }
of1({ e: 0, f: 0 });
~~~~
!!! error TS2345: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'.
!!! error TS2345: Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'.
~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/incompatibleTypes.ts:49:7: Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error.
Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'.
Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'.
!!! related TS2757 tests/cases/compiler/incompatibleTypes.ts:49:7: Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error.
Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'.
Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'.
interface IMap {
[key:string]:string;
@@ -1,6 +1,6 @@
tests/cases/compiler/inheritedConstructorWithRestParams2.ts(32,13): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'.
tests/cases/compiler/inheritedConstructorWithRestParams2.ts(33,17): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'.
tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,17): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'.
tests/cases/compiler/inheritedConstructorWithRestParams2.ts(33,1): error TS2755: No suitable overload for this call.
tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2755: No suitable overload for this call.
==== tests/cases/compiler/inheritedConstructorWithRestParams2.ts (3 errors) ====
@@ -39,8 +39,16 @@ tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,17): error TS2345
~
!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'.
new Derived("", 3, "", 3);
~
!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'.
~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:33:20: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error.
Argument of type '""' is not assignable to parameter of type 'number'.
!!! related TS2757 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:33:17: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error.
Argument of type '3' is not assignable to parameter of type 'string'.
new Derived("", 3, "", "");
~
!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'.
~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:34:20: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error.
Argument of type '""' is not assignable to parameter of type 'number'.
!!! related TS2757 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:34:17: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error.
Argument of type '3' is not assignable to parameter of type 'string'.
@@ -1,9 +1,4 @@
tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,14): error TS2345: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray<number>'.
Type 'symbol[]' is not assignable to type 'ConcatArray<number>'.
Types of property 'slice' are incompatible.
Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'.
Type 'symbol[]' is not assignable to type 'number[]'.
Type 'symbol' is not assignable to type 'number'.
tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2755: No suitable overload for this call.
==== tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts (1 errors) ====
@@ -22,10 +17,14 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,14): error TS234
var array: number[] = [0, 1];
array.concat([...new SymbolIterator]);
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray<number>'.
!!! error TS2345: Type 'symbol[]' is not assignable to type 'ConcatArray<number>'.
!!! error TS2345: Types of property 'slice' are incompatible.
!!! error TS2345: Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'.
!!! error TS2345: Type 'symbol[]' is not assignable to type 'number[]'.
!!! error TS2345: Type 'symbol' is not assignable to type 'number'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts:15:14: Overload 1 of 2, '(...items: ConcatArray<number>[]): number[]', gave the following error.
Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray<number>'.
Types of property 'slice' are incompatible.
Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'.
Type 'symbol[]' is not assignable to type 'number[]'.
Type 'symbol' is not assignable to type 'number'.
!!! related TS2757 tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts:15:14: Overload 2 of 2, '(...items: (number | ConcatArray<number>)[]): number[]', gave the following error.
Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray<number>'.
Type 'symbol[]' is not assignable to type 'ConcatArray<number>'.
@@ -1,8 +1,6 @@
tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,5): error TS2345: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'.
Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'.
tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,1): error TS2755: No suitable overload for this call.
tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'w' must be of type 'A', but here has type 'C'.
tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,5): error TS2345: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'.
Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'.
tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS2755: No suitable overload for this call.
==== tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts (3 errors) ====
@@ -25,9 +23,14 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,5): error TS234
var v: B;
v({ s: "", n: 0 }).toLowerCase();
~~~~~
!!! error TS2345: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'.
!!! error TS2345: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'.
~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:19:12: Overload 1 of 2, '(x: { s: string; }): string', gave the following error.
Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'.
Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'.
!!! related TS2757 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:19:5: Overload 2 of 2, '(x: { n: number; }): number', gave the following error.
Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'.
Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'.
var w: A;
var w: C;
@@ -36,6 +39,11 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,5): error TS234
!!! related TS6203 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:21:5: 'w' was also declared here.
w({ s: "", n: 0 }).toLowerCase();
~~~~~
!!! error TS2345: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'.
!!! error TS2345: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'.
~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:24:12: Overload 1 of 2, '(x: { s: string; }): string', gave the following error.
Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'.
Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'.
!!! related TS2757 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:24:5: Overload 2 of 2, '(x: { n: number; }): number', gave the following error.
Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'.
Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'.
@@ -3,7 +3,7 @@ tests/cases/compiler/overload1.ts(29,1): error TS2322: Type 'number' is not assi
tests/cases/compiler/overload1.ts(31,11): error TS2554: Expected 1-2 arguments, but got 3.
tests/cases/compiler/overload1.ts(32,3): error TS2554: Expected 1-2 arguments, but got 0.
tests/cases/compiler/overload1.ts(33,1): error TS2322: Type 'C' is not assignable to type 'string'.
tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type '2' is not assignable to parameter of type 'string'.
tests/cases/compiler/overload1.ts(34,3): error TS2755: No suitable overload for this call.
==== tests/cases/compiler/overload1.ts (6 errors) ====
@@ -52,8 +52,12 @@ tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type '2' is n
~
!!! error TS2322: Type 'C' is not assignable to type 'string'.
z=x.h(2,2); // no match
~
!!! error TS2345: Argument of type '2' is not assignable to parameter of type 'string'.
~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/overload1.ts:34:7: Overload 1 of 2, '(s1: string, s2: number): string', gave the following error.
Argument of type '2' is not assignable to parameter of type 'string'.
!!! related TS2757 tests/cases/compiler/overload1.ts:34:9: Overload 2 of 2, '(s1: number, s2: string): number', gave the following error.
Argument of type '2' is not assignable to parameter of type 'string'.
z=x.h("hello",0); // good
var v=x.g;
@@ -1,11 +1,11 @@
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,5): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(41,11): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2558: Expected 3 type arguments, but got 4.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,5): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,11): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): error TS2339: Property 'toFixed' does not exist on type 'string'.
@@ -38,8 +38,12 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22):
// No candidate overloads found
fn1({}); // Error
~~
!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'.
~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:27:5: Overload 1 of 2, '(s: string): string', gave the following error.
Argument of type '{}' is not assignable to parameter of type 'string'.
!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:27:5: Overload 2 of 2, '(s: number): number', gave the following error.
Argument of type '{}' is not assignable to parameter of type 'number'.
// Generic and non - generic overload where generic overload is the only candidate when called with type arguments
function fn2(s: string, n: number): number;
@@ -107,11 +111,19 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22):
// Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints
fn4(true, null); // Error
~~~~
!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'.
~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:84:5: Overload 1 of 2, '(n: string, m: any): any', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'string'.
!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:84:5: Overload 2 of 2, '(n: number, m: any): any', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'number'.
fn4(null, true); // Error
~~~~
!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:85:11: Overload 1 of 2, '(n: any, m: number): any', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'number'.
!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:85:11: Overload 2 of 2, '(n: any, m: string): any', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'string'.
// Non - generic overloads where contextual typing of function arguments has errors
function fn5(f: (n: string) => void): string;
@@ -1,4 +1,4 @@
tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,9): error TS2558: Expected 3 type arguments, but got 1.
tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,9): error TS2558: Expected 3 type arguments, but got 2.
tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,9): error TS2558: Expected 3 type arguments, but got 4.
@@ -42,8 +42,12 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru
// No candidate overloads found
new fn1({}); // Error
~~
!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'.
~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts:27:9: Overload 1 of 2, '(s: string): fn1', gave the following error.
Argument of type '{}' is not assignable to parameter of type 'string'.
!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts:27:9: Overload 2 of 2, '(s: number): fn1', gave the following error.
Argument of type '{}' is not assignable to parameter of type 'number'.
// Generic and non - generic overload where generic overload is the only candidate when called with type arguments
class fn2<T> {
@@ -1,11 +1,11 @@
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2558: Expected 3 type arguments, but got 4.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,9): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,15): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,26): error TS2339: Property 'toFixed' does not exist on type 'string'.
@@ -38,8 +38,12 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors
// No candidate overloads found
new fn1({}); // Error
~~
!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'.
~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:27:9: Overload 1 of 2, '(s: string): string', gave the following error.
Argument of type '{}' is not assignable to parameter of type 'string'.
!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:27:9: Overload 2 of 2, '(s: number): number', gave the following error.
Argument of type '{}' is not assignable to parameter of type 'number'.
// Generic and non - generic overload where generic overload is the only candidate when called with type arguments
interface fn2 {
@@ -114,11 +118,19 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors
// Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints
new fn4(true, null); // Error
~~~~
!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'.
~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:91:9: Overload 1 of 2, '(n: string, m: any): any', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'string'.
!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:91:9: Overload 2 of 2, '(n: number, m: any): any', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'number'.
new fn4(null, true); // Error
~~~~
!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:92:15: Overload 1 of 2, '(n: any, m: number): any', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'number'.
!!! related TS2757 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:92:15: Overload 2 of 2, '(n: any, m: string): any', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'string'.
// Non - generic overloads where contextual typing of function arguments has errors
interface fn5 {
@@ -1,5 +1,5 @@
tests/cases/compiler/overloadingOnConstants2.ts(9,10): error TS2394: This overload signature is not compatible with its implementation signature.
tests/cases/compiler/overloadingOnConstants2.ts(15,13): error TS2345: Argument of type '"um"' is not assignable to parameter of type '"bye"'.
tests/cases/compiler/overloadingOnConstants2.ts(15,9): error TS2755: No suitable overload for this call.
tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: This overload signature is not compatible with its implementation signature.
@@ -22,8 +22,12 @@ tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: This overl
var a: D = foo("hi", []); // D
var b: E = foo("bye", []); // E
var c = foo("um", []); // error
~~~~
!!! error TS2345: Argument of type '"um"' is not assignable to parameter of type '"bye"'.
~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/overloadingOnConstants2.ts:15:13: Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error.
Argument of type '"um"' is not assignable to parameter of type '"hi"'.
!!! related TS2757 tests/cases/compiler/overloadingOnConstants2.ts:15:13: Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error.
Argument of type '"um"' is not assignable to parameter of type '"bye"'.
//function bar(x: "hi", items: string[]): D;
@@ -3,9 +3,7 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,37):
Property 'x' is missing in type 'D' but required in type 'A'.
tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,5): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,38): error TS2344: Type 'D' does not satisfy the constraint 'A'.
tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,27): error TS2345: Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: B) => any'.
Types of parameters 'x' and 'x' are incompatible.
Property 'q' is missing in type 'B' but required in type 'D'.
tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,23): error TS2755: No suitable overload for this call.
tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): error TS2344: Type 'D' does not satisfy the constraint 'A'.
@@ -38,14 +36,25 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14):
!!! error TS2344: Type 'D' does not satisfy the constraint 'A'.
var result3: string = foo(x => { // x has type D
~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: B) => any'.
!!! error TS2345: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2345: Property 'q' is missing in type 'B' but required in type 'D'.
!!! related TS2728 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here.
~~~~~~~~~~~~~~~~~~~~~~~~~~
var y: G<typeof x>; // error that D does not satisfy constraint, y is of type G<D>, entire call to foo is an error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~
!!! error TS2344: Type 'D' does not satisfy the constraint 'A'.
return y;
~~~~~~~~~~~~~
});
~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:18:27: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error.
Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: D) => number'.
Type 'G<D>' is not assignable to type 'number'.
!!! related TS2757 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:18:27: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error.
Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: C) => any'.
Types of parameters 'x' and 'x' are incompatible.
Property 'q' is missing in type 'C' but required in type 'D'.
!!! related TS2757 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:18:27: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error.
Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: B) => any'.
Types of parameters 'x' and 'x' are incompatible.
Property 'q' is missing in type 'B' but required in type 'D'.
@@ -1,67 +1,133 @@
tests/cases/compiler/promisePermutations.ts(74,70): error TS2345: Argument of type '(x: number) => IPromise<number>' is not assignable to parameter of type '(value: IPromise<number>) => IPromise<number>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'IPromise<number>' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations.ts(79,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations.ts(82,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations.ts(83,19): error TS2345: Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations.ts(84,19): error TS2345: Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations.ts(88,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
tests/cases/compiler/promisePermutations.ts(93,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations.ts(97,19): error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations.ts(100,19): error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations.ts(101,19): error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
tests/cases/compiler/promisePermutations.ts(102,19): error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations.ts(106,19): error TS2345: Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'cb' and 'value' are incompatible.
Type 'string' is not assignable to type '<T>(a: T) => T'.
tests/cases/compiler/promisePermutations.ts(109,19): error TS2345: Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations.ts(110,19): error TS2345: Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
Types of parameters 'cb' and 'value' are incompatible.
Type 'string' is not assignable to type '<T>(a: T) => T'.
tests/cases/compiler/promisePermutations.ts(111,19): error TS2345: Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'cb' and 'value' are incompatible.
Type 'string' is not assignable to type '<T>(a: T) => T'.
tests/cases/compiler/promisePermutations.ts(117,19): error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations.ts(120,19): error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations.ts(121,19): error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
tests/cases/compiler/promisePermutations.ts(122,19): error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations.ts(126,19): error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations.ts(129,33): error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations.ts(132,19): error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations.ts(133,19): error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
tests/cases/compiler/promisePermutations.ts(134,19): error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations.ts(137,33): error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
tests/cases/compiler/promisePermutations.ts(144,35): error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
tests/cases/compiler/promisePermutations.ts(152,36): error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => Promise<number>'.
Property 'catch' is missing in type 'IPromise<string>' but required in type 'Promise<number>'.
tests/cases/compiler/promisePermutations.ts(156,21): error TS2345: Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/promisePermutations.ts(158,21): error TS2345: Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
tests/cases/compiler/promisePermutations.ts(159,21): error TS2345: Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => Promise<string>'.
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
Type 'Promise<number>' is not assignable to type 'IPromise<string>'.
Types of property 'then' are incompatible.
Type '{ <TResult1 = number, TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>; <U>(success?: (value: number) => Promise<U>, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => Promise<U>, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => U, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; }' is not assignable to type '{ <U>(success?: (value: string) => IPromise<U>, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>; <U>(success?: (value: string) => IPromise<U>, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>; <U>(success?: (value: string) => U, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>; <U>(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>; }'.
Types of parameters 'onfulfilled' and 'success' are incompatible.
Types of parameters 'value' and 'value' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/promisePermutations.ts(74,70): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number) => IPromise<number>' is not assignable to parameter of type '(value: IPromise<number>) => IPromise<number>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'IPromise<number>' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations.ts(79,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations.ts(82,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations.ts(83,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations.ts(84,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations.ts(88,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations.ts(91,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations.ts(92,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
tests/cases/compiler/promisePermutations.ts(93,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations.ts(97,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations.ts(100,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations.ts(101,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
tests/cases/compiler/promisePermutations.ts(102,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations.ts(106,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'cb' and 'value' are incompatible.
Type 'string' is not assignable to type '<T>(a: T) => T'.
tests/cases/compiler/promisePermutations.ts(109,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations.ts(110,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
Types of parameters 'cb' and 'value' are incompatible.
Type 'string' is not assignable to type '<T>(a: T) => T'.
tests/cases/compiler/promisePermutations.ts(111,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'cb' and 'value' are incompatible.
Type 'string' is not assignable to type '<T>(a: T) => T'.
tests/cases/compiler/promisePermutations.ts(117,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations.ts(120,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations.ts(121,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
tests/cases/compiler/promisePermutations.ts(122,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations.ts(126,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations.ts(129,33): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations.ts(132,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations.ts(133,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
tests/cases/compiler/promisePermutations.ts(134,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations.ts(137,33): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
tests/cases/compiler/promisePermutations.ts(144,35): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
tests/cases/compiler/promisePermutations.ts(152,36): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => Promise<number>'.
Property 'catch' is missing in type 'IPromise<string>' but required in type 'Promise<number>'.
tests/cases/compiler/promisePermutations.ts(156,21): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/promisePermutations.ts(158,21): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
tests/cases/compiler/promisePermutations.ts(159,21): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => Promise<string>'.
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
Type 'Promise<number>' is not assignable to type 'IPromise<string>'.
Types of property 'then' are incompatible.
Type '{ <TResult1 = number, TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>; <U>(success?: (value: number) => Promise<U>, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => Promise<U>, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => U, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; }' is not assignable to type '{ <U>(success?: (value: string) => IPromise<U>, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>; <U>(success?: (value: string) => IPromise<U>, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>; <U>(success?: (value: string) => U, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>; <U>(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>; }'.
Types of parameters 'onfulfilled' and 'success' are incompatible.
Types of parameters 'value' and 'value' are incompatible.
Type 'number' is not assignable to type 'string'.
==== tests/cases/compiler/promisePermutations.ts (33 errors) ====
@@ -140,92 +206,126 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t
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<number>' is not assignable to parameter of type '(value: IPromise<number>) => IPromise<number>'.
!!! error TS2345: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2345: Type 'IPromise<number>' is not assignable to type 'number'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number) => IPromise<number>' is not assignable to parameter of type '(value: IPromise<number>) => IPromise<number>'.
!!! error TS2755: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2755: Type 'IPromise<number>' is not assignable to type 'number'.
var r4: IPromise<string>;
var sIPromise: (x: any) => IPromise<string>;
var sPromise: (x: any) => Promise<string>;
var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2345: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2755: Type 'string' is not assignable to type 'number'.
var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok
var s4: Promise<string>;
var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2345: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2755: Type 'string' is not assignable to type 'number'.
var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
!!! error TS2345: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
!!! error TS2755: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2755: Type 'string' is not assignable to type 'number'.
var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2345: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2755: Type 'string' is not assignable to type 'number'.
var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4);
var r5: IPromise<string>;
var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var s5: Promise<string>;
var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok
var r6: IPromise<string>;
var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var s6: Promise<string>;
var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok
var r7: IPromise<string>;
var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type '<T>(a: T) => T'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible.
!!! error TS2755: Type 'string' is not assignable to type '<T>(a: T) => T'.
var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var s7: Promise<string>;
var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type '<T>(a: T) => T'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible.
!!! error TS2755: Type 'string' is not assignable to type '<T>(a: T) => T'.
var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type '<T>(a: T) => T'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible.
!!! error TS2755: Type 'string' is not assignable to type '<T>(a: T) => T'.
var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok?
var r8: IPromise<number>;
@@ -233,48 +333,68 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t
var nPromise: (x: any) => Promise<number>;
var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok
var s8: Promise<number>;
var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok
var r9: IPromise<number>;
var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
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 TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
!!! error TS2345: Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
!!! error TS2755: Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
!!! error TS2755: Type 'string' is not assignable to type 'number'.
var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var s9: Promise<number>;
var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
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 TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
!!! error TS2345: Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
!!! error TS2755: Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var r10 = testFunction10(x => x);
@@ -283,7 +403,9 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t
var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok
var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok
~~~~~~~~~
!!! error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<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
@@ -293,36 +415,46 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t
var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok
var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error
~~~~~~~~~
!!! error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => Promise<number>'.
!!! error TS2345: Property 'catch' is missing in type 'IPromise<string>' but required in type 'Promise<number>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => Promise<number>'.
!!! error TS2755: Property 'catch' is missing in type 'IPromise<string>' but required in type 'Promise<number>'.
!!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here.
var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok
var r11: IPromise<number>;
var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
!!! error TS2345: Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
!!! error TS2345: Type 'number' is not assignable to type 'string'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
!!! error TS2755: Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
!!! error TS2755: Type 'number' is not assignable to type 'string'.
var s11: Promise<number>;
var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
!!! error TS2345: Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
!!! error TS2755: Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error
~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => Promise<string>'.
!!! error TS2345: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
!!! error TS2345: Type 'number' is not assignable to type 'string'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => Promise<string>'.
!!! error TS2755: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
!!! error TS2755: Type 'number' is not assignable to type 'string'.
var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error
~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
!!! error TS2345: Type 'Promise<number>' is not assignable to type 'IPromise<string>'.
!!! error TS2345: Types of property 'then' are incompatible.
!!! error TS2345: Type '{ <TResult1 = number, TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>; <U>(success?: (value: number) => Promise<U>, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => Promise<U>, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => U, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; }' is not assignable to type '{ <U>(success?: (value: string) => IPromise<U>, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>; <U>(success?: (value: string) => IPromise<U>, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>; <U>(success?: (value: string) => U, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>; <U>(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>; }'.
!!! error TS2345: Types of parameters 'onfulfilled' and 'success' are incompatible.
!!! error TS2345: Types of parameters 'value' and 'value' are incompatible.
!!! error TS2345: Type 'number' is not assignable to type 'string'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
!!! error TS2755: Type 'Promise<number>' is not assignable to type 'IPromise<string>'.
!!! error TS2755: Types of property 'then' are incompatible.
!!! error TS2755: Type '{ <TResult1 = number, TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>; <U>(success?: (value: number) => Promise<U>, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => Promise<U>, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => U, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; }' is not assignable to type '{ <U>(success?: (value: string) => IPromise<U>, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>; <U>(success?: (value: string) => IPromise<U>, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>; <U>(success?: (value: string) => U, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>; <U>(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>; }'.
!!! error TS2755: Types of parameters 'onfulfilled' and 'success' are incompatible.
!!! error TS2755: Types of parameters 'value' and 'value' are incompatible.
!!! error TS2755: Type 'number' is not assignable to type 'string'.
var r12 = testFunction12(x => x);
var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok
@@ -1,9 +1,11 @@
tests/cases/compiler/promisePermutations2.ts(73,70): error TS2345: Argument of type '(x: number) => IPromise<number>' is not assignable to parameter of type '(value: IPromise<number>) => IPromise<number>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'IPromise<number>' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations2.ts(78,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations2.ts(78,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations2.ts(81,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
@@ -13,43 +15,65 @@ tests/cases/compiler/promisePermutations2.ts(82,19): error TS2345: Argument of t
tests/cases/compiler/promisePermutations2.ts(83,19): error TS2345: Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations2.ts(87,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations2.ts(87,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations2.ts(90,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations2.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
tests/cases/compiler/promisePermutations2.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations2.ts(96,19): error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations2.ts(96,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations2.ts(99,19): error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations2.ts(100,19): error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
tests/cases/compiler/promisePermutations2.ts(101,19): error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations2.ts(105,19): error TS2345: Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'cb' and 'value' are incompatible.
Type 'string' is not assignable to type '<T>(a: T) => T'.
tests/cases/compiler/promisePermutations2.ts(108,19): error TS2345: Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations2.ts(109,19): error TS2345: Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
Types of parameters 'cb' and 'value' are incompatible.
Type 'string' is not assignable to type '<T>(a: T) => T'.
tests/cases/compiler/promisePermutations2.ts(110,19): error TS2345: Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'cb' and 'value' are incompatible.
Type 'string' is not assignable to type '<T>(a: T) => T'.
tests/cases/compiler/promisePermutations2.ts(116,19): error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations2.ts(105,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'cb' and 'value' are incompatible.
Type 'string' is not assignable to type '<T>(a: T) => T'.
tests/cases/compiler/promisePermutations2.ts(108,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations2.ts(109,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
Types of parameters 'cb' and 'value' are incompatible.
Type 'string' is not assignable to type '<T>(a: T) => T'.
tests/cases/compiler/promisePermutations2.ts(110,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'cb' and 'value' are incompatible.
Type 'string' is not assignable to type '<T>(a: T) => T'.
tests/cases/compiler/promisePermutations2.ts(116,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations2.ts(119,19): error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations2.ts(120,19): error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
tests/cases/compiler/promisePermutations2.ts(121,19): error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations2.ts(125,19): error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations2.ts(128,33): error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations2.ts(125,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations2.ts(128,33): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations2.ts(131,19): error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations2.ts(132,19): error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
tests/cases/compiler/promisePermutations2.ts(133,19): error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations2.ts(136,33): error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
tests/cases/compiler/promisePermutations2.ts(143,35): error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
tests/cases/compiler/promisePermutations2.ts(143,35): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
tests/cases/compiler/promisePermutations2.ts(151,36): error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => Promise<number>'.
Property 'catch' is missing in type 'IPromise<string>' but required in type 'Promise<number>'.
tests/cases/compiler/promisePermutations2.ts(155,21): error TS2345: Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/promisePermutations2.ts(155,21): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/promisePermutations2.ts(157,21): error TS2345: Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
tests/cases/compiler/promisePermutations2.ts(158,21): error TS2345: Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => Promise<string>'.
@@ -148,9 +172,11 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of
var sPromise: (x: any) => Promise<string>;
var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2345: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2755: Type 'string' is not assignable to type 'number'.
var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok
var s4: Promise<string>;
var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error
@@ -173,7 +199,9 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of
var r5: IPromise<string>;
var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var s5: Promise<string>;
var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error
@@ -190,7 +218,9 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of
var r6: IPromise<string>;
var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var s6: Promise<string>;
var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error
@@ -207,24 +237,32 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of
var r7: IPromise<string>;
var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type '<T>(a: T) => T'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible.
!!! error TS2755: Type 'string' is not assignable to type '<T>(a: T) => T'.
var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var s7: Promise<string>;
var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type '<T>(a: T) => T'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible.
!!! error TS2755: Type 'string' is not assignable to type '<T>(a: T) => T'.
var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type '<T>(a: T) => T'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible.
!!! error TS2755: Type 'string' is not assignable to type '<T>(a: T) => T'.
var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok?
var r8: IPromise<number>;
@@ -232,7 +270,9 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of
var nPromise: (x: any) => Promise<number>;
var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok
var s8: Promise<number>;
var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error
@@ -249,14 +289,18 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of
var r9: IPromise<number>;
var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok
var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok
var r9d = r9.then(testFunction, sIPromise, nIPromise); // error
~~~~~~~~~
!!! error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
!!! error TS2345: Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
!!! error TS2755: Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
!!! error TS2755: Type 'string' is not assignable to type 'number'.
var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var s9: Promise<number>;
var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error
@@ -282,7 +326,9 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of
var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok
var r10d = r10.then(testFunction, sIPromise, nIPromise); // error
~~~~~~~~~
!!! error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<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
@@ -300,9 +346,11 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of
var r11: IPromise<number>;
var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
!!! error TS2345: Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
!!! error TS2345: Type 'number' is not assignable to type 'string'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
!!! error TS2755: Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
!!! error TS2755: Type 'number' is not assignable to type 'string'.
var s11: Promise<number>;
var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok
~~~~~~~~~~~~~~
@@ -1,29 +1,49 @@
tests/cases/compiler/promisePermutations3.ts(68,69): error TS2345: Argument of type '(x: number) => IPromise<number>' is not assignable to parameter of type '(value: IPromise<number>) => IPromise<number>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'IPromise<number>' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations3.ts(73,70): error TS2345: Argument of type '(x: number) => IPromise<number>' is not assignable to parameter of type '(value: IPromise<number>) => IPromise<number>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'IPromise<number>' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations3.ts(73,70): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number) => IPromise<number>' is not assignable to parameter of type '(value: IPromise<number>) => IPromise<number>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'IPromise<number>' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations3.ts(78,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations3.ts(81,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations3.ts(82,19): error TS2345: Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations3.ts(83,19): error TS2345: Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations3.ts(81,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations3.ts(82,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations3.ts(83,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'x' and 'value' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations3.ts(87,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations3.ts(90,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations3.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
tests/cases/compiler/promisePermutations3.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations3.ts(90,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations3.ts(91,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
tests/cases/compiler/promisePermutations3.ts(92,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations3.ts(96,19): error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations3.ts(99,19): error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations3.ts(100,19): error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
tests/cases/compiler/promisePermutations3.ts(101,19): error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations3.ts(99,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations3.ts(100,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
tests/cases/compiler/promisePermutations3.ts(101,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
tests/cases/compiler/promisePermutations3.ts(105,19): error TS2345: Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
Types of parameters 'cb' and 'value' are incompatible.
Type 'string' is not assignable to type '<T>(a: T) => T'.
@@ -35,36 +55,58 @@ tests/cases/compiler/promisePermutations3.ts(110,19): error TS2345: Argument of
Types of parameters 'cb' and 'value' are incompatible.
Type 'string' is not assignable to type '<T>(a: T) => T'.
tests/cases/compiler/promisePermutations3.ts(116,19): error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations3.ts(119,19): error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations3.ts(120,19): error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
tests/cases/compiler/promisePermutations3.ts(121,19): error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations3.ts(119,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations3.ts(120,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
tests/cases/compiler/promisePermutations3.ts(121,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations3.ts(125,19): error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations3.ts(128,33): error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/promisePermutations3.ts(131,19): error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations3.ts(132,19): error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
tests/cases/compiler/promisePermutations3.ts(133,19): error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations3.ts(136,33): error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
tests/cases/compiler/promisePermutations3.ts(131,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations3.ts(132,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
tests/cases/compiler/promisePermutations3.ts(133,19): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
tests/cases/compiler/promisePermutations3.ts(136,33): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
tests/cases/compiler/promisePermutations3.ts(143,35): error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
tests/cases/compiler/promisePermutations3.ts(151,36): error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => Promise<number>'.
Property 'catch' is missing in type 'IPromise<string>' but required in type 'Promise<number>'.
tests/cases/compiler/promisePermutations3.ts(151,36): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => Promise<number>'.
Property 'catch' is missing in type 'IPromise<string>' but required in type 'Promise<number>'.
tests/cases/compiler/promisePermutations3.ts(155,21): error TS2345: Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/promisePermutations3.ts(157,21): error TS2345: Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
tests/cases/compiler/promisePermutations3.ts(158,21): error TS2345: Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => Promise<string>'.
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/promisePermutations3.ts(159,21): error TS2345: Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
Type 'Promise<number>' is not assignable to type 'IPromise<string>'.
Types of property 'then' are incompatible.
Type '{ <TResult1 = number, TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>; <U>(success?: (value: number) => Promise<U>, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => Promise<U>, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => U, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; }' is not assignable to type '<U>(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise<U>'.
Types of parameters 'onfulfilled' and 'success' are incompatible.
Types of parameters 'value' and 'value' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/promisePermutations3.ts(157,21): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
tests/cases/compiler/promisePermutations3.ts(158,21): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => Promise<string>'.
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/promisePermutations3.ts(159,21): error TS2755: No suitable overload for this call.
The last overload gave the following error.
Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
Type 'Promise<number>' is not assignable to type 'IPromise<string>'.
Types of property 'then' are incompatible.
Type '{ <TResult1 = number, TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>; <U>(success?: (value: number) => Promise<U>, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => Promise<U>, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => U, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; }' is not assignable to type '<U>(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise<U>'.
Types of parameters 'onfulfilled' and 'success' are incompatible.
Types of parameters 'value' and 'value' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of type '{ <T>(x: T): IPromise<T>; <T>(x: T, y: T): Promise<T>; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise<unknown>'.
Property 'catch' is missing in type 'IPromise<any>' but required in type 'Promise<unknown>'.
@@ -148,9 +190,11 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
var s3c = s3.then(testFunction3P, testFunction3, testFunction3);
var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3);
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number) => IPromise<number>' is not assignable to parameter of type '(value: IPromise<number>) => IPromise<number>'.
!!! error TS2345: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2345: Type 'IPromise<number>' is not assignable to type 'number'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number) => IPromise<number>' is not assignable to parameter of type '(value: IPromise<number>) => IPromise<number>'.
!!! error TS2755: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2755: Type 'IPromise<number>' is not assignable to type 'number'.
var r4: IPromise<string>;
var sIPromise: (x: any) => IPromise<string>;
@@ -164,19 +208,25 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
var s4: Promise<string>;
var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2345: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, y?: string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2755: Type 'string' is not assignable to type 'number'.
var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
!!! error TS2345: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
!!! error TS2755: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2755: Type 'string' is not assignable to type 'number'.
var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2345: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, y?: string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: Types of parameters 'x' and 'value' are incompatible.
!!! error TS2755: Type 'string' is not assignable to type 'number'.
var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4);
var r5: IPromise<string>;
@@ -187,13 +237,19 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
var s5: Promise<string>;
var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok
var r6: IPromise<string>;
@@ -204,13 +260,19 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
var s6: Promise<string>;
var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok
var r7: IPromise<string>;
@@ -246,13 +308,19 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
var s8: Promise<number>;
var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok
var r9: IPromise<number>;
@@ -270,19 +338,27 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
var s9: Promise<number>;
var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error
~~~~~~~~~~~~~
!!! error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
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 TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
!!! error TS2345: Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
!!! error TS2755: Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
var r10 = testFunction10(x => x);
@@ -301,8 +377,10 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok
var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error
~~~~~~~~~
!!! error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => Promise<number>'.
!!! error TS2345: Property 'catch' is missing in type 'IPromise<string>' but required in type 'Promise<number>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => Promise<number>'.
!!! error TS2755: Property 'catch' is missing in type 'IPromise<string>' but required in type 'Promise<number>'.
!!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here.
var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok
@@ -315,22 +393,28 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
var s11: Promise<number>;
var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
!!! error TS2345: Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '{ (x: number): IPromise<number>; (x: string): IPromise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
!!! error TS2755: Type 'IPromise<number>' is not assignable to type 'IPromise<string>'.
var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error
~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => Promise<string>'.
!!! error TS2345: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
!!! error TS2345: Type 'number' is not assignable to type 'string'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => Promise<string>'.
!!! error TS2755: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
!!! error TS2755: Type 'number' is not assignable to type 'string'.
var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error
~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
!!! error TS2345: Type 'Promise<number>' is not assignable to type 'IPromise<string>'.
!!! error TS2345: Types of property 'then' are incompatible.
!!! error TS2345: Type '{ <TResult1 = number, TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>; <U>(success?: (value: number) => Promise<U>, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => Promise<U>, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => U, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; }' is not assignable to type '<U>(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise<U>'.
!!! error TS2345: Types of parameters 'onfulfilled' and 'success' are incompatible.
!!! error TS2345: Types of parameters 'value' and 'value' are incompatible.
!!! error TS2345: Type 'number' is not assignable to type 'string'.
!!! error TS2755: No suitable overload for this call.
!!! error TS2755: The last overload gave the following error.
!!! error TS2755: Argument of type '{ (x: number): Promise<number>; (x: string): Promise<string>; }' is not assignable to parameter of type '(value: number) => IPromise<string>'.
!!! error TS2755: Type 'Promise<number>' is not assignable to type 'IPromise<string>'.
!!! error TS2755: Types of property 'then' are incompatible.
!!! error TS2755: Type '{ <TResult1 = number, TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>; <U>(success?: (value: number) => Promise<U>, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => Promise<U>, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => U, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>; <U>(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise<U>; }' is not assignable to type '<U>(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise<U>'.
!!! error TS2755: Types of parameters 'onfulfilled' and 'success' are incompatible.
!!! error TS2755: Types of parameters 'value' and 'value' are incompatible.
!!! error TS2755: Type 'number' is not assignable to type 'string'.
var r12 = testFunction12(x => x);
var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok
@@ -11,7 +11,7 @@ tests/cases/compiler/recursiveFunctionTypes.ts(30,10): error TS2394: This overlo
tests/cases/compiler/recursiveFunctionTypes.ts(33,8): error TS2554: Expected 0-1 arguments, but got 2.
tests/cases/compiler/recursiveFunctionTypes.ts(34,4): error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'.
tests/cases/compiler/recursiveFunctionTypes.ts(42,8): error TS2554: Expected 0-1 arguments, but got 2.
tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'.
tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2755: No suitable overload for this call.
==== tests/cases/compiler/recursiveFunctionTypes.ts (13 errors) ====
@@ -84,6 +84,12 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of
~
!!! error TS2554: Expected 0-1 arguments, but got 2.
f7(""); // ok (function takes an any param)
~~
!!! error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'.
~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/recursiveFunctionTypes.ts:43:4: Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error.
Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'.
!!! related TS2757 tests/cases/compiler/recursiveFunctionTypes.ts:43:4: Overload 2 of 4, '(a: number): number', gave the following error.
Argument of type '""' is not assignable to parameter of type 'number'.
!!! related TS2757 tests/cases/compiler/recursiveFunctionTypes.ts:43:4: Overload 3 of 4, '(a?: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }', gave the following error.
Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'.
f7(); // ok
@@ -1,5 +1,5 @@
tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(7,4): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,4): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(7,1): error TS2755: No suitable overload for this call.
tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2755: No suitable overload for this call.
==== tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts (2 errors) ====
@@ -10,8 +10,20 @@ tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,4): error TS2
}
// both are errors
x3(1, (x: string) => 1);
~
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:7:7: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error.
Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'.
Types of parameters 'x' and 'x' are incompatible.
Type 'number' is not assignable to type 'string'.
!!! related TS2757 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:7:4: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error.
Argument of type '1' is not assignable to parameter of type 'string'.
x3(1, (x: 'hm') => 1);
~
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:8:7: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error.
Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'.
Types of parameters 'x' and 'x' are incompatible.
Type 'number' is not assignable to type '"hm"'.
!!! related TS2757 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:8:4: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error.
Argument of type '1' is not assignable to parameter of type 'string'.
@@ -1,11 +1,11 @@
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(9,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(11,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(11,9): error TS2755: No suitable overload for this call.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,9): error TS2755: No suitable overload for this call.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,9): error TS2755: No suitable overload for this call.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,20): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,9): error TS2755: No suitable overload for this call.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4.
@@ -27,14 +27,26 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var c = foo([], 1, 2); // boolean
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:11:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:11:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var d = foo([], 1, true); // boolean (with error)
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:12:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:12:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var e = foo([], 1, "2"); // {}
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:13:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:13:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var f = foo([], 1, 2, 3); // any (with error)
~
!!! error TS2554: Expected 1-3 arguments, but got 4.
@@ -43,8 +55,12 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
var v = foo `${1}`; // string
var w = foo `${1}${2}`; // boolean
var x = foo `${1}${true}`; // boolean (with error)
~~~~
!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:19:20: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'number'.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:19:20: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'string'.
var y = foo `${1}${"2"}`; // {}
var z = foo `${1}${2}${3}`; // any (with error)
~
@@ -1,11 +1,11 @@
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(9,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,9): error TS2755: No suitable overload for this call.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,9): error TS2755: No suitable overload for this call.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,9): error TS2755: No suitable overload for this call.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,20): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,9): error TS2755: No suitable overload for this call.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4.
@@ -27,14 +27,26 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var c = foo([], 1, 2); // boolean
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:11:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:11:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var d = foo([], 1, true); // boolean (with error)
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:12:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:12:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var e = foo([], 1, "2"); // {}
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:13:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:13:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var f = foo([], 1, 2, 3); // any (with error)
~
!!! error TS2554: Expected 1-3 arguments, but got 4.
@@ -43,8 +55,12 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
var v = foo `${1}`; // string
var w = foo `${1}${2}`; // boolean
var x = foo `${1}${true}`; // boolean (with error)
~~~~
!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:19:20: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'number'.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:19:20: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'string'.
var y = foo `${1}${"2"}`; // {}
var z = foo `${1}${2}${3}`; // any (with error)
~
@@ -1,8 +1,8 @@
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(9,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(9,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(62,9): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,18): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(62,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(69,18): error TS2339: Property 'toFixed' does not exist on type 'string'.
@@ -16,8 +16,12 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
// No candidate overloads found
fn1 `${ {} }`; // Error
~~
!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'.
~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:9:9: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error.
Argument of type '{}' is not assignable to parameter of type 'string'.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:9:9: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error.
Argument of type '{}' is not assignable to parameter of type 'number'.
function fn2(strs: TemplateStringsArray, s: string, n: number): number;
function fn2<T>(strs: TemplateStringsArray, n: number, t: T): T;
@@ -76,11 +80,19 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
// Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints
fn4 `${ true }${ null }`;
~~~~
!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'.
~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:62:9: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'string'.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:62:9: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'number'.
fn4 `${ null }${ true }`;
~~~~
!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:63:18: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'number'.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:63:18: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'string'.
// Non - generic overloads where contextual typing of function arguments has errors
function fn5(strs: TemplateStringsArray, f: (n: string) => void): string;
@@ -1,8 +1,8 @@
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,9): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,18): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(69,18): error TS2551: Property 'toFixed' does not exist on type 'string'. Did you mean 'fixed'?
@@ -16,8 +16,12 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
// No candidate overloads found
fn1 `${ {} }`; // Error
~~
!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'.
~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:9:9: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error.
Argument of type '{}' is not assignable to parameter of type 'string'.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:9:9: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error.
Argument of type '{}' is not assignable to parameter of type 'number'.
function fn2(strs: TemplateStringsArray, s: string, n: number): number;
function fn2<T>(strs: TemplateStringsArray, n: number, t: T): T;
@@ -76,11 +80,19 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
// Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints
fn4 `${ true }${ null }`;
~~~~
!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'.
~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:62:9: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'string'.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:62:9: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'number'.
fn4 `${ null }${ true }`;
~~~~
!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:63:18: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'number'.
!!! related TS2757 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:63:18: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'string'.
// Non - generic overloads where contextual typing of function arguments has errors
function fn5(strs: TemplateStringsArray, f: (n: string) => void): string;
@@ -1,6 +1,6 @@
tests/cases/conformance/jsx/file.tsx(11,2): error TS2322: Type '{}' is not assignable to type 'number'.
tests/cases/conformance/jsx/file.tsx(18,2): error TS2322: Type '{}' is not assignable to type 'number'.
tests/cases/conformance/jsx/file.tsx(25,2): error TS2322: Type '{ x: number; }' is not assignable to type 'number'.
tests/cases/conformance/jsx/file.tsx(11,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/jsx/file.tsx(18,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No suitable overload for this call.
==== tests/cases/conformance/jsx/file.tsx (3 errors) ====
@@ -15,8 +15,12 @@ tests/cases/conformance/jsx/file.tsx(25,2): error TS2322: Type '{ x: number; }'
}
var Obj1: Obj1;
<Obj1 />; // Error, return type is not an object type
~~~~
!!! error TS2322: Type '{}' is not assignable to type 'number'.
~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/jsx/file.tsx:11:2: Overload 1 of 2, '(n: string): { x: number; }', gave the following error.
Type '{}' is not assignable to type 'string'.
!!! related TS2757 tests/cases/conformance/jsx/file.tsx:11:2: Overload 2 of 2, '(n: number): { y: string; }', gave the following error.
Type '{}' is not assignable to type 'number'.
interface Obj2 {
(n: string): { x: number };
@@ -24,8 +28,12 @@ tests/cases/conformance/jsx/file.tsx(25,2): error TS2322: Type '{ x: number; }'
}
var Obj2: Obj2;
<Obj2 />; // Error, return type is not an object type
~~~~
!!! error TS2322: Type '{}' is not assignable to type 'number'.
~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/jsx/file.tsx:18:2: Overload 1 of 2, '(n: string): { x: number; }', gave the following error.
Type '{}' is not assignable to type 'string'.
!!! related TS2757 tests/cases/conformance/jsx/file.tsx:18:2: Overload 2 of 2, '(n: number): { y: string; }', gave the following error.
Type '{}' is not assignable to type 'number'.
interface Obj3 {
(n: string): { x: number };
@@ -33,6 +41,10 @@ tests/cases/conformance/jsx/file.tsx(25,2): error TS2322: Type '{ x: number; }'
}
var Obj3: Obj3;
<Obj3 x={42} />; // OK
~~~~
!!! error TS2322: Type '{ x: number; }' is not assignable to type 'number'.
~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/jsx/file.tsx:25:2: Overload 1 of 2, '(n: string): { x: number; }', gave the following error.
Type '{ x: number; }' is not assignable to type 'string'.
!!! related TS2757 tests/cases/conformance/jsx/file.tsx:25:2: Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error.
Type '{ x: number; }' is not assignable to type 'number'.
@@ -1,6 +1,6 @@
tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(14,14): error TS2322: Type '{}' is not assignable to type 'P'.
'{}' is assignable to the constraint of type 'P', but 'P' could be instantiated with a different subtype of constraint '{}'.
tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,14): error TS2322: Type '{}' is not assignable to type 'Readonly<P>'.
tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2755: No suitable overload for this call.
==== tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx (2 errors) ====
@@ -22,8 +22,12 @@ tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,14): error TS2322: Type
!!! error TS2322: Type '{}' is not assignable to type 'P'.
!!! error TS2322: '{}' is assignable to the constraint of type 'P', but 'P' could be instantiated with a different subtype of constraint '{}'.
let y = <MyComponent />; // should error
~~~~~~~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'Readonly<P>'.
~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx:15:14: Overload 1 of 2, '(props: Readonly<P>): MyComponent', gave the following error.
Type '{}' is not assignable to type 'Readonly<P>'.
!!! related TS2757 tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx:15:14: Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error.
Type '{}' is not assignable to type 'Readonly<P>'.
let z = <MySFC {...wrappedProps} /> // should work
let q = <MyComponent {...wrappedProps} /> // should work
@@ -1,5 +1,4 @@
tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,7): error TS2345: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary<unknown>'.
Index signature is missing in type '(string | number | boolean)[]'.
tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2755: No suitable overload for this call.
==== tests/cases/compiler/underscoreTest1_underscoreTests.ts (1 errors) ====
@@ -29,9 +28,15 @@ tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,7): error TS2345: Arg
var odds = _.reject([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0);
_.all([true, 1, null, 'yes'], _.identity);
~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary<unknown>'.
!!! error TS2345: Index signature is missing in type '(string | number | boolean)[]'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/compiler/underscoreTest1_underscoreTests.ts:26:31: Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_<string | number | boolean, boolean>, context?: any): boolean', gave the following error.
Argument of type '<T>(value: T) => T' is not assignable to parameter of type 'Iterator_<string | number | boolean, boolean>'.
Type 'string | number | boolean' is not assignable to type 'boolean'.
Type 'string' is not assignable to type 'boolean'.
!!! related TS2757 tests/cases/compiler/underscoreTest1_underscoreTests.ts:26:7: Overload 2 of 2, '(list: Dictionary<unknown>, iterator?: Iterator_<unknown, boolean>, context?: any): boolean', gave the following error.
Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary<unknown>'.
Index signature is missing in type '(string | number | boolean)[]'.
_.any([null, 0, 'yes', false]);
@@ -1,6 +1,6 @@
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(9,43): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(10,29): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,29): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(10,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(16,1): error TS2554: Expected 1 arguments, but got 0.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(19,32): error TS2345: Argument of type '10' is not assignable to parameter of type 'never'.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(20,32): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'never'.
@@ -40,15 +40,23 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2
~~~~~~~
!!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
unionOfDifferentReturnType1(true); // error in type of parameter
~~~~
!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:10:29: Overload 1 of 2, '(a: number): number | Date', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'number'.
!!! related TS2757 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:10:29: Overload 2 of 2, '(a: string): string | boolean', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'string'.
var unionOfDifferentReturnType1: { (a: number): number; (a: string): string; } | { (a: number): Date; (a: string): boolean; };
numOrDate = unionOfDifferentReturnType1(10);
strOrBoolean = unionOfDifferentReturnType1("hello");
unionOfDifferentReturnType1(true); // error in type of parameter
~~~~
!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:15:29: Overload 1 of 2, '(a: number): number | Date', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'number'.
!!! related TS2757 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:15:29: Overload 2 of 2, '(a: string): string | boolean', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'string'.
unionOfDifferentReturnType1(); // error missing parameter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2554: Expected 1 arguments, but got 0.
@@ -1,6 +1,6 @@
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(9,47): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(10,33): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(15,33): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(10,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(15,1): error TS2755: No suitable overload for this call.
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(16,1): error TS2554: Expected 1 arguments, but got 0.
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(19,36): error TS2345: Argument of type '10' is not assignable to parameter of type 'never'.
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(20,36): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'never'.
@@ -39,15 +39,23 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro
~~~~~~~
!!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
new unionOfDifferentReturnType1(true); // error in type of parameter
~~~~
!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:10:33: Overload 1 of 2, '(a: number): number | Date', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'number'.
!!! related TS2757 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:10:33: Overload 2 of 2, '(a: string): string | boolean', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'string'.
var unionOfDifferentReturnType1: { new (a: number): number; new (a: string): string; } | { new (a: number): Date; new (a: string): boolean; };
numOrDate = new unionOfDifferentReturnType1(10);
strOrBoolean = new unionOfDifferentReturnType1("hello");
new unionOfDifferentReturnType1(true); // error in type of parameter
~~~~
!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2755: No suitable overload for this call.
!!! related TS2757 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:15:33: Overload 1 of 2, '(a: number): number | Date', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'number'.
!!! related TS2757 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:15:33: Overload 2 of 2, '(a: string): string | boolean', gave the following error.
Argument of type 'true' is not assignable to parameter of type 'string'.
new unionOfDifferentReturnType1(); // error missing parameter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2554: Expected 1 arguments, but got 0.