From c65d9f261afa22588ca3f232c98978eee1f82210 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 18 Jun 2019 08:30:18 -0700 Subject: [PATCH 01/26] Initial attempt. Totally doesn't work. --- src/compiler/checker.ts | 23 ++++++++++++++--------- src/compiler/diagnosticMessages.json | 4 ++++ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a4ad3af7d9a..77025cd9843 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21439,7 +21439,7 @@ namespace ts { // function foo(): void; // foo(0); // - let candidateForArgumentError: Signature | undefined; + let candidatesForArgumentError: Signature[] | undefined; let candidateForArgumentArityError: Signature | undefined; let candidateForTypeArgumentError: Signature | undefined; let result: Signature | undefined; @@ -21474,8 +21474,13 @@ namespace ts { // If candidate is undefined, it means that no candidates had a suitable arity. In that case, // skip the checkApplicableSignature check. if (reportErrors) { - if (candidateForArgumentError) { - checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, CheckMode.Normal, /*reportErrors*/ true); + if (candidatesForArgumentError) { + createDiagnosticForNodeFromMessageChain // is what I really want to call + chainDiagnosticMessages(chain, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); + diagnostics.add(createDiagnosticForNode(node, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call)); + for (const c of candidatesForArgumentError) { + checkApplicableSignature(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true); + } } else if (candidateForArgumentArityError) { diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args)); @@ -21500,7 +21505,7 @@ namespace ts { return produceDiagnostics || !args ? resolveErrorCall(node) : getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray); function chooseOverload(candidates: Signature[], relation: Map, signatureHelpTrailingComma = false) { - candidateForArgumentError = undefined; + candidatesForArgumentError = undefined; candidateForArgumentArityError = undefined; candidateForTypeArgumentError = undefined; @@ -21510,7 +21515,7 @@ namespace ts { return undefined; } if (!checkApplicableSignature(node, args, candidate, relation, CheckMode.Normal, /*reportErrors*/ false)) { - candidateForArgumentError = candidate; + candidatesForArgumentError = [candidate]; return undefined; } return candidate; @@ -21552,8 +21557,8 @@ namespace ts { } if (!checkApplicableSignature(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false)) { // Give preference to error candidates that have no rest parameters (as they are more specific) - if (!candidateForArgumentError || getEffectiveRestType(candidateForArgumentError) || !getEffectiveRestType(checkCandidate)) { - candidateForArgumentError = checkCandidate; + if (getMinArgumentCount(checkCandidate) <= args.length && args.length <= getParameterCount(checkCandidate)) { + (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); } continue; } @@ -21574,8 +21579,8 @@ namespace ts { } if (!checkApplicableSignature(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false)) { // Give preference to error candidates that have no rest parameters (as they are more specific) - if (!candidateForArgumentError || getEffectiveRestType(candidateForArgumentError) || !getEffectiveRestType(checkCandidate)) { - candidateForArgumentError = checkCandidate; + if (getMinArgumentCount(checkCandidate) <= args.length && args.length <= getParameterCount(checkCandidate)) { + (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); } continue; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index b209a878804..6393ddd596e 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2621,6 +2621,10 @@ "category": "Error", "code": 2754 }, + "Failed to find a suitable overload for this call.": { + "category": "Error", + "code": 2755 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", From beddf9c02d1a522f5131c89a1bc39ee73a98e257 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 18 Jun 2019 10:12:32 -0700 Subject: [PATCH 02/26] Working, just not the way I would like There are still separate errors instead of one + related spans for each sub-error. --- src/compiler/checker.ts | 24 +++++++++++++++--------- src/compiler/diagnosticMessages.json | 4 ++++ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 77025cd9843..0d2f1d11813 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21108,8 +21108,11 @@ namespace ts { signature: Signature, relation: Map, checkMode: CheckMode, - reportErrors: boolean) { + reportErrors: boolean, + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined + ) { if (isJsxOpeningLikeElement(node)) { + // TODO: Maybe containingMessageChain too? return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors); } const thisType = getThisTypeOfSignature(signature); @@ -21137,7 +21140,7 @@ namespace ts { // we obtain the regular type of any object literal arguments because we may not have inferred complete // parameter types yet and therefore excess property checks may yield false positives (see #17041). const checkArgType = checkMode & CheckMode.SkipContextSensitive ? getRegularTypeOfObjectLiteral(argType) : argType; - if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage)) { + if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain)) { return false; } } @@ -21475,11 +21478,14 @@ namespace ts { // skip the checkApplicableSignature check. if (reportErrors) { if (candidatesForArgumentError) { - createDiagnosticForNodeFromMessageChain // is what I really want to call - chainDiagnosticMessages(chain, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); - diagnostics.add(createDiagnosticForNode(node, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call)); + // const related: DiagnosticRelatedInformation[] = []; for (const c of candidatesForArgumentError) { - checkApplicableSignature(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true); + const chain = chainDiagnosticMessages(chainDiagnosticMessages(undefined, Diagnostics.Overload_0_gave_the_following_error, signatureToString(c)), Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); + checkApplicableSignature(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + // related.push(argNode) + // This is not right; I want them to be siblings + // probably this is a new feature :( + // chain = chainDiagnosticMessages(chain, msg); } } else if (candidateForArgumentArityError) { @@ -21514,7 +21520,7 @@ namespace ts { if (typeArguments || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma)) { return undefined; } - if (!checkApplicableSignature(node, args, candidate, relation, CheckMode.Normal, /*reportErrors*/ false)) { + if (!checkApplicableSignature(node, args, candidate, relation, CheckMode.Normal, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { candidatesForArgumentError = [candidate]; return undefined; } @@ -21555,7 +21561,7 @@ namespace ts { else { checkCandidate = candidate; } - if (!checkApplicableSignature(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false)) { + if (!checkApplicableSignature(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { // Give preference to error candidates that have no rest parameters (as they are more specific) if (getMinArgumentCount(checkCandidate) <= args.length && args.length <= getParameterCount(checkCandidate)) { (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); @@ -21577,7 +21583,7 @@ namespace ts { continue; } } - if (!checkApplicableSignature(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false)) { + if (!checkApplicableSignature(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { // Give preference to error candidates that have no rest parameters (as they are more specific) if (getMinArgumentCount(checkCandidate) <= args.length && args.length <= getParameterCount(checkCandidate)) { (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 6393ddd596e..03d366a7232 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2625,6 +2625,10 @@ "category": "Error", "code": 2755 }, + "Overload '{0}' gave the following error.": { + "category": "Error", + "code": 2756 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", From caff266f5e9ced5b3290c4d5f6d54bb169da84fd Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 18 Jun 2019 10:52:03 -0700 Subject: [PATCH 03/26] Notes on how to return errors from checkTypeRelatedTo --- src/compiler/checker.ts | 58 ++++++++++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 0d2f1d11813..912306ef156 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -12341,7 +12341,26 @@ namespace ts { return getObjectFlags(source) & ObjectFlags.JsxAttributes && !isUnhyphenatedJsxName(sourceProp.escapedName); } - /** + function checkTypeRelatedTo( + source: Type, + target: Type, + relation: Map, + errorNode: Node | undefined, + headMessage?: DiagnosticMessage, + containingMessageChain?: () => DiagnosticMessageChain | undefined, + errorOutputContainer?: { error?: Diagnostic }, + ): boolean; + function checkTypeRelatedTo( + source: Type, + target: Type, + relation: Map, + errorNode: Node | undefined, + headMessage?: DiagnosticMessage, + containingMessageChain?: () => DiagnosticMessageChain | undefined, + errorOutputContainer?: { error?: Diagnostic }, + breakdown?: boolean + ): [Node, DiagnosticMessageChain]; + /** * Checks if 'source' is related to 'target' (e.g.: is a assignable to). * @param source The left-hand-side of the relation. * @param target The right-hand-side of the relation. @@ -12358,9 +12377,9 @@ namespace ts { errorNode: Node | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, - errorOutputContainer?: { error?: Diagnostic } - ): boolean { - + errorOutputContainer?: { error?: Diagnostic }, + breakdown?: boolean + ): boolean | [Node, DiagnosticMessageChain] { let errorInfo: DiagnosticMessageChain | undefined; let relatedInfo: [DiagnosticRelatedInformation, ...DiagnosticRelatedInformation[]] | undefined; let maybeKeys: string[]; @@ -12399,7 +12418,9 @@ namespace ts { } } } - + if (breakdown) { + return [errorNode!, errorInfo]; + } const diag = createDiagnosticForNodeFromMessageChain(errorNode!, errorInfo, relatedInformation); if (relatedInfo) { addRelatedInfo(diag, ...relatedInfo); @@ -12409,6 +12430,7 @@ namespace ts { } diagnostics.add(diag); // TODO: GH#18217 } + Debug.assert(!breakdown); return result !== Ternary.False; function reportError(message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): void { @@ -21102,6 +21124,9 @@ namespace ts { return checkTypeRelatedToAndOptionallyElaborate(attributesType, paramType, relation, reportErrors ? node.tagName : undefined, node.attributes); } + // TODO: This function is only used in overload resolution; it should instead return a [errorNode, messageChain] pair if there is a failure and undefined if not + // The first-round callers can used undefined=pass and the second-round callers can build their own errors from the pair. + // TODO: Still need to thread BREAKDOWN through checkTypeRealtedToAndOptionallyElaborate and all other checkType calls function checkApplicableSignature( node: CallLikeExpression, args: ReadonlyArray, @@ -21109,7 +21134,7 @@ namespace ts { relation: Map, checkMode: CheckMode, reportErrors: boolean, - containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, ) { if (isJsxOpeningLikeElement(node)) { // TODO: Maybe containingMessageChain too? @@ -21478,14 +21503,21 @@ namespace ts { // skip the checkApplicableSignature check. if (reportErrors) { if (candidatesForArgumentError) { - // const related: DiagnosticRelatedInformation[] = []; - for (const c of candidatesForArgumentError) { - const chain = chainDiagnosticMessages(chainDiagnosticMessages(undefined, Diagnostics.Overload_0_gave_the_following_error, signatureToString(c)), Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); + if (candidatesForArgumentError.length > 3) { + const c = candidatesForArgumentError[candidatesForArgumentError.length - 1]; + const chain = chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); checkApplicableSignature(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); - // related.push(argNode) - // This is not right; I want them to be siblings - // probably this is a new feature :( - // chain = chainDiagnosticMessages(chain, msg); + } + else { + // const related: DiagnosticRelatedInformation[] = []; + for (const c of candidatesForArgumentError) { + const chain = chainDiagnosticMessages(chainDiagnosticMessages(undefined, Diagnostics.Overload_0_gave_the_following_error, signatureToString(c)), Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); + const [errorNode, msg] = checkApplicableSignature(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + // related.push(argNode) + // This is not right; I want them to be siblings + // probably this is a new feature :( + // chain = chainDiagnosticMessages(chain, msg); + } } } else if (candidateForArgumentArityError) { From 1f6ef0504b4024e819a349a469025bbebf104e1a Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 19 Jun 2019 14:54:38 -0700 Subject: [PATCH 04/26] Re-add multiple errors In the worst possible way. Now it's sort of ready for creating a DiagnosticMessageTree. --- src/compiler/checker.ts | 45 ++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 912306ef156..861f32df0ac 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11671,12 +11671,14 @@ namespace ts { return checkTypeRelatedToAndOptionallyElaborate(source, target, assignableRelation, errorNode, expr, headMessage, containingMessageChain); } - function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined): boolean { - if (isTypeRelatedTo(source, target, relation)) return true; + function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined): boolean; + function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): [Node, DiagnosticMessageChain]; + function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): boolean | [Node, DiagnosticMessageChain] { + if (isTypeRelatedTo(source, target, relation)) return breakdown ? false : true; if (!errorNode || !elaborateError(expr, source, target, relation, headMessage)) { - return checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain); + return checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, undefined, breakdown); } - return false; + return breakdown ? [undefined!,undefined!] as [Node, DiagnosticMessageChain] : false; } function isOrHasGenericConditional(type: Type): boolean { @@ -12430,7 +12432,10 @@ namespace ts { } diagnostics.add(diag); // TODO: GH#18217 } - Debug.assert(!breakdown); + if (breakdown) { + Debug.assert(result === Ternary.False ? !errorNode : true, "missed opportunity to interact with error."); + return result === Ternary.False ? [undefined!, undefined!] as [Node, DiagnosticMessageChain] : false; + } return result !== Ternary.False; function reportError(message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): void { @@ -21121,13 +21126,13 @@ namespace ts { // 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); + return checkTypeRelatedToAndOptionallyElaborate(attributesType, paramType, relation, reportErrors ? node.tagName : undefined, node.attributes, undefined, undefined, /*breakdown*/ true); } // TODO: This function is only used in overload resolution; it should instead return a [errorNode, messageChain] pair if there is a failure and undefined if not // The first-round callers can used undefined=pass and the second-round callers can build their own errors from the pair. // TODO: Still need to thread BREAKDOWN through checkTypeRealtedToAndOptionallyElaborate and all other checkType calls - function checkApplicableSignature( + function getSignatureApplicabilityError( node: CallLikeExpression, args: ReadonlyArray, signature: Signature, @@ -21149,8 +21154,9 @@ 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; - if (!checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage)) { - return false; + const r = checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage, undefined, undefined, /*breakdown*/ true); + if (r) { + return r; } } const headMessage = Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1; @@ -21165,17 +21171,18 @@ namespace ts { // we obtain the regular type of any object literal arguments because we may not have inferred complete // parameter types yet and therefore excess property checks may yield false positives (see #17041). const checkArgType = checkMode & CheckMode.SkipContextSensitive ? getRegularTypeOfObjectLiteral(argType) : argType; - if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain)) { - return false; + const r = checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain, /*breakdown*/ true); + if (r) { + return r; } } } if (restType) { const spreadType = getSpreadArgumentType(args, argCount, args.length, restType, /*context*/ undefined); const errorNode = reportErrors ? argCount < args.length ? args[argCount] : node : undefined; - return checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage); + return checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, undefined, undefined, /*breakdown*/ true); } - return true; + return undefined; } /** @@ -21506,13 +21513,15 @@ namespace ts { if (candidatesForArgumentError.length > 3) { const c = candidatesForArgumentError[candidatesForArgumentError.length - 1]; const chain = chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); - checkApplicableSignature(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); } else { // const related: DiagnosticRelatedInformation[] = []; for (const c of candidatesForArgumentError) { const chain = chainDiagnosticMessages(chainDiagnosticMessages(undefined, Diagnostics.Overload_0_gave_the_following_error, signatureToString(c)), Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); - const [errorNode, msg] = checkApplicableSignature(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + const r = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + if (!r || !r[0]) continue; // TODO:assert! + diagnostics.add(createDiagnosticForNodeFromMessageChain(r[0], r[1], /*relatedInformation*/ undefined)); // related.push(argNode) // This is not right; I want them to be siblings // probably this is a new feature :( @@ -21552,7 +21561,7 @@ namespace ts { if (typeArguments || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma)) { return undefined; } - if (!checkApplicableSignature(node, args, candidate, relation, CheckMode.Normal, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { + if (getSignatureApplicabilityError(node, args, candidate, relation, CheckMode.Normal, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { candidatesForArgumentError = [candidate]; return undefined; } @@ -21593,7 +21602,7 @@ namespace ts { else { checkCandidate = candidate; } - if (!checkApplicableSignature(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { + if (getSignatureApplicabilityError(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { // Give preference to error candidates that have no rest parameters (as they are more specific) if (getMinArgumentCount(checkCandidate) <= args.length && args.length <= getParameterCount(checkCandidate)) { (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); @@ -21615,7 +21624,7 @@ namespace ts { continue; } } - if (!checkApplicableSignature(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { + if (getSignatureApplicabilityError(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { // Give preference to error candidates that have no rest parameters (as they are more specific) if (getMinArgumentCount(checkCandidate) <= args.length && args.length <= getParameterCount(checkCandidate)) { (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); From afecb87d3f106bc8a3f116e1a85aed0d281e4795 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 20 Jun 2019 08:54:31 -0700 Subject: [PATCH 05/26] Use related spans to form a tree of errors. Formatting is wrong, and I might want to format it as non-related spans, but the structure is exactly a tree. --- src/compiler/checker.ts | 29 ++++++++++++---------------- src/compiler/diagnosticMessages.json | 2 +- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 861f32df0ac..bad283bb1c7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11672,7 +11672,7 @@ namespace ts { } function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined): boolean; - function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): [Node, DiagnosticMessageChain]; + function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): [Node, DiagnosticMessageChain] | false; function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): boolean | [Node, DiagnosticMessageChain] { if (isTypeRelatedTo(source, target, relation)) return breakdown ? false : true; if (!errorNode || !elaborateError(expr, source, target, relation, headMessage)) { @@ -12361,7 +12361,7 @@ namespace ts { containingMessageChain?: () => DiagnosticMessageChain | undefined, errorOutputContainer?: { error?: Diagnostic }, breakdown?: boolean - ): [Node, DiagnosticMessageChain]; + ): false | [Node, DiagnosticMessageChain]; /** * Checks if 'source' is related to 'target' (e.g.: is a assignable to). * @param source The left-hand-side of the relation. @@ -21512,21 +21512,20 @@ namespace ts { if (candidatesForArgumentError) { if (candidatesForArgumentError.length > 3) { const c = candidatesForArgumentError[candidatesForArgumentError.length - 1]; - const chain = chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); + const chain = chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call_from_the_0_closest_overloads, candidatesForArgumentError.length); + getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); } else { - // const related: DiagnosticRelatedInformation[] = []; - for (const c of candidatesForArgumentError) { - const chain = chainDiagnosticMessages(chainDiagnosticMessages(undefined, Diagnostics.Overload_0_gave_the_following_error, signatureToString(c)), Diagnostics.Failed_to_find_a_suitable_overload_for_this_call); + const related: DiagnosticRelatedInformation[] = []; + const close = candidatesForArgumentError.filter(c => getMinArgumentCount(c) <= args.length && args.length <= getParameterCount(c)); + for (const c of close) { + const chain = chainDiagnosticMessages(undefined, Diagnostics.Overload_0_gave_the_following_error, signatureToString(c)); const r = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); if (!r || !r[0]) continue; // TODO:assert! - diagnostics.add(createDiagnosticForNodeFromMessageChain(r[0], r[1], /*relatedInformation*/ undefined)); - // related.push(argNode) - // This is not right; I want them to be siblings - // probably this is a new feature :( - // chain = chainDiagnosticMessages(chain, msg); + related.push(createDiagnosticForNodeFromMessageChain(r[0], r[1])); } + diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call_from_the_0_closest_overloads, close.length), related)); } } else if (candidateForArgumentArityError) { @@ -21604,9 +21603,7 @@ namespace ts { } if (getSignatureApplicabilityError(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { // Give preference to error candidates that have no rest parameters (as they are more specific) - if (getMinArgumentCount(checkCandidate) <= args.length && args.length <= getParameterCount(checkCandidate)) { - (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); - } + (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); continue; } if (argCheckMode) { @@ -21626,9 +21623,7 @@ namespace ts { } if (getSignatureApplicabilityError(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) { // Give preference to error candidates that have no rest parameters (as they are more specific) - if (getMinArgumentCount(checkCandidate) <= args.length && args.length <= getParameterCount(checkCandidate)) { - (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); - } + (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); continue; } } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index dd88b0029a0..baa0a5fa14e 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2621,7 +2621,7 @@ "category": "Error", "code": 2754 }, - "Failed to find a suitable overload for this call.": { + "Failed to find a suitable overload for this call from the {0} closest overloads.": { "category": "Error", "code": 2755 }, From ef0a8759bd66c10df53b0c0a76c33eadf62462fb Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 20 Jun 2019 15:40:29 -0700 Subject: [PATCH 06/26] Share code a bit better --- src/compiler/checker.ts | 28 ++++++++++++++++++---------- src/compiler/diagnosticMessages.json | 8 ++++++-- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index bad283bb1c7..a177fd3522b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21510,22 +21510,30 @@ namespace ts { // skip the checkApplicableSignature check. if (reportErrors) { if (candidatesForArgumentError) { - if (candidatesForArgumentError.length > 3) { - const c = candidatesForArgumentError[candidatesForArgumentError.length - 1]; - const chain = chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call_from_the_0_closest_overloads, candidatesForArgumentError.length); - - getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + if (candidatesForArgumentError.length === 1 || candidatesForArgumentError.length > 3) { + const last = candidatesForArgumentError[candidatesForArgumentError.length - 1]; + 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); + } + const r = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + Debug.assert(!!r && !!r[0]); + if (r) { + diagnostics.add(createDiagnosticForNodeFromMessageChain(r[0], r[1], undefined)); + } } else { const related: DiagnosticRelatedInformation[] = []; - const close = candidatesForArgumentError.filter(c => getMinArgumentCount(c) <= args.length && args.length <= getParameterCount(c)); - for (const c of close) { + for (const c of candidatesForArgumentError) { const chain = chainDiagnosticMessages(undefined, Diagnostics.Overload_0_gave_the_following_error, signatureToString(c)); const r = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); - if (!r || !r[0]) continue; // TODO:assert! - related.push(createDiagnosticForNodeFromMessageChain(r[0], r[1])); + Debug.assert(!!r && !!r[0]); + if (r) { + related.push(createDiagnosticForNodeFromMessageChain(r[0], r[1])); + } } - diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call_from_the_0_closest_overloads, close.length), related)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call_from_0_overloads, candidatesForArgumentError.length), related)); } } else if (candidateForArgumentArityError) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index baa0a5fa14e..b2ba98c5868 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2621,14 +2621,18 @@ "category": "Error", "code": 2754 }, - "Failed to find a suitable overload for this call from the {0} closest overloads.": { + "Failed to find a suitable overload for this call from {0} overloads.": { "category": "Error", "code": 2755 }, - "Overload '{0}' gave the following error.": { + "The last overload gave the following error.": { "category": "Error", "code": 2756 }, + "Overload '{0}' gave the following error.": { + "category": "Error", + "code": 2757 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", From b85796cba0a78e7d5ec07603298305f55524d388 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 20 Jun 2019 16:13:08 -0700 Subject: [PATCH 07/26] Retain related info for 1-overloads --- src/compiler/checker.ts | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a177fd3522b..f8de982e02a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11672,8 +11672,8 @@ namespace ts { } function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined): boolean; - function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): [Node, DiagnosticMessageChain] | false; - function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): boolean | [Node, DiagnosticMessageChain] { + function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): [Node, DiagnosticMessageChain, DiagnosticRelatedInformation[]?] | false; + function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): boolean | [Node, DiagnosticMessageChain, DiagnosticRelatedInformation[]?] { if (isTypeRelatedTo(source, target, relation)) return breakdown ? false : true; if (!errorNode || !elaborateError(expr, source, target, relation, headMessage)) { return checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, undefined, breakdown); @@ -12361,7 +12361,7 @@ namespace ts { containingMessageChain?: () => DiagnosticMessageChain | undefined, errorOutputContainer?: { error?: Diagnostic }, breakdown?: boolean - ): false | [Node, DiagnosticMessageChain]; + ): false | [Node, DiagnosticMessageChain, DiagnosticRelatedInformation[]?]; /** * Checks if 'source' is related to 'target' (e.g.: is a assignable to). * @param source The left-hand-side of the relation. @@ -12381,7 +12381,7 @@ namespace ts { containingMessageChain?: () => DiagnosticMessageChain | undefined, errorOutputContainer?: { error?: Diagnostic }, breakdown?: boolean - ): boolean | [Node, DiagnosticMessageChain] { + ): boolean | [Node, DiagnosticMessageChain, DiagnosticRelatedInformation[]?] { let errorInfo: DiagnosticMessageChain | undefined; let relatedInfo: [DiagnosticRelatedInformation, ...DiagnosticRelatedInformation[]] | undefined; let maybeKeys: string[]; @@ -12421,7 +12421,7 @@ namespace ts { } } if (breakdown) { - return [errorNode!, errorInfo]; + return [errorNode!, errorInfo, relatedInfo ? [...(relatedInformation || []), ...relatedInfo]: relatedInformation]; } const diag = createDiagnosticForNodeFromMessageChain(errorNode!, errorInfo, relatedInformation); if (relatedInfo) { @@ -21129,9 +21129,6 @@ namespace ts { return checkTypeRelatedToAndOptionallyElaborate(attributesType, paramType, relation, reportErrors ? node.tagName : undefined, node.attributes, undefined, undefined, /*breakdown*/ true); } - // TODO: This function is only used in overload resolution; it should instead return a [errorNode, messageChain] pair if there is a failure and undefined if not - // The first-round callers can used undefined=pass and the second-round callers can build their own errors from the pair. - // TODO: Still need to thread BREAKDOWN through checkTypeRealtedToAndOptionallyElaborate and all other checkType calls function getSignatureApplicabilityError( node: CallLikeExpression, args: ReadonlyArray, @@ -21518,9 +21515,9 @@ namespace ts { chain = chainDiagnosticMessages(chain, Diagnostics.Failed_to_find_a_suitable_overload_for_this_call_from_0_overloads, candidatesForArgumentError.length); } const r = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); - Debug.assert(!!r && !!r[0]); + Debug.assert(!!r && !!r[0], "No error for last signature"); if (r) { - diagnostics.add(createDiagnosticForNodeFromMessageChain(r[0], r[1], undefined)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(...r)); } } else { @@ -21528,9 +21525,9 @@ namespace ts { for (const c of candidatesForArgumentError) { const chain = chainDiagnosticMessages(undefined, Diagnostics.Overload_0_gave_the_following_error, signatureToString(c)); const r = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); - Debug.assert(!!r && !!r[0]); + Debug.assert(!!r && !!r[0], "No error for signature (1)"); if (r) { - related.push(createDiagnosticForNodeFromMessageChain(r[0], r[1])); + 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)); From 720ad5bf2244bffcdae9ae29a0cb7c489856b832 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 21 Jun 2019 13:15:32 -0700 Subject: [PATCH 08/26] Improve error message and update baselines --- src/compiler/checker.ts | 24 +- src/compiler/diagnosticMessages.json | 4 +- .../reference/bigintWithLib.errors.txt | 37 +- .../checkJsxChildrenCanBeTupleType.errors.txt | 24 +- .../constructorOverloads1.errors.txt | 20 +- ...StringLiteralsInJsxAttributes02.errors.txt | 56 ++- ...TypedStringLiteralsInJsxAttributes02.types | 8 +- .../controlFlowIterationErrors.errors.txt | 28 +- .../reference/functionOverloads2.errors.txt | 10 +- ...edMethodWithOverloadedArguments.errors.txt | 54 ++- .../reference/incompatibleTypes.errors.txt | 36 +- ...ritedConstructorWithRestParams2.errors.txt | 20 +- .../iteratorSpreadInArray6.errors.txt | 25 +- ...attersForSignatureGroupIdentity.errors.txt | 28 +- .../baselines/reference/overload1.errors.txt | 10 +- .../reference/overloadResolution.errors.txt | 30 +- ...loadResolutionClassConstructors.errors.txt | 10 +- .../overloadResolutionConstructors.errors.txt | 30 +- .../overloadingOnConstants2.errors.txt | 10 +- ...nWithConstraintCheckingDeferred.errors.txt | 25 +- .../reference/promisePermutations.errors.txt | 388 ++++++++++++------ .../reference/promisePermutations2.errors.txt | 144 ++++--- .../reference/promisePermutations3.errors.txt | 244 +++++++---- .../recursiveFunctionTypes.errors.txt | 12 +- ...edSignatureAsCallbackParameter1.errors.txt | 24 +- ...eStringsWithOverloadResolution1.errors.txt | 40 +- ...ingsWithOverloadResolution1_ES6.errors.txt | 40 +- ...eStringsWithOverloadResolution3.errors.txt | 30 +- ...ingsWithOverloadResolution3_ES6.errors.txt | 30 +- .../tsxElementResolution9.errors.txt | 30 +- .../tsxNotUsingApparentTypeOfSFC.errors.txt | 10 +- .../reference/underscoreTest1.errors.txt | 15 +- .../unionTypeCallSignatures.errors.txt | 20 +- .../unionTypeConstructSignatures.errors.txt | 20 +- 34 files changed, 1027 insertions(+), 509 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f8de982e02a..614eaeab71f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -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, checkMode: CheckMode, reportErrors: boolean) { + function checkApplicableSignatureForJsxOpeningLikeElement( + node: JsxOpeningLikeElement, + signature: Signature, + relation: Map, + 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) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index b2ba98c5868..9ce753766a6 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -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 }, diff --git a/tests/baselines/reference/bigintWithLib.errors.txt b/tests/baselines/reference/bigintWithLib.errors.txt index 993f43d5a05..c716a1dda26 100644 --- a/tests/baselines/reference/bigintWithLib.errors.txt +++ b/tests/baselines/reference/bigintWithLib.errors.txt @@ -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): BigInt64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '() => IterableIterator' is not assignable to type '() => Iterator'. + Type 'IterableIterator' is not assignable to type 'Iterator'. + Types of property 'next' are incompatible. + Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. + Type 'IteratorResult' is not assignable to type 'IteratorResult'. + 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): BigUint64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. +!!! 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); diff --git a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt index 66078776c5f..8348b2cfe11 100644 --- a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt @@ -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'. - 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 const testErr = - ~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. -!!! 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): ResizablePanel', gave the following error. + Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. + 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'. + Types of property 'children' are incompatible. + Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'.
diff --git a/tests/baselines/reference/constructorOverloads1.errors.txt b/tests/baselines/reference/constructorOverloads1.errors.txt index 2e8c79d159a..2a1dc25f0c2 100644 --- a/tests/baselines/reference/constructorOverloads1.errors.txt +++ b/tests/baselines/reference/constructorOverloads1.errors.txt @@ -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(); diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt index 747bbb9db8e..890eb71337f 100644 --- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt @@ -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 = {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 = {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 = ; // 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 = ; // 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 = {console.log(k)}}} extra />; // k has type any diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.types b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.types index 1d3508ff5c7..badb7b0d4e9 100644 --- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.types +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.types @@ -81,14 +81,14 @@ const b2 = {console.log(k)}} extra />; // k has type >b2 : JSX.Element >{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 = ; // goTo has type"home" | "contact" diff --git a/tests/baselines/reference/controlFlowIterationErrors.errors.txt b/tests/baselines/reference/controlFlowIterationErrors.errors.txt index 28cbf8bdc47..aaf153f3b44 100644 --- a/tests/baselines/reference/controlFlowIterationErrors.errors.txt +++ b/tests/baselines/reference/controlFlowIterationErrors.errors.txt @@ -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; } diff --git a/tests/baselines/reference/functionOverloads2.errors.txt b/tests/baselines/reference/functionOverloads2.errors.txt index 60fbe2843d9..71149141f45 100644 --- a/tests/baselines/reference/functionOverloads2.errors.txt +++ b/tests/baselines/reference/functionOverloads2.errors.txt @@ -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'. \ No newline at end of file + ~~~~~~~~~ +!!! 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'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt index 9f728e554a3..064ced0b442 100644 --- a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt +++ b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt @@ -1,15 +1,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(23,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. 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; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - 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; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - 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; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - 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; var newPromise = numPromise.then(testFunction); - ~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. -!!! 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): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + 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, error?: (error: any) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. } ////////////////////////////////////// @@ -89,10 +88,18 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); - ~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. -!!! 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): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + 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, error?: (error: any) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. +!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. } ////////////////////////////////////// @@ -109,9 +116,14 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); - ~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. -!!! 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): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + 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, error?: (error: any) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. } \ No newline at end of file diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index 3da9adcd2b7..b6b32526162 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -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; diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt index 9249e9512bc..027e9788a45 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt @@ -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'. \ No newline at end of file + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! 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'. \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt index 4f547c59ed0..0747bd48366 100644 --- a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt @@ -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'. - Type 'symbol[]' is not assignable to type 'ConcatArray'. - 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'. -!!! error TS2345: Type 'symbol[]' is not assignable to type 'ConcatArray'. -!!! 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'. \ No newline at end of file + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! 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[]', gave the following error. + Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. + 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[]', gave the following error. + Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. + Type 'symbol[]' is not assignable to type 'ConcatArray'. \ No newline at end of file diff --git a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt index fc8d68f1af8..e525d7e6276 100644 --- a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt +++ b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt @@ -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; }'. \ No newline at end of file + ~~~~~~~~~~~~~~~~~~ +!!! 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; }'. \ No newline at end of file diff --git a/tests/baselines/reference/overload1.errors.txt b/tests/baselines/reference/overload1.errors.txt index aa58f23b95a..8c4aa818e9d 100644 --- a/tests/baselines/reference/overload1.errors.txt +++ b/tests/baselines/reference/overload1.errors.txt @@ -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; diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index fde241d62cc..6be2c4058c9 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -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; diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index cfbc2605559..8cf0b4e0fd6 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -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 { diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index 40b660c7eaf..769eab3a9eb 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -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 { diff --git a/tests/baselines/reference/overloadingOnConstants2.errors.txt b/tests/baselines/reference/overloadingOnConstants2.errors.txt index c12d77714a3..6d1be3d8f24 100644 --- a/tests/baselines/reference/overloadingOnConstants2.errors.txt +++ b/tests/baselines/reference/overloadingOnConstants2.errors.txt @@ -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; diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt index 24476ecafd2..1804a123d84 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -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' 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' 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; // error that D does not satisfy constraint, y is of type G, 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' is not assignable to parameter of type '(x: D) => number'. + Type 'G' 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' 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' 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'. \ No newline at end of file diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index c719d8a9b95..dfbc1f9a507 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -1,67 +1,133 @@ -tests/cases/compiler/promisePermutations.ts(74,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(79,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(82,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(83,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(84,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type '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' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations.ts(93,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(97,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(100,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(101,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations.ts(102,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(106,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'cb' and 'value' are incompatible. - Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(109,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(110,19): error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. - Types of parameters 'cb' and 'value' are incompatible. - Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(111,19): error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'cb' and 'value' are incompatible. - Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(117,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(120,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(121,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -tests/cases/compiler/promisePermutations.ts(122,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(126,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(129,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. - Type 'IPromise' is not assignable to type 'IPromise'. - Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(132,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(133,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -tests/cases/compiler/promisePermutations.ts(134,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(137,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. - Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations.ts(144,35): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -tests/cases/compiler/promisePermutations.ts(152,36): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. - Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -tests/cases/compiler/promisePermutations.ts(156,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. - Type 'IPromise' is not assignable to type 'IPromise'. - Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations.ts(158,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. - Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations.ts(159,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. - Type 'Promise' is not assignable to type 'IPromise'. - Types of property 'then' are incompatible. - Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. - Types of parameters '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' is not assignable to parameter of type '(value: IPromise) => IPromise'. + Types of parameters 'x' and 'value' are incompatible. + Type 'IPromise' 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' is not assignable to parameter of type '(value: string) => IPromise'. + 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' is not assignable to parameter of type '(value: string) => IPromise'. + 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' is not assignable to parameter of type '(value: string) => Promise'. + 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' is not assignable to parameter of type '(value: string) => IPromise'. + 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' is not assignable to parameter of type '(value: string) => IPromise'. +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' is not assignable to parameter of type '(value: string) => IPromise'. +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' is not assignable to parameter of type '(value: string) => Promise'. +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' is not assignable to parameter of type '(value: string) => IPromise'. +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: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +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: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +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: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +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: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +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: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. + Types of parameters 'cb' and 'value' are incompatible. + Type 'string' is not assignable to type '(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: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +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: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. + Types of parameters 'cb' and 'value' are incompatible. + Type 'string' is not assignable to type '(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: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. + Types of parameters 'cb' and 'value' are incompatible. + Type 'string' is not assignable to type '(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 '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +tests/cases/compiler/promisePermutations.ts(120,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +tests/cases/compiler/promisePermutations.ts(121,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +tests/cases/compiler/promisePermutations.ts(122,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +tests/cases/compiler/promisePermutations.ts(126,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +tests/cases/compiler/promisePermutations.ts(129,33): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. + Type 'IPromise' is not assignable to type 'IPromise'. + 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 '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +tests/cases/compiler/promisePermutations.ts(133,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +tests/cases/compiler/promisePermutations.ts(134,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +tests/cases/compiler/promisePermutations.ts(137,33): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. + Type 'IPromise' is not assignable to type 'IPromise'. +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' is not assignable to parameter of type '(error: any) => IPromise'. +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' is not assignable to parameter of type '(error: any) => Promise'. + Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +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; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. + Type 'IPromise' is not assignable to type 'IPromise'. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/promisePermutations.ts(158,21): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. + Type 'IPromise' is not assignable to type 'IPromise'. +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; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. + Type 'Promise' is not assignable to type 'IPromise'. + Types of property 'then' are incompatible. + Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. + Types of parameters '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' is not assignable to parameter of type '(value: IPromise) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'IPromise' 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' is not assignable to parameter of type '(value: IPromise) => IPromise'. +!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2755: Type 'IPromise' is not assignable to type 'number'. var r4: IPromise; var sIPromise: (x: any) => IPromise; var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type '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' is not assignable to parameter of type '(value: string) => IPromise'. +!!! 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; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type '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' is not assignable to parameter of type '(value: string) => IPromise'. +!!! 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' is not assignable to parameter of type '(value: string) => Promise'. -!!! 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' is not assignable to parameter of type '(value: string) => Promise'. +!!! 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' is not assignable to parameter of type '(value: string) => IPromise'. -!!! 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' is not assignable to parameter of type '(value: string) => IPromise'. +!!! 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; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! 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' is not assignable to parameter of type '(value: string) => IPromise'. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! 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' is not assignable to parameter of type '(value: string) => IPromise'. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! 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' is not assignable to parameter of type '(value: string) => Promise'. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! 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' is not assignable to parameter of type '(value: string) => IPromise'. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! 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: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! 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: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! 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: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! 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: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type '(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: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type '(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: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type '(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: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -233,48 +333,68 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok ~~~~~~~~~ -!!! error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. -!!! 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' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. +!!! 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; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. +!!! 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' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. 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' is not assignable to parameter of type '(error: any) => IPromise'. +!!! 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' is not assignable to parameter of type '(error: any) => IPromise'. 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' is not assignable to parameter of type '(error: any) => Promise'. -!!! error TS2345: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +!!! 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' is not assignable to parameter of type '(error: any) => Promise'. +!!! error TS2755: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. !!! 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; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! 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; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2755: Type 'number' is not assignable to type 'string'. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! 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; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. +!!! 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; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'IPromise'. -!!! error TS2345: Types of property 'then' are incompatible. -!!! error TS2345: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. -!!! error TS2345: Types of parameters '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; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'IPromise'. +!!! error TS2755: Types of property 'then' are incompatible. +!!! error TS2755: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. +!!! error 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 diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index b88ef28ca5c..5845b3ab9aa 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -1,9 +1,11 @@ tests/cases/compiler/promisePermutations2.ts(73,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations2.ts(78,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type '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' is not assignable to parameter of type '(value: string) => IPromise'. + 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' is not assignable to parameter of type '(value: string) => IPromise'. 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' is not assignable to parameter of type '(value: string) => IPromise'. 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' is not assignable to parameter of type '(value: string) => IPromise'. +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' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(90,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. tests/cases/compiler/promisePermutations2.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(96,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +tests/cases/compiler/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: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(99,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(100,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. tests/cases/compiler/promisePermutations2.ts(101,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(105,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'cb' and 'value' are incompatible. - Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(108,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(109,19): error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. - Types of parameters 'cb' and 'value' are incompatible. - Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(110,19): error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'cb' and 'value' are incompatible. - Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(116,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +tests/cases/compiler/promisePermutations2.ts(105,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. + Types of parameters 'cb' and 'value' are incompatible. + Type 'string' is not assignable to type '(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: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +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: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. + Types of parameters 'cb' and 'value' are incompatible. + Type 'string' is not assignable to type '(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: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. + Types of parameters 'cb' and 'value' are incompatible. + Type 'string' is not assignable to type '(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 '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(119,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(120,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations2.ts(121,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(125,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(128,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. - Type 'IPromise' is not assignable to type 'IPromise'. - 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 '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +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' is not assignable to parameter of type '(error: any) => IPromise'. + Type 'IPromise' is not assignable to type 'IPromise'. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations2.ts(131,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(132,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations2.ts(133,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(136,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations2.ts(143,35): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +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' is not assignable to parameter of type '(error: any) => IPromise'. tests/cases/compiler/promisePermutations2.ts(151,36): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -tests/cases/compiler/promisePermutations2.ts(155,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. - Type 'IPromise' is not assignable to type 'IPromise'. - Type 'number' is not assignable to type 'string'. +tests/cases/compiler/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; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. + Type 'IPromise' is not assignable to type 'IPromise'. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations2.ts(157,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. tests/cases/compiler/promisePermutations2.ts(158,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. @@ -148,9 +172,11 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type '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' is not assignable to parameter of type '(value: string) => IPromise'. +!!! 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; 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; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! 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' is not assignable to parameter of type '(value: string) => IPromise'. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error @@ -190,7 +218,9 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! 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: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error @@ -207,24 +237,32 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type '(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: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type '(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: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type '(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: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -232,7 +270,9 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error @@ -249,14 +289,18 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. -!!! 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' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. +!!! 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; 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' is not assignable to parameter of type '(error: any) => IPromise'. +!!! 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' is not assignable to parameter of type '(error: any) => IPromise'. 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; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! 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; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2755: Type 'number' is not assignable to type 'string'. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 83a161af960..1e59f21ae1b 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -1,29 +1,49 @@ tests/cases/compiler/promisePermutations3.ts(68,69): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(73,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'IPromise' 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' is not assignable to parameter of type '(value: IPromise) => IPromise'. + Types of parameters 'x' and 'value' are incompatible. + Type 'IPromise' is not assignable to type 'number'. tests/cases/compiler/promisePermutations3.ts(78,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(81,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(82,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(83,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type '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' is not assignable to parameter of type '(value: string) => IPromise'. + 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' is not assignable to parameter of type '(value: string) => Promise'. + 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' is not assignable to parameter of type '(value: string) => IPromise'. + 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' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(90,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations3.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +tests/cases/compiler/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' is not assignable to parameter of type '(value: string) => IPromise'. +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' is not assignable to parameter of type '(value: string) => Promise'. +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' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations3.ts(96,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(99,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(100,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations3.ts(101,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +tests/cases/compiler/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: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +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: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +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: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations3.ts(105,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(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 '(a: T) => T'. tests/cases/compiler/promisePermutations3.ts(116,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(119,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(120,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -tests/cases/compiler/promisePermutations3.ts(121,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +tests/cases/compiler/promisePermutations3.ts(119,19): error TS2755: No suitable overload for this call. + The last overload gave the following error. + Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +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 '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +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 '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations3.ts(125,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations3.ts(128,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(131,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(132,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -tests/cases/compiler/promisePermutations3.ts(133,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(136,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. - Type 'IPromise' is not assignable to type 'IPromise'. +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 '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +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 '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +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 '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +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' is not assignable to parameter of type '(error: any) => IPromise'. + Type 'IPromise' is not assignable to type 'IPromise'. tests/cases/compiler/promisePermutations3.ts(143,35): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(151,36): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. - Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +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' is not assignable to parameter of type '(error: any) => Promise'. + Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. tests/cases/compiler/promisePermutations3.ts(155,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations3.ts(157,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. - Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations3.ts(158,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations3.ts(159,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. - Type 'Promise' is not assignable to type 'IPromise'. - Types of property 'then' are incompatible. - Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. - 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; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. + Type 'IPromise' is not assignable to type 'IPromise'. +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; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/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; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. + Type 'Promise' is not assignable to type 'IPromise'. + Types of property 'then' are incompatible. + Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. + 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 '{ (x: T): IPromise; (x: T, y: T): Promise; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. @@ -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' is not assignable to parameter of type '(value: IPromise) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'IPromise' 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' is not assignable to parameter of type '(value: IPromise) => IPromise'. +!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2755: Type 'IPromise' is not assignable to type 'number'. var r4: IPromise; var sIPromise: (x: any) => IPromise; @@ -164,19 +208,25 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type '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' is not assignable to parameter of type '(value: string) => IPromise'. +!!! 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' is not assignable to parameter of type '(value: string) => Promise'. -!!! 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' is not assignable to parameter of type '(value: string) => Promise'. +!!! 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' is not assignable to parameter of type '(value: string) => IPromise'. -!!! 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' is not assignable to parameter of type '(value: string) => IPromise'. +!!! 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; @@ -187,13 +237,19 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! 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' is not assignable to parameter of type '(value: string) => IPromise'. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! 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' is not assignable to parameter of type '(value: string) => Promise'. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! 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' is not assignable to parameter of type '(value: string) => IPromise'. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; @@ -204,13 +260,19 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! 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: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! 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: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! 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: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; @@ -246,13 +308,19 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; @@ -270,19 +338,27 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. +!!! 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' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. 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' is not assignable to parameter of type '(error: any) => Promise'. -!!! error TS2345: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +!!! 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' is not assignable to parameter of type '(error: any) => Promise'. +!!! error TS2755: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. !!! 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; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2755: No suitable overload for this call. +!!! error TS2755: The last overload gave the following error. +!!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! 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; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. +!!! 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; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'IPromise'. -!!! error TS2345: Types of property 'then' are incompatible. -!!! error TS2345: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. -!!! 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; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'IPromise'. +!!! error TS2755: Types of property 'then' are incompatible. +!!! error TS2755: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. +!!! 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 diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt index c58b98b3949..72821c437af 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.errors.txt +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -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 \ No newline at end of file diff --git a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt index cf294de7780..8757e85713a 100644 --- a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt +++ b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt @@ -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'. \ No newline at end of file + ~~~~~~~~~~~~~~~~~~~~~ +!!! 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'. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt index 40a3321fe61..187d7dab5cc 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt @@ -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) ~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt index eb7d2f510a8..150c66be410 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt @@ -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) ~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt index a3be7fbc7f7..4d5ec42700c 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt @@ -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(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; diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt index c5063689b51..2e1e1f2ffc1 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt @@ -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(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; diff --git a/tests/baselines/reference/tsxElementResolution9.errors.txt b/tests/baselines/reference/tsxElementResolution9.errors.txt index acfe7ce9cca..b350fe0fdbc 100644 --- a/tests/baselines/reference/tsxElementResolution9.errors.txt +++ b/tests/baselines/reference/tsxElementResolution9.errors.txt @@ -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; ; // 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; ; // 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; ; // 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'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt index 7fe6609cc96..e06fffebe85 100644 --- a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt +++ b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt @@ -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

'. +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 = ; // should error - ~~~~~~~~~~~ -!!! error TS2322: Type '{}' is not assignable to type 'Readonly

'. + ~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx:15:14: Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. + Type '{}' is not assignable to type 'Readonly

'. +!!! 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

'. let z = // should work let q = // should work diff --git a/tests/baselines/reference/underscoreTest1.errors.txt b/tests/baselines/reference/underscoreTest1.errors.txt index 66fc8961eef..971650a4f14 100644 --- a/tests/baselines/reference/underscoreTest1.errors.txt +++ b/tests/baselines/reference/underscoreTest1.errors.txt @@ -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'. - 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'. -!!! 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_, context?: any): boolean', gave the following error. + Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. + 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, iterator?: Iterator_, context?: any): boolean', gave the following error. + Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. + Index signature is missing in type '(string | number | boolean)[]'. _.any([null, 0, 'yes', false]); diff --git a/tests/baselines/reference/unionTypeCallSignatures.errors.txt b/tests/baselines/reference/unionTypeCallSignatures.errors.txt index 2c80ac58cc8..9ae0bfaaa9d 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeCallSignatures.errors.txt @@ -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. diff --git a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt index d46f616e53e..d0eadc3cedc 100644 --- a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt @@ -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. From ecfa902ba1aa502943dda2d5d673c3e08e915af7 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Mon, 24 Jun 2019 15:32:58 -0700 Subject: [PATCH 09/26] Use existing reporting mechanism --- src/compiler/checker.ts | 245 ++++++++++++------ ...elessFunctionComponentOverload5.errors.txt | 49 ++-- ...xStatelessFunctionComponentOverload5.types | 6 +- 3 files changed, 198 insertions(+), 102 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 614eaeab71f..06066e3120e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11668,52 +11668,76 @@ namespace ts { * attempt to issue more specific errors on, for example, specific object literal properties or tuple members. */ function checkTypeAssignableToAndOptionallyElaborate(source: Type, target: Type, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined): boolean { - return checkTypeRelatedToAndOptionallyElaborate(source, target, assignableRelation, errorNode, expr, headMessage, containingMessageChain); + return checkTypeRelatedToAndOptionallyElaborate(source, target, assignableRelation, errorNode, expr, headMessage, containingMessageChain, /*errorOutputContainer*/ undefined); } - function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined): boolean; - function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): [Node, DiagnosticMessageChain, DiagnosticRelatedInformation[]?] | false; - function checkTypeRelatedToAndOptionallyElaborate(source: Type, target: Type, relation: Map, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, breakdown?: boolean): boolean | [Node, DiagnosticMessageChain, DiagnosticRelatedInformation[]?] { - if (isTypeRelatedTo(source, target, relation)) return breakdown ? false : true; - if (!errorNode || !elaborateError(expr, source, target, relation, headMessage)) { - return checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, undefined, breakdown); + function checkTypeRelatedToAndOptionallyElaborate( + source: Type, + target: Type, + relation: Map, + errorNode: Node | undefined, + expr: Expression | undefined, + headMessage: DiagnosticMessage | undefined, + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + ): boolean { + if (isTypeRelatedTo(source, target, relation)) return true; + if (!errorNode || !elaborateError(expr, source, target, relation, headMessage, errorOutputContainer)) { + return checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer); } - return breakdown ? [undefined!,undefined!] as [Node, DiagnosticMessageChain] : false; + return false; } function isOrHasGenericConditional(type: Type): boolean { return !!(type.flags & TypeFlags.Conditional || (type.flags & TypeFlags.Intersection && some((type as IntersectionType).types, isOrHasGenericConditional))); } - function elaborateError(node: Expression | undefined, source: Type, target: Type, relation: Map, headMessage: DiagnosticMessage | undefined): boolean { + function elaborateError( + node: Expression | undefined, + source: Type, + target: Type, + relation: Map, + headMessage: DiagnosticMessage | undefined, + errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + ): boolean { + // TODO: The first case probably still needs to set errorOutputContainer.error to something + // TODO: Make sure all error logging in dynamic scope sets errorOutputContainer.error instead if (!node || isOrHasGenericConditional(target)) return false; - if (!checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined) && elaborateDidYouMeanToCallOrConstruct(node, source, target, relation, headMessage)) { + if (!checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined) + && elaborateDidYouMeanToCallOrConstruct(node, source, target, relation, headMessage, errorOutputContainer)) { return true; } switch (node.kind) { case SyntaxKind.JsxExpression: case SyntaxKind.ParenthesizedExpression: - return elaborateError((node as ParenthesizedExpression | JsxExpression).expression, source, target, relation, headMessage); + return elaborateError((node as ParenthesizedExpression | JsxExpression).expression, source, target, relation, headMessage, errorOutputContainer); case SyntaxKind.BinaryExpression: switch ((node as BinaryExpression).operatorToken.kind) { case SyntaxKind.EqualsToken: case SyntaxKind.CommaToken: - return elaborateError((node as BinaryExpression).right, source, target, relation, headMessage); + return elaborateError((node as BinaryExpression).right, source, target, relation, headMessage, errorOutputContainer); } break; case SyntaxKind.ObjectLiteralExpression: - return elaborateObjectLiteral(node as ObjectLiteralExpression, source, target, relation); + return elaborateObjectLiteral(node as ObjectLiteralExpression, source, target, relation, errorOutputContainer); case SyntaxKind.ArrayLiteralExpression: - return elaborateArrayLiteral(node as ArrayLiteralExpression, source, target, relation); + return elaborateArrayLiteral(node as ArrayLiteralExpression, source, target, relation, errorOutputContainer); case SyntaxKind.JsxAttributes: - return elaborateJsxComponents(node as JsxAttributes, source, target, relation); + return elaborateJsxComponents(node as JsxAttributes, source, target, relation, errorOutputContainer); case SyntaxKind.ArrowFunction: - return elaborateArrowFunction(node as ArrowFunction, source, target, relation); + return elaborateArrowFunction(node as ArrowFunction, source, target, relation, errorOutputContainer); } return false; } - function elaborateDidYouMeanToCallOrConstruct(node: Expression, source: Type, target: Type, relation: Map, headMessage: DiagnosticMessage | undefined): boolean { + function elaborateDidYouMeanToCallOrConstruct( + node: Expression, + source: Type, + target: Type, + relation: Map, + headMessage: DiagnosticMessage | undefined, + errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + ): boolean { const callSignatures = getSignaturesOfType(source, SignatureKind.Call); const constructSignatures = getSignaturesOfType(source, SignatureKind.Construct); for (const signatures of [constructSignatures, callSignatures]) { @@ -11721,7 +11745,7 @@ namespace ts { const returnType = getReturnTypeOfSignature(s); return !(returnType.flags & (TypeFlags.Any | TypeFlags.Never)) && checkTypeRelatedTo(returnType, target, relation, /*errorNode*/ undefined); })) { - const resultObj: { error?: Diagnostic } = {}; + const resultObj: { error?: Diagnostic } = errorOutputContainer || {}; checkTypeAssignableTo(source, target, node, headMessage, /*containingChain*/ undefined, resultObj); const diagnostic = resultObj.error!; addRelatedInfo(diagnostic, createDiagnosticForNode( @@ -11734,7 +11758,13 @@ namespace ts { return false; } - function elaborateArrowFunction(node: ArrowFunction, source: Type, target: Type, relation: Map): boolean { + function elaborateArrowFunction( + node: ArrowFunction, + source: Type, + target: Type, + relation: Map, + errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + ): boolean { // Don't elaborate blocks if (isBlock(node.body)) { return false; @@ -11755,11 +11785,11 @@ namespace ts { const sourceReturn = getReturnTypeOfSignature(sourceSig); const targetReturn = getUnionType(map(targetSignatures, getReturnTypeOfSignature)); if (!checkTypeRelatedTo(sourceReturn, targetReturn, relation, /*errorNode*/ undefined)) { - const elaborated = returnExpression && elaborateError(returnExpression, sourceReturn, targetReturn, relation, /*headMessage*/ undefined); + const elaborated = returnExpression && elaborateError(returnExpression, sourceReturn, targetReturn, relation, /*headMessage*/ undefined, errorOutputContainer); if (elaborated) { return elaborated; } - const resultObj: { error?: Diagnostic } = {}; + const resultObj: { error?: Diagnostic } = errorOutputContainer || {}; checkTypeRelatedTo(sourceReturn, targetReturn, relation, returnExpression, /*message*/ undefined, /*chain*/ undefined, resultObj); if (resultObj.error) { if (target.symbol && length(target.symbol.declarations)) { @@ -11780,7 +11810,13 @@ namespace ts { * If that element would issue an error, we first attempt to dive into that element's inner expression and issue a more specific error by recuring into `elaborateError` * Otherwise, we issue an error on _every_ element which fail the assignability check */ - function elaborateElementwise(iterator: ElaborationIterator, source: Type, target: Type, relation: Map) { + function elaborateElementwise( + iterator: ElaborationIterator, + source: Type, + target: Type, + relation: Map, + errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + ) { // Assignability failure - check each prop individually, and if that fails, fall back on the bad error span let reportedError = false; for (let status = iterator.next(); !status.done; status = iterator.next()) { @@ -11789,13 +11825,13 @@ namespace ts { if (!targetPropType || targetPropType.flags & TypeFlags.IndexedAccess) continue; // Don't elaborate on indexes on generic variables const sourcePropType = getIndexedAccessTypeOrUndefined(source, nameType); if (sourcePropType && !checkTypeRelatedTo(sourcePropType, targetPropType, relation, /*errorNode*/ undefined)) { - const elaborated = next && elaborateError(next, sourcePropType, targetPropType, relation, /*headMessage*/ undefined); + const elaborated = next && elaborateError(next, sourcePropType, targetPropType, relation, /*headMessage*/ undefined, errorOutputContainer); if (elaborated) { reportedError = true; } else { // Issue error on the prop itself, since the prop couldn't elaborate the error - const resultObj: { error?: Diagnostic } = {}; + const resultObj: { error?: Diagnostic } = errorOutputContainer || {}; // Use the expression type, if available const specificSource = next ? checkExpressionForMutableLocation(next, CheckMode.Normal, sourcePropType) : sourcePropType; const result = checkTypeRelatedTo(specificSource, targetPropType, relation, prop, errorMessage, /*containingChain*/ undefined, resultObj); @@ -11887,8 +11923,14 @@ namespace ts { return filter(children, i => !isJsxText(i) || !i.containsOnlyTriviaWhiteSpaces); } - function elaborateJsxComponents(node: JsxAttributes, source: Type, target: Type, relation: Map) { - let result = elaborateElementwise(generateJsxAttributes(node), source, target, relation); + function elaborateJsxComponents( + node: JsxAttributes, + source: Type, + target: Type, + relation: Map, + errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + ) { + let result = elaborateElementwise(generateJsxAttributes(node), source, target, relation, errorOutputContainer); let invalidTextDiagnostic: DiagnosticMessage | undefined; if (isJsxOpeningElement(node.parent) && isJsxElement(node.parent.parent)) { const containingElement = node.parent.parent; @@ -11906,17 +11948,21 @@ namespace ts { if (moreThanOneRealChildren) { if (arrayLikeTargetParts !== neverType) { const realSource = createTupleType(checkJsxChildren(containingElement, CheckMode.Normal)); - result = elaborateElementwise(generateJsxChildren(containingElement, getInvalidTextualChildDiagnostic), realSource, arrayLikeTargetParts, relation) || result; + const children = generateJsxChildren(containingElement, getInvalidTextualChildDiagnostic) + result = elaborateElementwise(children, realSource, arrayLikeTargetParts, relation, errorOutputContainer) || result; } else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { // arity mismatch result = true; - error( + const diag = error( containingElement.openingElement.tagName, Diagnostics.This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided, childrenPropName, typeToString(childrenTargetType) ); + if (errorOutputContainer && errorOutputContainer.skipLogging) { + errorOutputContainer.error = diag; + } } } else { @@ -11928,19 +11974,23 @@ namespace ts { (function*() { yield elem; })(), source, target, - relation + relation, + errorOutputContainer ) || result; } } else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { // arity mismatch result = true; - error( + const diag = error( containingElement.openingElement.tagName, Diagnostics.This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided, childrenPropName, typeToString(childrenTargetType) ); + if (errorOutputContainer && errorOutputContainer.skipLogging) { + errorOutputContainer.error = diag; + } } } } @@ -11972,15 +12022,21 @@ namespace ts { } } - function elaborateArrayLiteral(node: ArrayLiteralExpression, source: Type, target: Type, relation: Map) { + function elaborateArrayLiteral( + node: ArrayLiteralExpression, + source: Type, + target: Type, + relation: Map, + errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + ) { if (target.flags & TypeFlags.Primitive) return false; if (isTupleLikeType(source)) { - return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation); + return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, errorOutputContainer); } // recreate a tuple from the elements, if possible const tupleizedType = checkArrayLiteral(node, CheckMode.Contextual, /*forceTuple*/ true); if (isTupleLikeType(tupleizedType)) { - return elaborateElementwise(generateLimitedTupleElements(node, target), tupleizedType, target, relation); + return elaborateElementwise(generateLimitedTupleElements(node, target), tupleizedType, target, relation, errorOutputContainer); } return false; } @@ -12009,9 +12065,15 @@ namespace ts { } } - function elaborateObjectLiteral(node: ObjectLiteralExpression, source: Type, target: Type, relation: Map) { + function elaborateObjectLiteral( + node: ObjectLiteralExpression, + source: Type, + target: Type, + relation: Map, + errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + ) { if (target.flags & TypeFlags.Primitive) return false; - return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation); + return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation, errorOutputContainer); } /** @@ -12343,25 +12405,6 @@ namespace ts { return getObjectFlags(source) & ObjectFlags.JsxAttributes && !isUnhyphenatedJsxName(sourceProp.escapedName); } - function checkTypeRelatedTo( - source: Type, - target: Type, - relation: Map, - errorNode: Node | undefined, - headMessage?: DiagnosticMessage, - containingMessageChain?: () => DiagnosticMessageChain | undefined, - errorOutputContainer?: { error?: Diagnostic }, - ): boolean; - function checkTypeRelatedTo( - source: Type, - target: Type, - relation: Map, - errorNode: Node | undefined, - headMessage?: DiagnosticMessage, - containingMessageChain?: () => DiagnosticMessageChain | undefined, - errorOutputContainer?: { error?: Diagnostic }, - breakdown?: boolean - ): false | [Node, DiagnosticMessageChain, DiagnosticRelatedInformation[]?]; /** * Checks if 'source' is related to 'target' (e.g.: is a assignable to). * @param source The left-hand-side of the relation. @@ -12371,6 +12414,7 @@ namespace ts { * @param errorNode The suggested node upon which all errors will be reported, if defined. This may or may not be the actual node used. * @param headMessage If the error chain should be prepended by a head message, then headMessage will be used. * @param containingMessageChain A chain of errors to prepend any new errors found. + * @param errorOutputContainer Return the diagnostic. Do not log if 'skipLogging' is truthy. */ function checkTypeRelatedTo( source: Type, @@ -12379,9 +12423,8 @@ namespace ts { errorNode: Node | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, - errorOutputContainer?: { error?: Diagnostic }, - breakdown?: boolean - ): boolean | [Node, DiagnosticMessageChain, DiagnosticRelatedInformation[]?] { + errorOutputContainer?: { error?: Diagnostic, skipLogging?: boolean }, + ): boolean { let errorInfo: DiagnosticMessageChain | undefined; let relatedInfo: [DiagnosticRelatedInformation, ...DiagnosticRelatedInformation[]] | undefined; let maybeKeys: string[]; @@ -12397,7 +12440,10 @@ namespace ts { const result = isRelatedTo(source, target, /*reportErrors*/ !!errorNode, headMessage); if (overflow) { - error(errorNode, Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); + const diag = error(errorNode, Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); + if (errorOutputContainer) { + errorOutputContainer.error = diag; + } } else if (errorInfo) { if (containingMessageChain) { @@ -12420,9 +12466,6 @@ namespace ts { } } } - if (breakdown) { - return [errorNode!, errorInfo, relatedInfo ? [...(relatedInformation || []), ...relatedInfo]: relatedInformation]; - } const diag = createDiagnosticForNodeFromMessageChain(errorNode!, errorInfo, relatedInformation); if (relatedInfo) { addRelatedInfo(diag, ...relatedInfo); @@ -12430,11 +12473,12 @@ namespace ts { if (errorOutputContainer) { errorOutputContainer.error = diag; } - diagnostics.add(diag); // TODO: GH#18217 + if (!errorOutputContainer || !errorOutputContainer.skipLogging) { + diagnostics.add(diag); + } } - if (breakdown) { - Debug.assert(result === Ternary.False ? !errorNode : true, "missed opportunity to interact with error."); - return result === Ternary.False ? [undefined!, undefined!] as [Node, DiagnosticMessageChain] : false; + if (errorNode && errorOutputContainer && errorOutputContainer.skipLogging && result === Ternary.False) { + Debug.assert(!!errorOutputContainer.error, "missed opportunity to interact with error."); } return result !== Ternary.False; @@ -21127,13 +21171,14 @@ namespace ts { checkMode: CheckMode, reportErrors: boolean, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } ) { // 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, containingMessageChain, /*breakdown*/ true); + return checkTypeRelatedToAndOptionallyElaborate(attributesType, paramType, relation, reportErrors ? node.tagName : undefined, node.attributes, undefined, containingMessageChain, errorOutputContainer); } function getSignatureApplicabilityError( @@ -21145,8 +21190,19 @@ namespace ts { reportErrors: boolean, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, ) { + + const errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } = { error: undefined, skipLogging: true }; if (isJsxOpeningLikeElement(node)) { - return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain); + const r = checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain, errorOutputContainer); + if (!r) { + if (reportErrors) { + Debug.assert(!!errorOutputContainer.error, "has error 0"); + return errorOutputContainer.error; + } + else { + return true; + } + } } const thisType = getThisTypeOfSignature(signature); if (thisType && thisType !== voidType && node.kind !== SyntaxKind.NewExpression) { @@ -21157,9 +21213,15 @@ 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, containingMessageChain, undefined, /*breakdown*/ true); - if (r) { - return r; + const r = checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer); + if (!r) { + if (reportErrors) { + Debug.assert(!!errorOutputContainer.error, "has error 1"); // CLEAR + return errorOutputContainer.error; + } + else { + return true; + } } } const headMessage = Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1; @@ -21174,16 +21236,31 @@ namespace ts { // we obtain the regular type of any object literal arguments because we may not have inferred complete // parameter types yet and therefore excess property checks may yield false positives (see #17041). const checkArgType = checkMode & CheckMode.SkipContextSensitive ? getRegularTypeOfObjectLiteral(argType) : argType; - const r = checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain, /*breakdown*/ true); - if (r) { - return r; + const r = checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain, errorOutputContainer); + if (!r) { + if (reportErrors) { + Debug.assert(!!errorOutputContainer.error, "has error 2"); // CLEAR + return errorOutputContainer.error; + } + else { + return true; + } } } } if (restType) { const spreadType = getSpreadArgumentType(args, argCount, args.length, restType, /*context*/ undefined); const errorNode = reportErrors ? argCount < args.length ? args[argCount] : node : undefined; - return checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, undefined, undefined, /*breakdown*/ true); + const r = checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, undefined, errorOutputContainer); + if (!r) { + if (reportErrors) { + Debug.assert(!!errorOutputContainer.error, "has error 3"); // CLEAR + return errorOutputContainer.error; + } + else { + return true; + } + } } return undefined; } @@ -21520,10 +21597,13 @@ namespace ts { chain = chainDiagnosticMessages(chain, Diagnostics.The_last_overload_gave_the_following_error); 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"); - if (r) { - diagnostics.add(createDiagnosticForNodeFromMessageChain(...r)); + const d = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + Debug.assert(!!d, "No error for last signature"); + if (d) { + Debug.assert(d !== true); + // if elaboration already displayed the error, don't do anything extra + // note that we could do this always here, but getSignatureApplicabilityError is currently not configured to do that + diagnostics.add(d as Diagnostic); } } else { @@ -21532,10 +21612,11 @@ namespace ts { for (const c of candidatesForArgumentError) { 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)); + const d = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + Debug.assert(!!d, "No error for signature (1)"); + if (d) { + Debug.assert(d !== true); + related.push(d as Diagnostic); } } diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.No_suitable_overload_for_this_call), related)); diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt index 9101537a6e9..9a5486fa8bf 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt @@ -1,8 +1,7 @@ -tests/cases/conformance/jsx/file.tsx(48,13): error TS2322: Type '{ children: string; to: string; onClick: (e: any) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. - Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. -tests/cases/conformance/jsx/file.tsx(54,51): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(55,68): error TS2322: Type 'true' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(56,24): error TS2322: Type 'true' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(48,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(54,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(55,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No suitable overload for this call. ==== tests/cases/conformance/jsx/file.tsx (4 errors) ==== @@ -54,23 +53,39 @@ tests/cases/conformance/jsx/file.tsx(56,24): error TS2322: Type 'true' is not as // Error const b0 = {}}>GO; // extra property; - ~~~~~~~~~~ -!!! error TS2322: Type '{ children: string; to: string; onClick: (e: any) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. -!!! error TS2322: Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:48:13: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:48:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. + Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:48:13: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. + Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. + Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. const b1 = {}} {...obj0}>Hello world; // extra property; const b2 = ; // extra property const b3 = {}}} />; // extra property const b4 = ; // Should error because Incorrect type; but attributes are any so everything is allowed const b5 = ; // Spread retain method declaration (see GitHub #13365), so now there is an extra attributes const b6 = ; // incorrect type for optional attribute - ~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. -!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & HyphenProps' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2322 tests/cases/conformance/jsx/file.tsx:54:51: Type 'number' is not assignable to type 'string'. +!!! related TS2322 tests/cases/conformance/jsx/file.tsx:54:51: Type 'number' is not assignable to type 'string'. +!!! related TS2322 tests/cases/conformance/jsx/file.tsx:54:51: Type 'number' is not assignable to type 'string'. const b7 = ; // incorrect type for optional attribute - ~~~~~~~~~ -!!! error TS2322: Type 'true' is not assignable to type 'string'. -!!! related TS6500 tests/cases/conformance/jsx/file.tsx:5:5: The expected type comes from property 'className' which is declared here on type 'IntrinsicAttributes & HyphenProps' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2322 tests/cases/conformance/jsx/file.tsx:55:68: Type 'true' is not assignable to type 'string'. +!!! related TS2322 tests/cases/conformance/jsx/file.tsx:55:68: Type 'true' is not assignable to type 'string'. +!!! related TS2322 tests/cases/conformance/jsx/file.tsx:55:68: Type 'true' is not assignable to type 'string'. const b8 = ; // incorrect type for specified hyphanated name - ~~~~~~~~~~~ -!!! error TS2322: Type 'true' is not assignable to type 'string'. -!!! related TS6500 tests/cases/conformance/jsx/file.tsx:17:5: The expected type comes from property 'data-format' which is declared here on type 'IntrinsicAttributes & HyphenProps' \ No newline at end of file + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:56:13: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:56:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'. +!!! related TS2322 tests/cases/conformance/jsx/file.tsx:56:24: Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.types b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.types index d9b40dad94f..6a9b770ef48 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.types +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.types @@ -113,9 +113,9 @@ const b0 = {}}>GO; // ex >{}}>GO : JSX.Element >MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; } >to : string ->onClick : (e: any) => void ->(e)=>{} : (e: any) => void ->e : any +>onClick : (e: React.MouseEvent) => void +>(e)=>{} : (e: React.MouseEvent) => void +>e : React.MouseEvent >MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; } const b1 = {}} {...obj0}>Hello world; // extra property; From f20f700025e40129d3bdec97adb0bf2ae8b80925 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 25 Jun 2019 13:16:34 -0700 Subject: [PATCH 10/26] Update baselines, except JSX JSX is still broken --- src/compiler/checker.ts | 161 ++++++++---------- tests/baselines/reference/for-of39.errors.txt | 20 ++- .../reference/functionOverloads40.errors.txt | 11 +- .../reference/functionOverloads41.errors.txt | 11 +- .../heterogeneousArrayAndOverloads.errors.txt | 22 +-- .../iterableArrayPattern28.errors.txt | 20 ++- .../overloadResolutionTest1.errors.txt | 33 ++-- .../overloadsWithProvisionalErrors.errors.txt | 23 ++- .../reference/promiseTypeInference.errors.txt | 29 ++-- ...actDefaultPropsInferenceSuccess.errors.txt | 50 +++--- .../reference/strictBindCallApply1.errors.txt | 52 ++++-- 11 files changed, 250 insertions(+), 182 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 06066e3120e..f1aa67ab00f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11659,7 +11659,7 @@ namespace ts { return isTypeComparableTo(type1, type2) || isTypeComparableTo(type2, type1); } - function checkTypeAssignableTo(source: Type, target: Type, errorNode: Node | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, errorOutputObject?: { error?: Diagnostic }): boolean { + function checkTypeAssignableTo(source: Type, target: Type, errorNode: Node | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, errorOutputObject?: { errors?: Diagnostic[] }): boolean { return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain, errorOutputObject); } @@ -11679,10 +11679,10 @@ namespace ts { expr: Expression | undefined, headMessage: DiagnosticMessage | undefined, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, - errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined ): boolean { if (isTypeRelatedTo(source, target, relation)) return true; - if (!errorNode || !elaborateError(expr, source, target, relation, headMessage, errorOutputContainer)) { + if (!errorNode || !elaborateError(expr, source, target, relation, headMessage, containingMessageChain, errorOutputContainer)) { return checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer); } return false; @@ -11698,34 +11698,35 @@ namespace ts { target: Type, relation: Map, headMessage: DiagnosticMessage | undefined, - errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined ): boolean { // TODO: The first case probably still needs to set errorOutputContainer.error to something // TODO: Make sure all error logging in dynamic scope sets errorOutputContainer.error instead if (!node || isOrHasGenericConditional(target)) return false; if (!checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined) - && elaborateDidYouMeanToCallOrConstruct(node, source, target, relation, headMessage, errorOutputContainer)) { + && elaborateDidYouMeanToCallOrConstruct(node, source, target, relation, headMessage, containingMessageChain, errorOutputContainer)) { return true; } switch (node.kind) { case SyntaxKind.JsxExpression: case SyntaxKind.ParenthesizedExpression: - return elaborateError((node as ParenthesizedExpression | JsxExpression).expression, source, target, relation, headMessage, errorOutputContainer); + return elaborateError((node as ParenthesizedExpression | JsxExpression).expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); case SyntaxKind.BinaryExpression: switch ((node as BinaryExpression).operatorToken.kind) { case SyntaxKind.EqualsToken: case SyntaxKind.CommaToken: - return elaborateError((node as BinaryExpression).right, source, target, relation, headMessage, errorOutputContainer); + return elaborateError((node as BinaryExpression).right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; case SyntaxKind.ObjectLiteralExpression: - return elaborateObjectLiteral(node as ObjectLiteralExpression, source, target, relation, errorOutputContainer); + return elaborateObjectLiteral(node as ObjectLiteralExpression, source, target, relation, containingMessageChain, errorOutputContainer); case SyntaxKind.ArrayLiteralExpression: - return elaborateArrayLiteral(node as ArrayLiteralExpression, source, target, relation, errorOutputContainer); + return elaborateArrayLiteral(node as ArrayLiteralExpression, source, target, relation, containingMessageChain, errorOutputContainer); case SyntaxKind.JsxAttributes: - return elaborateJsxComponents(node as JsxAttributes, source, target, relation, errorOutputContainer); + return elaborateJsxComponents(node as JsxAttributes, source, target, relation, containingMessageChain, errorOutputContainer); case SyntaxKind.ArrowFunction: - return elaborateArrowFunction(node as ArrowFunction, source, target, relation, errorOutputContainer); + return elaborateArrowFunction(node as ArrowFunction, source, target, relation, containingMessageChain, errorOutputContainer); } return false; } @@ -11736,7 +11737,8 @@ namespace ts { target: Type, relation: Map, headMessage: DiagnosticMessage | undefined, - errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined ): boolean { const callSignatures = getSignaturesOfType(source, SignatureKind.Call); const constructSignatures = getSignaturesOfType(source, SignatureKind.Construct); @@ -11745,9 +11747,9 @@ namespace ts { const returnType = getReturnTypeOfSignature(s); return !(returnType.flags & (TypeFlags.Any | TypeFlags.Never)) && checkTypeRelatedTo(returnType, target, relation, /*errorNode*/ undefined); })) { - const resultObj: { error?: Diagnostic } = errorOutputContainer || {}; - checkTypeAssignableTo(source, target, node, headMessage, /*containingChain*/ undefined, resultObj); - const diagnostic = resultObj.error!; + const resultObj: { errors?: Diagnostic[] } = errorOutputContainer || {}; + checkTypeAssignableTo(source, target, node, headMessage, containingMessageChain, resultObj); + const diagnostic = resultObj.errors![resultObj.errors!.length - 1]; addRelatedInfo(diagnostic, createDiagnosticForNode( node, signatures === constructSignatures ? Diagnostics.Did_you_mean_to_use_new_with_this_expression : Diagnostics.Did_you_mean_to_call_this_expression @@ -11763,7 +11765,8 @@ namespace ts { source: Type, target: Type, relation: Map, - errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined ): boolean { // Don't elaborate blocks if (isBlock(node.body)) { @@ -11785,15 +11788,15 @@ namespace ts { const sourceReturn = getReturnTypeOfSignature(sourceSig); const targetReturn = getUnionType(map(targetSignatures, getReturnTypeOfSignature)); if (!checkTypeRelatedTo(sourceReturn, targetReturn, relation, /*errorNode*/ undefined)) { - const elaborated = returnExpression && elaborateError(returnExpression, sourceReturn, targetReturn, relation, /*headMessage*/ undefined, errorOutputContainer); + const elaborated = returnExpression && elaborateError(returnExpression, sourceReturn, targetReturn, relation, /*headMessage*/ undefined, containingMessageChain, errorOutputContainer); if (elaborated) { return elaborated; } - const resultObj: { error?: Diagnostic } = errorOutputContainer || {}; - checkTypeRelatedTo(sourceReturn, targetReturn, relation, returnExpression, /*message*/ undefined, /*chain*/ undefined, resultObj); - if (resultObj.error) { + const resultObj: { errors?: Diagnostic[] } = errorOutputContainer || {}; + checkTypeRelatedTo(sourceReturn, targetReturn, relation, returnExpression, /*message*/ undefined, containingMessageChain, resultObj); + if (resultObj.errors) { if (target.symbol && length(target.symbol.declarations)) { - addRelatedInfo(resultObj.error, createDiagnosticForNode( + addRelatedInfo(resultObj.errors[resultObj.errors.length - 1], createDiagnosticForNode( target.symbol.declarations[0], Diagnostics.The_expected_type_comes_from_the_return_type_of_this_signature, )); @@ -11815,7 +11818,8 @@ namespace ts { source: Type, target: Type, relation: Map, - errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined ) { // Assignability failure - check each prop individually, and if that fails, fall back on the bad error span let reportedError = false; @@ -11825,22 +11829,22 @@ namespace ts { if (!targetPropType || targetPropType.flags & TypeFlags.IndexedAccess) continue; // Don't elaborate on indexes on generic variables const sourcePropType = getIndexedAccessTypeOrUndefined(source, nameType); if (sourcePropType && !checkTypeRelatedTo(sourcePropType, targetPropType, relation, /*errorNode*/ undefined)) { - const elaborated = next && elaborateError(next, sourcePropType, targetPropType, relation, /*headMessage*/ undefined, errorOutputContainer); + const elaborated = next && elaborateError(next, sourcePropType, targetPropType, relation, /*headMessage*/ undefined, containingMessageChain, errorOutputContainer); if (elaborated) { reportedError = true; } else { // Issue error on the prop itself, since the prop couldn't elaborate the error - const resultObj: { error?: Diagnostic } = errorOutputContainer || {}; + const resultObj: { errors?: Diagnostic[] } = errorOutputContainer || {}; // Use the expression type, if available const specificSource = next ? checkExpressionForMutableLocation(next, CheckMode.Normal, sourcePropType) : sourcePropType; - const result = checkTypeRelatedTo(specificSource, targetPropType, relation, prop, errorMessage, /*containingChain*/ undefined, resultObj); + const result = checkTypeRelatedTo(specificSource, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj); if (result && specificSource !== sourcePropType) { // If for whatever reason the expression type doesn't yield an error, make sure we still issue an error on the sourcePropType - checkTypeRelatedTo(sourcePropType, targetPropType, relation, prop, errorMessage, /*containingChain*/ undefined, resultObj); + checkTypeRelatedTo(sourcePropType, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj); } - if (resultObj.error) { - const reportedDiag = resultObj.error; + if (resultObj.errors) { + const reportedDiag = resultObj.errors[resultObj.errors.length - 1]; const propertyName = isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : undefined; const targetProp = propertyName !== undefined ? getPropertyOfType(target, propertyName) : undefined; @@ -11928,9 +11932,10 @@ namespace ts { source: Type, target: Type, relation: Map, - errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined ) { - let result = elaborateElementwise(generateJsxAttributes(node), source, target, relation, errorOutputContainer); + let result = elaborateElementwise(generateJsxAttributes(node), source, target, relation, containingMessageChain, errorOutputContainer); let invalidTextDiagnostic: DiagnosticMessage | undefined; if (isJsxOpeningElement(node.parent) && isJsxElement(node.parent.parent)) { const containingElement = node.parent.parent; @@ -11949,7 +11954,7 @@ namespace ts { if (arrayLikeTargetParts !== neverType) { const realSource = createTupleType(checkJsxChildren(containingElement, CheckMode.Normal)); const children = generateJsxChildren(containingElement, getInvalidTextualChildDiagnostic) - result = elaborateElementwise(children, realSource, arrayLikeTargetParts, relation, errorOutputContainer) || result; + result = elaborateElementwise(children, realSource, arrayLikeTargetParts, relation, containingMessageChain, errorOutputContainer) || result; } else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { // arity mismatch @@ -11961,7 +11966,7 @@ namespace ts { typeToString(childrenTargetType) ); if (errorOutputContainer && errorOutputContainer.skipLogging) { - errorOutputContainer.error = diag; + (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); } } } @@ -11975,6 +11980,7 @@ namespace ts { source, target, relation, + containingMessageChain, errorOutputContainer ) || result; } @@ -11989,7 +11995,7 @@ namespace ts { typeToString(childrenTargetType) ); if (errorOutputContainer && errorOutputContainer.skipLogging) { - errorOutputContainer.error = diag; + (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); } } } @@ -12027,16 +12033,17 @@ namespace ts { source: Type, target: Type, relation: Map, - errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined ) { if (target.flags & TypeFlags.Primitive) return false; if (isTupleLikeType(source)) { - return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, errorOutputContainer); + return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, containingMessageChain, errorOutputContainer); } // recreate a tuple from the elements, if possible const tupleizedType = checkArrayLiteral(node, CheckMode.Contextual, /*forceTuple*/ true); if (isTupleLikeType(tupleizedType)) { - return elaborateElementwise(generateLimitedTupleElements(node, target), tupleizedType, target, relation, errorOutputContainer); + return elaborateElementwise(generateLimitedTupleElements(node, target), tupleizedType, target, relation, containingMessageChain, errorOutputContainer); } return false; } @@ -12070,10 +12077,11 @@ namespace ts { source: Type, target: Type, relation: Map, - errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } | undefined + containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, + errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined ) { if (target.flags & TypeFlags.Primitive) return false; - return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation, errorOutputContainer); + return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation, containingMessageChain, errorOutputContainer); } /** @@ -12423,7 +12431,7 @@ namespace ts { errorNode: Node | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, - errorOutputContainer?: { error?: Diagnostic, skipLogging?: boolean }, + errorOutputContainer?: { errors?: Diagnostic[], skipLogging?: boolean }, ): boolean { let errorInfo: DiagnosticMessageChain | undefined; let relatedInfo: [DiagnosticRelatedInformation, ...DiagnosticRelatedInformation[]] | undefined; @@ -12442,7 +12450,7 @@ namespace ts { if (overflow) { const diag = error(errorNode, Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); if (errorOutputContainer) { - errorOutputContainer.error = diag; + (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); } } else if (errorInfo) { @@ -12471,14 +12479,14 @@ namespace ts { addRelatedInfo(diag, ...relatedInfo); } if (errorOutputContainer) { - errorOutputContainer.error = diag; + (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); } if (!errorOutputContainer || !errorOutputContainer.skipLogging) { diagnostics.add(diag); } } if (errorNode && errorOutputContainer && errorOutputContainer.skipLogging && result === Ternary.False) { - Debug.assert(!!errorOutputContainer.error, "missed opportunity to interact with error."); + Debug.assert(!!errorOutputContainer.errors, "missed opportunity to interact with error."); } return result !== Ternary.False; @@ -21171,7 +21179,7 @@ namespace ts { checkMode: CheckMode, reportErrors: boolean, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, - errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } + errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } ) { // 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, @@ -21191,17 +21199,14 @@ namespace ts { containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, ) { - const errorOutputContainer: { error?: Diagnostic, skipLogging?: boolean } = { error: undefined, skipLogging: true }; + const errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } = { errors: undefined, skipLogging: true }; if (isJsxOpeningLikeElement(node)) { const r = checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain, errorOutputContainer); if (!r) { if (reportErrors) { - Debug.assert(!!errorOutputContainer.error, "has error 0"); - return errorOutputContainer.error; - } - else { - return true; + Debug.assert(!!errorOutputContainer.errors, "has error 0"); } + return errorOutputContainer.errors || []; } } const thisType = getThisTypeOfSignature(signature); @@ -21213,15 +21218,9 @@ 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, containingMessageChain, errorOutputContainer); - if (!r) { - if (reportErrors) { - Debug.assert(!!errorOutputContainer.error, "has error 1"); // CLEAR - return errorOutputContainer.error; - } - else { - return true; - } + if (!checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer)) { + Debug.assert(!reportErrors || !!errorOutputContainer.errors, "has error 1"); // CLEAR + return errorOutputContainer.errors || []; } } const headMessage = Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1; @@ -21236,30 +21235,18 @@ namespace ts { // we obtain the regular type of any object literal arguments because we may not have inferred complete // parameter types yet and therefore excess property checks may yield false positives (see #17041). const checkArgType = checkMode & CheckMode.SkipContextSensitive ? getRegularTypeOfObjectLiteral(argType) : argType; - const r = checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain, errorOutputContainer); - if (!r) { - if (reportErrors) { - Debug.assert(!!errorOutputContainer.error, "has error 2"); // CLEAR - return errorOutputContainer.error; - } - else { - return true; - } + if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain, errorOutputContainer)) { + Debug.assert(!reportErrors || !!errorOutputContainer.errors, "has error 2"); // CLEAR + return errorOutputContainer.errors || []; } } } if (restType) { const spreadType = getSpreadArgumentType(args, argCount, args.length, restType, /*context*/ undefined); const errorNode = reportErrors ? argCount < args.length ? args[argCount] : node : undefined; - const r = checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, undefined, errorOutputContainer); - if (!r) { - if (reportErrors) { - Debug.assert(!!errorOutputContainer.error, "has error 3"); // CLEAR - return errorOutputContainer.error; - } - else { - return true; - } + if (!checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, undefined, errorOutputContainer)) { + Debug.assert(!reportErrors || !!errorOutputContainer.errors, "has error 3"); // CLEAR + return errorOutputContainer.errors || []; } } return undefined; @@ -21597,13 +21584,14 @@ namespace ts { chain = chainDiagnosticMessages(chain, Diagnostics.The_last_overload_gave_the_following_error); chain = chainDiagnosticMessages(chain, Diagnostics.No_suitable_overload_for_this_call); } - const d = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); - Debug.assert(!!d, "No error for last signature"); - if (d) { - Debug.assert(d !== true); + const ds = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + Debug.assert(!!ds, "No error for last signature"); + if (ds) { // if elaboration already displayed the error, don't do anything extra // note that we could do this always here, but getSignatureApplicabilityError is currently not configured to do that - diagnostics.add(d as Diagnostic); + for (const d of ds as Diagnostic[]) { + diagnostics.add(d); + } } } else { @@ -21611,12 +21599,11 @@ namespace ts { let i = 0; for (const c of candidatesForArgumentError) { i++; - const chain = chainDiagnosticMessages(undefined, Diagnostics.Overload_0_of_1_2_gave_the_following_error, i, candidates.length, signatureToString(c)); - const d = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); - Debug.assert(!!d, "No error for signature (1)"); - if (d) { - Debug.assert(d !== true); - related.push(d as Diagnostic); + const chain = () => chainDiagnosticMessages(undefined, Diagnostics.Overload_0_of_1_2_gave_the_following_error, i, candidates.length, signatureToString(c)); + const ds = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, chain); + Debug.assert(!!ds, "No error for signature (1)"); + if (ds) { + related.push(...ds as Diagnostic[]) } } diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.No_suitable_overload_for_this_call), related)); diff --git a/tests/baselines/reference/for-of39.errors.txt b/tests/baselines/reference/for-of39.errors.txt index fedf9f3e343..d5e48579c28 100644 --- a/tests/baselines/reference/for-of39.errors.txt +++ b/tests/baselines/reference/for-of39.errors.txt @@ -1,10 +1,24 @@ -tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,37): error TS2322: Type 'number' is not assignable to type 'boolean'. +tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2755: No suitable overload for this call. ==== tests/cases/conformance/es6/for-ofStatements/for-of39.ts (1 errors) ==== var map = new Map([["", true], ["", 0]]); - ~ -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:19: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. + Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '() => IterableIterator<[string, number] | [string, true]>' is not assignable to type '() => Iterator'. + Type 'IterableIterator<[string, number] | [string, true]>' is not assignable to type 'Iterator'. + Types of property 'next' are incompatible. + Type '(value?: any) => IteratorResult<[string, number] | [string, true]>' is not assignable to type '(value?: any) => IteratorResult'. + Type 'IteratorResult<[string, number] | [string, true]>' is not assignable to type 'IteratorResult'. + Type '[string, number] | [string, true]' is not assignable to type 'readonly [string, boolean]'. + Type '[string, number]' is not assignable to type 'readonly [string, boolean]'. + Types of property '1' are incompatible. + Type 'number' is not assignable to type 'boolean'. +!!! related TS2757 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:37: Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map', gave the following error. + Type 'number' is not assignable to type 'boolean'. for (var [k, v] of map) { k; v; diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt index f053c7c6208..b0706ed9650 100644 --- a/tests/baselines/reference/functionOverloads40.errors.txt +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads40.ts(4,15): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/functionOverloads40.ts (1 errors) ==== @@ -6,7 +6,10 @@ tests/cases/compiler/functionOverloads40.ts(4,15): error TS2322: Type 'string' i function foo(bar:{a:boolean;}[]):number; function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{a:'bar'}]); - ~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/compiler/functionOverloads40.ts:2:19: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }' + ~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. + Type 'string' is not assignable to type 'number'. +!!! related TS2757 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. + Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads41.errors.txt b/tests/baselines/reference/functionOverloads41.errors.txt index a09e6e14769..430a6e295c6 100644 --- a/tests/baselines/reference/functionOverloads41.errors.txt +++ b/tests/baselines/reference/functionOverloads41.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads41.ts(4,14): error TS2741: Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. +tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/functionOverloads41.ts (1 errors) ==== @@ -6,7 +6,10 @@ tests/cases/compiler/functionOverloads41.ts(4,14): error TS2741: Property 'a' is function foo(bar:{a:boolean;}[]):number; function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{}]); - ~~ -!!! error TS2741: Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. -!!! related TS2728 tests/cases/compiler/functionOverloads41.ts:2:19: 'a' is declared here. + ~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. + Property 'a' is missing in type '{}' but required in type '{ a: number; }'. +!!! related TS2757 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. + Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. \ No newline at end of file diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt index 60228b956f9..8c2d8ed2617 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt @@ -1,9 +1,7 @@ -tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,20): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,23): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,32): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No suitable overload for this call. -==== tests/cases/compiler/heterogeneousArrayAndOverloads.ts (3 errors) ==== +==== tests/cases/compiler/heterogeneousArrayAndOverloads.ts (1 errors) ==== class arrTest { test(arg1: number[]); test(arg1: string[]); @@ -13,11 +11,15 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,32): error TS2322: Type this.test(["hi"]); this.test([]); this.test([1, 2, "hi", 5]); // Error - ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. - ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. - ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:26: Overload 1 of 2, '(arg1: number[]): any', gave the following error. + Type 'string' is not assignable to type 'number'. +!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:20: Overload 2 of 2, '(arg1: string[]): any', gave the following error. + Type 'number' is not assignable to type 'string'. +!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:23: Overload 2 of 2, '(arg1: string[]): any', gave the following error. + Type 'number' is not assignable to type 'string'. +!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:32: Overload 2 of 2, '(arg1: string[]): any', gave the following error. + Type 'number' is not assignable to type 'string'. } } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern28.errors.txt b/tests/baselines/reference/iterableArrayPattern28.errors.txt index f90bba07c1a..53e41cb1de3 100644 --- a/tests/baselines/reference/iterableArrayPattern28.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern28.errors.txt @@ -1,8 +1,22 @@ -tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,52): error TS2322: Type 'true' is not assignable to type 'number'. +tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error TS2755: No suitable overload for this call. ==== tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts (1 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); - ~~~~ -!!! error TS2322: Type 'true' is not assignable to type 'number'. \ No newline at end of file + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:32: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. + Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator'. + Type 'IterableIterator<[string, number] | [string, boolean]>' is not assignable to type 'Iterator'. + Types of property 'next' are incompatible. + Type '(value?: any) => IteratorResult<[string, number] | [string, boolean]>' is not assignable to type '(value?: any) => IteratorResult'. + Type 'IteratorResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. + Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. + Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. + Types of property '1' are incompatible. + Type 'boolean' is not assignable to type 'number'. +!!! related TS2757 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:52: Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. + Type 'true' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt index 008ee13127c..f765e3d27d7 100644 --- a/tests/baselines/reference/overloadResolutionTest1.errors.txt +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/overloadResolutionTest1.ts(7,18): error TS2322: Type 'string' is not assignable to type 'boolean'. -tests/cases/compiler/overloadResolutionTest1.ts(18,16): error TS2322: Type 'string' is not assignable to type 'boolean'. -tests/cases/compiler/overloadResolutionTest1.ts(24,15): error TS2322: Type 'true' is not assignable to type 'string'. +tests/cases/compiler/overloadResolutionTest1.ts(7,12): error TS2755: No suitable overload for this call. +tests/cases/compiler/overloadResolutionTest1.ts(18,10): error TS2755: No suitable overload for this call. +tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/overloadResolutionTest1.ts (3 errors) ==== @@ -11,9 +11,12 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,15): error TS2322: Type 'true var x1 = foo([{a:true}]); // works var x11 = foo([{a:0}]); // works var x111 = foo([{a:"s"}]); // error - does not match any signature - ~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:2:19: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }' + ~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. + Type 'string' is not assignable to type 'number'. +!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. + Type 'string' is not assignable to type 'boolean'. var x1111 = foo([{a:null}]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string @@ -25,15 +28,21 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,15): error TS2322: Type 'true var x2 = foo2({a:0}); // works var x3 = foo2({a:true}); // works var x4 = foo2({a:"s"}); // error - ~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:13:20: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }' + ~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. + Type 'string' is not assignable to type 'number'. +!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. + Type 'string' is not assignable to type 'boolean'. function foo4(bar:{a:number;}):number; function foo4(bar:{a:string;}):string; function foo4(bar:{a:any;}):any{ return bar }; var x = foo4({a:true}); // error - ~ -!!! error TS2322: Type 'true' is not assignable to type 'string'. -!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:22:20: The expected type comes from property 'a' which is declared here on type '{ a: string; }' \ No newline at end of file + ~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. + Type 'true' is not assignable to type 'number'. +!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. + Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt index 3db9a29053f..2f2d4a5f5cd 100644 --- a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,11): error TS2739: Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b +tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,1): error TS2755: No suitable overload for this call. tests/cases/compiler/overloadsWithProvisionalErrors.ts(7,17): error TS2304: Cannot find name 'blah'. -tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,11): error TS2741: Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. +tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,1): error TS2755: No suitable overload for this call. tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cannot find name 'blah'. @@ -11,16 +11,21 @@ tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cann }; func(s => ({})); // Error for no applicable overload (object type is missing a and b) - ~~~~ -!!! error TS2739: Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b -!!! related TS6502 tests/cases/compiler/overloadsWithProvisionalErrors.ts:3:14: The expected type comes from the return type of this signature. + ~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:6: Overload 1 of 2, '(s: string): number', gave the following error. + Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. + Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) ~~~~ !!! error TS2304: Cannot find name 'blah'. func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway - ~~~~~~~~~~~~~ -!!! error TS2741: Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. -!!! related TS2728 tests/cases/compiler/overloadsWithProvisionalErrors.ts:3:42: 'b' is declared here. -!!! related TS6502 tests/cases/compiler/overloadsWithProvisionalErrors.ts:3:14: The expected type comes from the return type of this signature. + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:6: Overload 1 of 2, '(s: string): number', gave the following error. + Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. + Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. ~~~~ !!! error TS2304: Cannot find name 'blah'. \ No newline at end of file diff --git a/tests/baselines/reference/promiseTypeInference.errors.txt b/tests/baselines/reference/promiseTypeInference.errors.txt index 1996f37e540..ebd8bcf947b 100644 --- a/tests/baselines/reference/promiseTypeInference.errors.txt +++ b/tests/baselines/reference/promiseTypeInference.errors.txt @@ -1,10 +1,4 @@ -tests/cases/compiler/promiseTypeInference.ts(10,39): error TS2322: Type 'IPromise' is not assignable to type 'number | PromiseLike'. - Type 'IPromise' is not assignable to type 'PromiseLike'. - Types of property 'then' are incompatible. - Type '(success?: (value: number) => IPromise) => IPromise' is not assignable to type '(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. - Types of parameters 'success' and 'onfulfilled' are incompatible. - Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. - Type 'TResult1' is not assignable to type 'IPromise'. +tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/promiseTypeInference.ts (1 errors) ==== @@ -18,13 +12,16 @@ tests/cases/compiler/promiseTypeInference.ts(10,39): error TS2322: Type 'IPromis declare function convert(s: string): IPromise; var $$x = load("something").then(s => convert(s)); - ~~~~~~~~~~ -!!! error TS2322: Type 'IPromise' is not assignable to type 'number | PromiseLike'. -!!! error TS2322: Type 'IPromise' is not assignable to type 'PromiseLike'. -!!! error TS2322: Types of property 'then' are incompatible. -!!! error TS2322: Type '(success?: (value: number) => IPromise) => IPromise' is not assignable to type '(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. -!!! error TS2322: Types of parameters 'success' and 'onfulfilled' are incompatible. -!!! error TS2322: Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. -!!! error TS2322: Type 'TResult1' is not assignable to type 'IPromise'. -!!! related TS6502 /.ts/lib.es5.d.ts:1406:57: The expected type comes from the return type of this signature. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/promiseTypeInference.ts:10:39: Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. + Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +!!! related TS2757 tests/cases/compiler/promiseTypeInference.ts:10:39: Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. + Type 'IPromise' is not assignable to type 'number | PromiseLike'. + Type 'IPromise' is not assignable to type 'PromiseLike'. + Types of property 'then' are incompatible. + Type '(success?: (value: number) => IPromise) => IPromise' is not assignable to type '(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. + Types of parameters 'success' and 'onfulfilled' are incompatible. + Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. + Type 'TResult1' is not assignable to type 'IPromise'. \ No newline at end of file diff --git a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt index dbc1e42c572..d49b31bc38d 100644 --- a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt +++ b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt @@ -1,11 +1,6 @@ -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,36): error TS2322: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. - Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. - Type 'void' is not assignable to type 'boolean'. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,41): error TS2322: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. - Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. - Type 'void' is not assignable to type 'boolean'. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. - Type 'void' is not assignable to type 'boolean'. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,22): error TS2755: No suitable overload for this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: No suitable overload for this call. ==== tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx (3 errors) ==== @@ -36,11 +31,15 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2322: // Error: Void not assignable to boolean const Test2 = () => console.log(value)} />; - ~~~~ -!!! error TS2322: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. -!!! error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -!!! error TS2322: Type 'void' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:27:36: Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. +!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:27:36: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. class FieldFeedbackBeta

extends React.Component

{ static defaultProps: BaseProps = { @@ -57,11 +56,15 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2322: // Error: Void not assignable to boolean const Test2a = () => console.log(value)} error>Hah; - ~~~~ -!!! error TS2322: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. -!!! error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -!!! error TS2322: Type 'void' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, "when" | "error">> & Partial>' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:43:41: Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. +!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:43:41: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. interface MyPropsProps extends Props { when: (value: string) => boolean; @@ -83,10 +86,13 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2322: // Error: Void not assignable to boolean const Test4 = () => console.log(value)} />; - ~~~~ -!!! error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -!!! error TS2322: Type 'void' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:64:37: Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. +!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:64:37: Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. // OK const Test5 = () => ; diff --git a/tests/baselines/reference/strictBindCallApply1.errors.txt b/tests/baselines/reference/strictBindCallApply1.errors.txt index 7b13d5e3181..c673a2b26ea 100644 --- a/tests/baselines/reference/strictBindCallApply1.errors.txt +++ b/tests/baselines/reference/strictBindCallApply1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/functions/strictBindCallApply1.ts(11,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2755: No suitable overload for this call. tests/cases/conformance/functions/strictBindCallApply1.ts(17,11): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(18,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(19,44): error TS2554: Expected 3 arguments, but got 4. @@ -8,8 +8,8 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(23,37): error TS2322: tests/cases/conformance/functions/strictBindCallApply1.ts(24,32): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. -tests/cases/conformance/functions/strictBindCallApply1.ts(41,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(42,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. +tests/cases/conformance/functions/strictBindCallApply1.ts(41,11): error TS2755: No suitable overload for this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(42,11): error TS2755: No suitable overload for this call. tests/cases/conformance/functions/strictBindCallApply1.ts(48,11): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(49,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(50,38): error TS2554: Expected 3 arguments, but got 4. @@ -18,7 +18,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(54,26): error TS2345: tests/cases/conformance/functions/strictBindCallApply1.ts(55,31): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(56,26): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. tests/cases/conformance/functions/strictBindCallApply1.ts(57,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. -tests/cases/conformance/functions/strictBindCallApply1.ts(62,33): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(62,11): error TS2755: No suitable overload for this call. tests/cases/conformance/functions/strictBindCallApply1.ts(65,1): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(66,15): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(67,24): error TS2554: Expected 3 arguments, but got 4. @@ -39,8 +39,15 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f01 = foo.bind(undefined, 10); let f02 = foo.bind(undefined, 10, "hello"); let f03 = foo.bind(undefined, 10, 20); // Error - ~~ -!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:11:35: Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. + Argument of type '20' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:11:11: Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. + The 'this' context of type '(a: number, b: string) => string' is not assignable to method's 'this' of type '(this: undefined, ...args: (10 | 20)[]) => string'. + Types of parameters 'b' and 'args' are incompatible. + Type '10 | 20' is not assignable to type 'string'. + Type '10' is not assignable to type 'string'. let f04 = overloaded.bind(undefined); // typeof overloaded let f05 = generic.bind(undefined); // typeof generic @@ -86,11 +93,25 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f11 = c.foo.bind(c, 10); let f12 = c.foo.bind(c, 10, "hello"); let f13 = c.foo.bind(c, 10, 20); // Error - ~~ -!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:41:29: Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. + Argument of type '20' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:41:11: Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. + The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (10 | 20)[]) => string'. + Types of parameters 'b' and 'args' are incompatible. + Type '10 | 20' is not assignable to type 'string'. + Type '10' is not assignable to type 'string'. let f14 = c.foo.bind(undefined); // Error - ~~~~~~~~~ -!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:42:22: Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type 'C'. +!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:42:11: Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. + The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (string | number)[]) => string'. + Types of parameters 'a' and 'args' are incompatible. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded let f16 = c.generic.bind(c); // typeof C.prototype.generic @@ -127,8 +148,15 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f21 = C.bind(undefined, 10); let f22 = C.bind(undefined, 10, "hello"); let f23 = C.bind(undefined, 10, 20); // Error - ~~ -!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:62:33: Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. + Argument of type '20' is not assignable to parameter of type 'string'. +!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:62:11: Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. + The 'this' context of type 'typeof C' is not assignable to method's 'this' of type 'new (...args: (10 | 20)[]) => C'. + Types of parameters 'b' and 'args' are incompatible. + Type '10 | 20' is not assignable to type 'string'. + Type '10' is not assignable to type 'string'. C.call(c, 10, "hello"); C.call(c, 10); // Error From 66244f793763e0b83f6df237389d8a612584a707 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 25 Jun 2019 13:57:30 -0700 Subject: [PATCH 11/26] Don't double-check JSX calls The JSX code path stands on its own --- src/compiler/checker.ts | 14 +- ...elessFunctionComponentOverload4.errors.txt | 147 ++++++++++++------ ...elessFunctionComponentOverload5.errors.txt | 21 ++- ...ionComponentsWithTypeArguments4.errors.txt | 31 ++-- 4 files changed, 139 insertions(+), 74 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f1aa67ab00f..257c660716b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21201,13 +21201,11 @@ namespace ts { const errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } = { errors: undefined, skipLogging: true }; if (isJsxOpeningLikeElement(node)) { - const r = checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain, errorOutputContainer); - if (!r) { - if (reportErrors) { - Debug.assert(!!errorOutputContainer.errors, "has error 0"); - } + if (!checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain, errorOutputContainer)) { + Debug.assert(!reportErrors || !!errorOutputContainer.errors, "jsx should have errors when reporting errors"); return errorOutputContainer.errors || []; } + return undefined; } const thisType = getThisTypeOfSignature(signature); if (thisType && thisType !== voidType && node.kind !== SyntaxKind.NewExpression) { @@ -21219,7 +21217,7 @@ namespace ts { 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; if (!checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer)) { - Debug.assert(!reportErrors || !!errorOutputContainer.errors, "has error 1"); // CLEAR + Debug.assert(!reportErrors || !!errorOutputContainer.errors, "this parameter should have errors when reporting errors"); return errorOutputContainer.errors || []; } } @@ -21236,7 +21234,7 @@ namespace ts { // parameter types yet and therefore excess property checks may yield false positives (see #17041). const checkArgType = checkMode & CheckMode.SkipContextSensitive ? getRegularTypeOfObjectLiteral(argType) : argType; if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain, errorOutputContainer)) { - Debug.assert(!reportErrors || !!errorOutputContainer.errors, "has error 2"); // CLEAR + Debug.assert(!reportErrors || !!errorOutputContainer.errors, "parameter should have errors when reporting errors"); return errorOutputContainer.errors || []; } } @@ -21245,7 +21243,7 @@ namespace ts { const spreadType = getSpreadArgumentType(args, argCount, args.length, restType, /*context*/ undefined); const errorNode = reportErrors ? argCount < args.length ? args[argCount] : node : undefined; if (!checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, undefined, errorOutputContainer)) { - Debug.assert(!reportErrors || !!errorOutputContainer.errors, "has error 3"); // CLEAR + Debug.assert(!reportErrors || !!errorOutputContainer.errors, "rest parameter should have errors when reporting errors"); return errorOutputContainer.errors || []; } } diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt index 733bb200e99..e1969542774 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt @@ -1,18 +1,14 @@ -tests/cases/conformance/jsx/file.tsx(12,13): error TS2322: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. - Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -tests/cases/conformance/jsx/file.tsx(13,13): error TS2741: Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. -tests/cases/conformance/jsx/file.tsx(14,31): error TS2322: Type 'true' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(16,13): error TS2322: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. - Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -tests/cases/conformance/jsx/file.tsx(17,13): error TS2322: Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. - Types of property 'yy' are incompatible. - Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(25,13): error TS2741: Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. -tests/cases/conformance/jsx/file.tsx(26,40): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(33,32): error TS2322: Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/file.tsx(34,29): error TS2322: Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/file.tsx(35,29): error TS2322: Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/file.tsx(36,29): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(12,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(13,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(14,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(16,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(17,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(25,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(26,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(33,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(34,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(35,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No suitable overload for this call. ==== tests/cases/conformance/jsx/file.tsx (11 errors) ==== @@ -28,27 +24,49 @@ tests/cases/conformance/jsx/file.tsx(36,29): error TS2322: Type 'string' is not // Error const c0 = ; // extra property; - ~~~~~~~~ -!!! error TS2322: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -!!! error TS2322: Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:12:13: Overload 1 of 2, '(): Element', gave the following error. + Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. + Property 'extraProp' does not exist on type 'IntrinsicAttributes'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:12:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. + Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. const c1 = ; // missing property; - ~~~~~~~~ -!!! error TS2741: Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. -!!! related TS2728 tests/cases/conformance/jsx/file.tsx:3:43: 'yy1' is declared here. + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:13:13: Overload 1 of 2, '(): Element', gave the following error. + Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. + Property 'yy' does not exist on type 'IntrinsicAttributes'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:13:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. const c2 = ; // type incompatible; - ~~~ -!!! error TS2322: Type 'true' is not assignable to type 'string'. -!!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:43: The expected type comes from property 'yy1' which is declared here on type 'IntrinsicAttributes & { yy: number; yy1: string; }' + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:14:13: Overload 1 of 2, '(): Element', gave the following error. + Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'. + Property 'yy1' does not exist on type 'IntrinsicAttributes'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:14:31: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Type 'true' is not assignable to type 'string'. const c3 = ; // This is OK becuase all attribute are spread const c4 = ; // extra property; - ~~~~~~~~ -!!! error TS2322: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -!!! error TS2322: Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:16:13: Overload 1 of 2, '(): Element', gave the following error. + Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'. + Property 'y1' does not exist on type 'IntrinsicAttributes'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:16:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. + Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. const c5 = ; // type incompatible; - ~~~~~~~~ -!!! error TS2322: Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. -!!! error TS2322: Types of property 'yy' are incompatible. -!!! error TS2322: Type 'boolean' is not assignable to type 'number'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:17:13: Overload 1 of 2, '(): Element', gave the following error. + Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:17:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. + Types of property 'yy' are incompatible. + Type 'boolean' is not assignable to type 'number'. const c6 = ; // Should error as there is extra attribute that doesn't match any. Current it is not const c7 = ; // Should error as there is extra attribute that doesn't match any. Current it is not @@ -57,13 +75,20 @@ tests/cases/conformance/jsx/file.tsx(36,29): error TS2322: Type 'string' is not // Error const d1 = - ~~~~~~~~~~~~~~~ -!!! error TS2741: Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. -!!! related TS2728 tests/cases/conformance/jsx/file.tsx:22:38: 'yy' is declared here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:25:29: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. + Type 'true' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:25:13: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. + Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. const d2 = - ~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. -!!! related TS6500 tests/cases/conformance/jsx/file.tsx:22:50: The expected type comes from property 'direction' which is declared here on type 'IntrinsicAttributes & { yy: string; direction?: number; }' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:26:13: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. + Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. + Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:26:40: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. + Type 'string' is not assignable to type 'number'. declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element; declare function TestingOptional(a: {y1?: string, y2?: number, children: JSX.Element}): JSX.Element; @@ -71,19 +96,43 @@ tests/cases/conformance/jsx/file.tsx(36,29): error TS2322: Type 'string' is not // Error const e1 = - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:64: The expected type comes from property 'y3' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:33:29: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type 'true' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:33:29: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + Type 'true' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:33:32: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. + Type 'string' is not assignable to type 'boolean'. const e2 = - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:34:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:34:13: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. + Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:34:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. + Type 'string' is not assignable to type 'boolean'. const e3 = - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:35:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:35:50: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + Type 'string' is not assignable to type 'Element'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:35:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. + Type 'string' is not assignable to type 'boolean'. const e4 = Hi - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:36:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:36:50: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:36:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. + Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt index 9a5486fa8bf..1b3b140d458 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt @@ -72,15 +72,21 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No suitable overload const b6 = ; // incorrect type for optional attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No suitable overload for this call. -!!! related TS2322 tests/cases/conformance/jsx/file.tsx:54:51: Type 'number' is not assignable to type 'string'. -!!! related TS2322 tests/cases/conformance/jsx/file.tsx:54:51: Type 'number' is not assignable to type 'string'. -!!! related TS2322 tests/cases/conformance/jsx/file.tsx:54:51: Type 'number' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:54:51: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Type 'number' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:54:51: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Type 'number' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:54:51: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. + Type 'number' is not assignable to type 'string'. const b7 = ; // incorrect type for optional attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No suitable overload for this call. -!!! related TS2322 tests/cases/conformance/jsx/file.tsx:55:68: Type 'true' is not assignable to type 'string'. -!!! related TS2322 tests/cases/conformance/jsx/file.tsx:55:68: Type 'true' is not assignable to type 'string'. -!!! related TS2322 tests/cases/conformance/jsx/file.tsx:55:68: Type 'true' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:55:68: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Type 'true' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:55:68: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Type 'true' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:55:68: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. + Type 'true' is not assignable to type 'string'. const b8 = ; // incorrect type for specified hyphanated name ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No suitable overload for this call. @@ -88,4 +94,5 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No suitable overload Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'. !!! related TS2757 tests/cases/conformance/jsx/file.tsx:56:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'. -!!! related TS2322 tests/cases/conformance/jsx/file.tsx:56:24: Type 'true' is not assignable to type 'string'. \ No newline at end of file +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:56:24: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. + Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt index 38d4435a46d..d956253311b 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt @@ -1,6 +1,5 @@ -tests/cases/conformance/jsx/file.tsx(9,15): error TS2741: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. -tests/cases/conformance/jsx/file.tsx(10,15): error TS2322: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. - Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. +tests/cases/conformance/jsx/file.tsx(9,14): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(10,14): error TS2755: No suitable overload for this call. ==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== @@ -13,12 +12,24 @@ tests/cases/conformance/jsx/file.tsx(10,15): error TS2322: Type 'T & { ignore-pr // Error function Baz(arg1: T, arg2: U) { let a0 = - ~~~~~~~~~~~~~~~~~ -!!! error TS2741: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. -!!! related TS2728 tests/cases/conformance/jsx/file.tsx:5:49: 'b' is declared here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:9:15: Overload 1 of 3, '(): Element', gave the following error. + Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. + Property 'a' does not exist on type 'IntrinsicAttributes'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:9:33: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. + Type 'number' is not assignable to type 'string'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:9:15: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. + Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. let a2 = // missing a - ~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. -!!! error TS2322: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. -!!! related TS2728 tests/cases/conformance/jsx/file.tsx:5:55: 'a' is declared here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2755: No suitable overload for this call. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:10:15: Overload 1 of 3, '(): Element', gave the following error. + Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:10:15: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. + Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }'. + Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: string; "ignore-prop": boolean; }'. +!!! related TS2757 tests/cases/conformance/jsx/file.tsx:10:15: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. + Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. + Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. } \ No newline at end of file From b58932e638ee8ffe96facbfbaedc14c4a15ccacb Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 25 Jun 2019 14:54:43 -0700 Subject: [PATCH 12/26] Fix lint and remove done TODOs --- src/compiler/checker.ts | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 42364fb1a80..ea2b0ecd199 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11706,8 +11706,6 @@ namespace ts { containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, errorOutputContainer: { errors?: Diagnostic[], skipLogging?: boolean } | undefined ): boolean { - // TODO: The first case probably still needs to set errorOutputContainer.error to something - // TODO: Make sure all error logging in dynamic scope sets errorOutputContainer.error instead if (!node || isOrHasGenericConditional(target)) return false; if (!checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined) && elaborateDidYouMeanToCallOrConstruct(node, source, target, relation, headMessage, containingMessageChain, errorOutputContainer)) { @@ -11958,7 +11956,7 @@ namespace ts { if (moreThanOneRealChildren) { if (arrayLikeTargetParts !== neverType) { const realSource = createTupleType(checkJsxChildren(containingElement, CheckMode.Normal)); - const children = generateJsxChildren(containingElement, getInvalidTextualChildDiagnostic) + const children = generateJsxChildren(containingElement, getInvalidTextualChildDiagnostic); result = elaborateElementwise(children, realSource, arrayLikeTargetParts, relation, containingMessageChain, errorOutputContainer) || result; } else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { @@ -12418,7 +12416,7 @@ namespace ts { return getObjectFlags(source) & ObjectFlags.JsxAttributes && !isUnhyphenatedJsxName(sourceProp.escapedName); } - /** + /** * Checks if 'source' is related to 'target' (e.g.: is a assignable to). * @param source The left-hand-side of the relation. * @param target The right-hand-side of the relation. @@ -21207,7 +21205,15 @@ namespace ts { // 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, containingMessageChain, errorOutputContainer); + return checkTypeRelatedToAndOptionallyElaborate( + attributesType, + paramType, + relation, + reportErrors ? node.tagName : undefined, + node.attributes, + /*headMessage*/ undefined, + containingMessageChain, + errorOutputContainer); } function getSignatureApplicabilityError( @@ -21263,7 +21269,7 @@ namespace ts { if (restType) { const spreadType = getSpreadArgumentType(args, argCount, args.length, restType, /*context*/ undefined); const errorNode = reportErrors ? argCount < args.length ? args[argCount] : node : undefined; - if (!checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, undefined, errorOutputContainer)) { + if (!checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, /*containingMessageChain*/ undefined, errorOutputContainer)) { Debug.assert(!reportErrors || !!errorOutputContainer.errors, "rest parameter should have errors when reporting errors"); return errorOutputContainer.errors || []; } @@ -21600,34 +21606,38 @@ namespace ts { if (candidatesForArgumentError) { if (candidatesForArgumentError.length === 1 || candidatesForArgumentError.length > 3) { const last = candidatesForArgumentError[candidatesForArgumentError.length - 1]; - let chain: DiagnosticMessageChain | undefined = undefined; + let chain: DiagnosticMessageChain | undefined; if (candidatesForArgumentError.length > 3) { chain = chainDiagnosticMessages(chain, Diagnostics.The_last_overload_gave_the_following_error); chain = chainDiagnosticMessages(chain, Diagnostics.No_suitable_overload_for_this_call); } const ds = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); - Debug.assert(!!ds, "No error for last signature"); if (ds) { // if elaboration already displayed the error, don't do anything extra // note that we could do this always here, but getSignatureApplicabilityError is currently not configured to do that - for (const d of ds as Diagnostic[]) { + for (const d of ds) { diagnostics.add(d); } } + else { + Debug.assert(false, "No error for last overload signature"); + } } else { const related: DiagnosticRelatedInformation[] = []; let i = 0; for (const c of candidatesForArgumentError) { i++; - const chain = () => chainDiagnosticMessages(undefined, Diagnostics.Overload_0_of_1_2_gave_the_following_error, i, candidates.length, signatureToString(c)); + const chain = () => chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Overload_0_of_1_2_gave_the_following_error, i, candidates.length, signatureToString(c)); const ds = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, chain); - Debug.assert(!!ds, "No error for signature (1)"); if (ds) { - related.push(...ds as Diagnostic[]) + related.push(...ds); + } + else { + Debug.assert(false, "No error for 3 or fewer overload signatures"); } } - diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.No_suitable_overload_for_this_call), related)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(/*details*/ undefined, Diagnostics.No_suitable_overload_for_this_call), related)); } } else if (candidateForArgumentArityError) { From 68968fd396326a4a5ba1418ab24e576f11eb8c46 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 26 Jun 2019 10:05:44 -0700 Subject: [PATCH 13/26] Improve error messages and related spans --- src/compiler/checker.ts | 25 +-- src/compiler/diagnosticMessages.json | 18 +- .../reference/bigintWithLib.errors.txt | 20 +-- .../checkJsxChildrenCanBeTupleType.errors.txt | 8 +- .../constructorOverloads1.errors.txt | 16 +- ...StringLiteralsInJsxAttributes02.errors.txt | 32 ++-- .../controlFlowIterationErrors.errors.txt | 16 +- tests/baselines/reference/for-of39.errors.txt | 8 +- .../reference/functionOverloads2.errors.txt | 8 +- .../reference/functionOverloads40.errors.txt | 8 +- .../reference/functionOverloads41.errors.txt | 8 +- ...edMethodWithOverloadedArguments.errors.txt | 26 +-- .../heterogeneousArrayAndOverloads.errors.txt | 12 +- .../reference/incompatibleTypes.errors.txt | 16 +- ...ritedConstructorWithRestParams2.errors.txt | 16 +- .../iterableArrayPattern28.errors.txt | 8 +- .../iteratorSpreadInArray6.errors.txt | 8 +- ...attersForSignatureGroupIdentity.errors.txt | 16 +- .../baselines/reference/overload1.errors.txt | 8 +- .../reference/overloadResolution.errors.txt | 24 +-- ...loadResolutionClassConstructors.errors.txt | 8 +- .../overloadResolutionConstructors.errors.txt | 24 +-- .../overloadResolutionTest1.errors.txt | 24 +-- .../overloadingOnConstants2.errors.txt | 8 +- ...nWithConstraintCheckingDeferred.errors.txt | 10 +- .../overloadsWithProvisionalErrors.errors.txt | 16 +- .../reference/promisePermutations.errors.txt | 165 +++++++++++------- .../reference/promisePermutations2.errors.txt | 60 ++++--- .../reference/promisePermutations3.errors.txt | 105 ++++++----- .../reference/promiseTypeInference.errors.txt | 8 +- ...actDefaultPropsInferenceSuccess.errors.txt | 24 +-- .../recursiveFunctionTypes.errors.txt | 10 +- ...edSignatureAsCallbackParameter1.errors.txt | 16 +- .../reference/strictBindCallApply1.errors.txt | 32 ++-- ...eStringsWithOverloadResolution1.errors.txt | 32 ++-- ...ingsWithOverloadResolution1_ES6.errors.txt | 32 ++-- ...eStringsWithOverloadResolution3.errors.txt | 24 +-- ...ingsWithOverloadResolution3_ES6.errors.txt | 24 +-- .../tsxElementResolution9.errors.txt | 24 +-- .../tsxNotUsingApparentTypeOfSFC.errors.txt | 8 +- ...elessFunctionComponentOverload4.errors.txt | 96 +++++----- ...elessFunctionComponentOverload5.errors.txt | 40 ++--- ...ionComponentsWithTypeArguments4.errors.txt | 20 +-- .../reference/underscoreTest1.errors.txt | 8 +- .../unionTypeCallSignatures.errors.txt | 16 +- .../unionTypeConstructSignatures.errors.txt | 16 +- 46 files changed, 615 insertions(+), 536 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ea2b0ecd199..e26a8a46436 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21609,18 +21609,19 @@ namespace ts { let chain: DiagnosticMessageChain | undefined; if (candidatesForArgumentError.length > 3) { chain = chainDiagnosticMessages(chain, Diagnostics.The_last_overload_gave_the_following_error); - chain = chainDiagnosticMessages(chain, Diagnostics.No_suitable_overload_for_this_call); + chain = chainDiagnosticMessages(chain, Diagnostics.No_overload_matches_this_call); } - const ds = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); - if (ds) { - // if elaboration already displayed the error, don't do anything extra - // note that we could do this always here, but getSignatureApplicabilityError is currently not configured to do that - for (const d of ds) { + const diags = getSignatureApplicabilityError(node, args, last, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, () => chain); + if (diags) { + for (const d of diags) { + if (last.declaration && candidatesForArgumentError.length > 3) { + addRelatedInfo(d, createDiagnosticForNode(last.declaration, Diagnostics.The_last_overload_is_declared_here)); + } diagnostics.add(d); } } else { - Debug.assert(false, "No error for last overload signature"); + Debug.fail("No error for last overload signature"); } } else { @@ -21629,15 +21630,15 @@ namespace ts { for (const c of candidatesForArgumentError) { i++; const chain = () => chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Overload_0_of_1_2_gave_the_following_error, i, candidates.length, signatureToString(c)); - const ds = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, chain); - if (ds) { - related.push(...ds); + const diags = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, chain); + if (diags) { + related.push(...diags); } else { - Debug.assert(false, "No error for 3 or fewer overload signatures"); + Debug.fail("No error for 3 or fewer overload signatures"); } } - diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(/*details*/ undefined, Diagnostics.No_suitable_overload_for_this_call), related)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(/*details*/ undefined, Diagnostics.No_overload_matches_this_call), related)); } } else if (candidateForArgumentArityError) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 7d2a344c777..8dbc74c6b12 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2621,18 +2621,30 @@ "category": "Error", "code": 2754 }, - "No suitable overload for this call.": { + "No overload matches this call.": { "category": "Error", "code": 2755 }, - "The last overload gave the following error.": { + "The closest overload gave the following error.": { "category": "Error", "code": 2756 }, - "Overload {0} of {1}, '{2}', gave the following error.": { + "The closest overload is declared here.": { "category": "Error", "code": 2757 }, + "The last overload gave the following error.": { + "category": "Error", + "code": 2758 + }, + "The last overload is declared here.": { + "category": "Error", + "code": 2759 + }, + "Overload {0} of {1}, '{2}', gave the following error.": { + "category": "Error", + "code": 2760 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/tests/baselines/reference/bigintWithLib.errors.txt b/tests/baselines/reference/bigintWithLib.errors.txt index c716a1dda26..836e2397ae3 100644 --- a/tests/baselines/reference/bigintWithLib.errors.txt +++ b/tests/baselines/reference/bigintWithLib.errors.txt @@ -1,7 +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,15): error TS2755: No suitable overload for this call. +tests/cases/compiler/bigintWithLib.ts(16,15): error TS2755: No overload matches 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,16): error TS2755: No suitable overload for this call. +tests/cases/compiler/bigintWithLib.ts(28,16): error TS2755: No overload matches 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'. @@ -27,10 +27,10 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 bigIntArray = new BigInt64Array([1n, 2n, 3n]); bigIntArray = new BigInt64Array([1, 2, 3]); // should error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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): BigInt64Array', gave the following error. +!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. Types of property '[Symbol.iterator]' are incompatible. Type '() => IterableIterator' is not assignable to type '() => Iterator'. @@ -39,7 +39,7 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. Type 'IteratorResult' is not assignable to type 'IteratorResult'. 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. +!!! related TS2760 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)); @@ -57,12 +57,12 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 bigUintArray = new BigUint64Array([1n, 2n, 3n]); bigUintArray = new BigUint64Array([1, 2, 3]); // should error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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): BigUint64Array', gave the following error. +!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. -!!! 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. +!!! related TS2760 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)); diff --git a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt index 8348b2cfe11..5e38aa9c574 100644 --- a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2755: No overload matches this call. ==== tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx (1 errors) ==== @@ -20,14 +20,14 @@ tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2 const testErr = ~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx:17:18: Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx:17:18: Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. 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. +!!! related TS2760 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'. Types of property 'children' are incompatible. Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. diff --git a/tests/baselines/reference/constructorOverloads1.errors.txt b/tests/baselines/reference/constructorOverloads1.errors.txt index 2a1dc25f0c2..5f560ff38d8 100644 --- a/tests/baselines/reference/constructorOverloads1.errors.txt +++ b/tests/baselines/reference/constructorOverloads1.errors.txt @@ -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,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(16,10): error TS2755: No overload matches this call. +tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2755: No overload matches this call. ==== tests/cases/compiler/constructorOverloads1.ts (6 errors) ==== @@ -36,17 +36,17 @@ tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2755: No suitable var f2 = new Foo(0); var f3 = new Foo(f1); ~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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(); diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt index 890eb71337f..73fc41eeaf8 100644 --- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt @@ -1,7 +1,7 @@ -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(27,12): error TS2755: No overload matches this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,12): error TS2755: No overload matches this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,12): error TS2755: No overload matches this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,12): error TS2755: No overload matches 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'. @@ -37,38 +37,38 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): err const b0 = {console.log(k)}}} extra />; // k has type "left" | "right" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 = {console.log(k)}} extra />; // k has type "left" | "right" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 = ; // goTo has type"home" | "contact" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 = ; // goTo has type "home" | "contact" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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'. diff --git a/tests/baselines/reference/controlFlowIterationErrors.errors.txt b/tests/baselines/reference/controlFlowIterationErrors.errors.txt index aaf153f3b44..4ce7e28a5d1 100644 --- a/tests/baselines/reference/controlFlowIterationErrors.errors.txt +++ b/tests/baselines/reference/controlFlowIterationErrors.errors.txt @@ -2,8 +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,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(34,13): error TS2755: No overload matches this call. +tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error TS2755: No overload matches this call. ==== tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts (4 errors) ==== @@ -48,11 +48,11 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error while (cond) { x = foo(x); ~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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; @@ -67,11 +67,11 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error x; x = foo(x); ~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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'. } diff --git a/tests/baselines/reference/for-of39.errors.txt b/tests/baselines/reference/for-of39.errors.txt index d5e48579c28..36bdbdf9447 100644 --- a/tests/baselines/reference/for-of39.errors.txt +++ b/tests/baselines/reference/for-of39.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2755: No overload matches this call. ==== tests/cases/conformance/es6/for-ofStatements/for-of39.ts (1 errors) ==== var map = new Map([["", true], ["", 0]]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:19: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:19: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable'. Types of property '[Symbol.iterator]' are incompatible. Type '() => IterableIterator<[string, number] | [string, true]>' is not assignable to type '() => Iterator'. @@ -17,7 +17,7 @@ tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2755: No Type '[string, number]' is not assignable to type 'readonly [string, boolean]'. Types of property '1' are incompatible. Type 'number' is not assignable to type 'boolean'. -!!! related TS2757 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:37: Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:37: Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map', gave the following error. Type 'number' is not assignable to type 'boolean'. for (var [k, v] of map) { k; diff --git a/tests/baselines/reference/functionOverloads2.errors.txt b/tests/baselines/reference/functionOverloads2.errors.txt index 71149141f45..913c3cb49e3 100644 --- a/tests/baselines/reference/functionOverloads2.errors.txt +++ b/tests/baselines/reference/functionOverloads2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads2.ts(4,9): error TS2755: No suitable overload for this call. +tests/cases/compiler/functionOverloads2.ts(4,9): error TS2755: No overload matches this call. ==== tests/cases/compiler/functionOverloads2.ts (1 errors) ==== @@ -7,8 +7,8 @@ tests/cases/compiler/functionOverloads2.ts(4,9): error TS2755: No suitable overl function foo(bar: any): any { return bar }; var x = foo(true); ~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt index b0706ed9650..9e99d383746 100644 --- a/tests/baselines/reference/functionOverloads40.errors.txt +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No suitable overload for this call. +tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No overload matches this call. ==== tests/cases/compiler/functionOverloads40.ts (1 errors) ==== @@ -7,9 +7,9 @@ tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No suitable over function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{a:'bar'}]); ~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. Type 'string' is not assignable to type 'number'. -!!! related TS2757 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. +!!! related TS2760 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads41.errors.txt b/tests/baselines/reference/functionOverloads41.errors.txt index 430a6e295c6..95b3296e5c9 100644 --- a/tests/baselines/reference/functionOverloads41.errors.txt +++ b/tests/baselines/reference/functionOverloads41.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No suitable overload for this call. +tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No overload matches this call. ==== tests/cases/compiler/functionOverloads41.ts (1 errors) ==== @@ -7,9 +7,9 @@ tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No suitable over function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{}]); ~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. Property 'a' is missing in type '{}' but required in type '{ a: number; }'. -!!! related TS2757 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. +!!! related TS2760 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt index 064ced0b442..9c1f49a581b 100644 --- a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt +++ b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(23,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -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(52,22): error TS2755: No overload matches this call. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(68,22): error TS2755: No overload matches this call. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(84,22): error TS2755: No overload matches this call. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts (4 errors) ==== @@ -64,12 +64,12 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 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): Promise', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:52:38: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. 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, error?: (error: any) => Promise): Promise', gave the following error. +!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:52:38: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. } @@ -89,15 +89,15 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 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): Promise', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. 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, error?: (error: any) => Promise): Promise', gave the following error. +!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. -!!! related TS2757 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. +!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. } @@ -117,12 +117,12 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 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): Promise', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:84:38: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. 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, error?: (error: any) => Promise): Promise', gave the following error. +!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:84:38: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. } diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt index 8c2d8ed2617..d6ced6a25a1 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No suitable overload for this call. +tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No overload matches this call. ==== tests/cases/compiler/heterogeneousArrayAndOverloads.ts (1 errors) ==== @@ -12,14 +12,14 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No su this.test([]); this.test([1, 2, "hi", 5]); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:26: Overload 1 of 2, '(arg1: number[]): any', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:26: Overload 1 of 2, '(arg1: number[]): any', gave the following error. Type 'string' is not assignable to type 'number'. -!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:20: Overload 2 of 2, '(arg1: string[]): any', gave the following error. +!!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:20: Overload 2 of 2, '(arg1: string[]): any', gave the following error. Type 'number' is not assignable to type 'string'. -!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:23: Overload 2 of 2, '(arg1: string[]): any', gave the following error. +!!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:23: Overload 2 of 2, '(arg1: string[]): any', gave the following error. Type 'number' is not assignable to type 'string'. -!!! related TS2757 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:32: Overload 2 of 2, '(arg1: string[]): any', gave the following error. +!!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:32: Overload 2 of 2, '(arg1: string[]): any', gave the following error. Type 'number' is not assignable to type 'string'. } } \ No newline at end of file diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index b6b32526162..a9290e9988a 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -9,8 +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,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(42,1): error TS2755: No overload matches this call. +tests/cases/compiler/incompatibleTypes.ts(49,1): error TS2755: No overload matches 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'. @@ -76,13 +76,13 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => var c2: C2; if1(c1); ~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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'. @@ -95,11 +95,11 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => of1({ e: 0, f: 0 }); ~~~~~~~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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; }'. diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt index 027e9788a45..da0ca0f92f9 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt @@ -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,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(33,1): error TS2755: No overload matches this call. +tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2755: No overload matches this call. ==== tests/cases/compiler/inheritedConstructorWithRestParams2.ts (3 errors) ==== @@ -40,15 +40,15 @@ tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2755: !!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new Derived("", 3, "", 3); ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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'. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern28.errors.txt b/tests/baselines/reference/iterableArrayPattern28.errors.txt index 53e41cb1de3..a64d2b9a413 100644 --- a/tests/baselines/reference/iterableArrayPattern28.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern28.errors.txt @@ -1,12 +1,12 @@ -tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error TS2755: No overload matches this call. ==== tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts (1 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:32: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:32: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. Types of property '[Symbol.iterator]' are incompatible. Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator'. @@ -18,5 +18,5 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. Types of property '1' are incompatible. Type 'boolean' is not assignable to type 'number'. -!!! related TS2757 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:52: Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:52: Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. Type 'true' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt index 0747bd48366..6a11cc31fff 100644 --- a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2755: No overload matches this call. ==== tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts (1 errors) ==== @@ -18,13 +18,13 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2755 var array: number[] = [0, 1]; array.concat([...new SymbolIterator]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 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[]', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts:15:14: Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. 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[]', gave the following error. +!!! related TS2760 tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts:15:14: Overload 2 of 2, '(...items: (number | ConcatArray)[]): number[]', gave the following error. Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. Type 'symbol[]' is not assignable to type 'ConcatArray'. \ No newline at end of file diff --git a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt index e525d7e6276..bcab0991b08 100644 --- a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt +++ b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,1): error TS2755: No suitable overload for this call. +tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,1): error TS2755: No overload matches 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,1): error TS2755: No suitable overload for this call. +tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS2755: No overload matches this call. ==== tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts (3 errors) ==== @@ -24,11 +24,11 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS275 v({ s: "", n: 0 }).toLowerCase(); ~~~~~~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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; }'. @@ -40,10 +40,10 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS275 w({ s: "", n: 0 }).toLowerCase(); ~~~~~~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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; }'. \ No newline at end of file diff --git a/tests/baselines/reference/overload1.errors.txt b/tests/baselines/reference/overload1.errors.txt index 775e77602f3..6625de2f9a6 100644 --- a/tests/baselines/reference/overload1.errors.txt +++ b/tests/baselines/reference/overload1.errors.txt @@ -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,5): 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,3): error TS2755: No suitable overload for this call. +tests/cases/compiler/overload1.ts(34,3): error TS2755: No overload matches this call. ==== tests/cases/compiler/overload1.ts (6 errors) ==== @@ -53,10 +53,10 @@ tests/cases/compiler/overload1.ts(34,3): error TS2755: No suitable overload for !!! error TS2322: Type 'C' is not assignable to type 'string'. z=x.h(2,2); // no match ~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index 6be2c4058c9..a64c341f2cb 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,1): error TS2755: No overload matches 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,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(84,1): error TS2755: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,1): error TS2755: No overload matches 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'. @@ -39,10 +39,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // No candidate overloads found fn1({}); // Error ~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 @@ -112,17 +112,17 @@ 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index 8cf0b4e0fd6..569fe146ac8 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,1): error TS2755: No overload matches 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. @@ -43,10 +43,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru // No candidate overloads found new fn1({}); // Error ~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index 769eab3a9eb..eef196f17cb 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,1): error TS2755: No overload matches 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,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(91,1): error TS2755: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,1): error TS2755: No overload matches 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'. @@ -39,10 +39,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // No candidate overloads found new fn1({}); // Error ~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 @@ -119,17 +119,17 @@ 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt index f765e3d27d7..46f0bb623ff 100644 --- a/tests/baselines/reference/overloadResolutionTest1.errors.txt +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/overloadResolutionTest1.ts(7,12): error TS2755: No suitable overload for this call. -tests/cases/compiler/overloadResolutionTest1.ts(18,10): error TS2755: No suitable overload for this call. -tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No suitable overload for this call. +tests/cases/compiler/overloadResolutionTest1.ts(7,12): error TS2755: No overload matches this call. +tests/cases/compiler/overloadResolutionTest1.ts(18,10): error TS2755: No overload matches this call. +tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload matches this call. ==== tests/cases/compiler/overloadResolutionTest1.ts (3 errors) ==== @@ -12,10 +12,10 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No suitable var x11 = foo([{a:0}]); // works var x111 = foo([{a:"s"}]); // error - does not match any signature ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. Type 'string' is not assignable to type 'number'. -!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. +!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. Type 'string' is not assignable to type 'boolean'. var x1111 = foo([{a:null}]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string @@ -29,10 +29,10 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No suitable var x3 = foo2({a:true}); // works var x4 = foo2({a:"s"}); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. Type 'string' is not assignable to type 'number'. -!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. +!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. Type 'string' is not assignable to type 'boolean'. @@ -41,8 +41,8 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No suitable function foo4(bar:{a:any;}):any{ return bar }; var x = foo4({a:true}); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. Type 'true' is not assignable to type 'number'. -!!! related TS2757 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. +!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadingOnConstants2.errors.txt b/tests/baselines/reference/overloadingOnConstants2.errors.txt index 6d1be3d8f24..d9844b26e28 100644 --- a/tests/baselines/reference/overloadingOnConstants2.errors.txt +++ b/tests/baselines/reference/overloadingOnConstants2.errors.txt @@ -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,9): error TS2755: No suitable overload for this call. +tests/cases/compiler/overloadingOnConstants2.ts(15,9): error TS2755: No overload matches this call. tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: This overload signature is not compatible with its implementation signature. @@ -23,10 +23,10 @@ tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: This overl var b: E = foo("bye", []); // E var c = foo("um", []); // error ~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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"'. diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt index 1804a123d84..b1254d24a8a 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -3,7 +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,23): error TS2755: No suitable overload for this call. +tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,23): error TS2755: No overload matches this call. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): error TS2344: Type 'D' does not satisfy the constraint 'A'. @@ -45,15 +45,15 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): ~~~~~~~~~~~~~ }); ~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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' is not assignable to parameter of type '(x: D) => number'. Type 'G' 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. +!!! related TS2760 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' 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. +!!! related TS2760 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' 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'. diff --git a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt index 2f2d4a5f5cd..cc65c84b4a5 100644 --- a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,1): error TS2755: No suitable overload for this call. +tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,1): error TS2755: No overload matches this call. tests/cases/compiler/overloadsWithProvisionalErrors.ts(7,17): error TS2304: Cannot find name 'blah'. -tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,1): error TS2755: No suitable overload for this call. +tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,1): error TS2755: No overload matches this call. tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cannot find name 'blah'. @@ -12,20 +12,20 @@ tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cann func(s => ({})); // Error for no applicable overload (object type is missing a and b) ~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:6: Overload 1 of 2, '(s: string): number', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:6: Overload 1 of 2, '(s: string): number', gave the following error. Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. +!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) ~~~~ !!! error TS2304: Cannot find name 'blah'. func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:6: Overload 1 of 2, '(s: string): number', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:6: Overload 1 of 2, '(s: string): number', gave the following error. Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. +!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. ~~~~ !!! error TS2304: Cannot find name 'blah'. \ No newline at end of file diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index dfbc1f9a507..2a27563fa24 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -1,125 +1,125 @@ -tests/cases/compiler/promisePermutations.ts(74,70): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(74,70): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(79,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(79,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(82,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(82,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(83,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(83,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(84,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(84,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(88,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(88,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(91,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(91,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(92,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(92,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations.ts(93,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(93,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(97,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(97,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(100,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(100,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(101,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(101,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations.ts(102,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(102,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(106,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(106,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(109,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(109,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(110,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(110,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(111,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(111,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(117,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(117,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(120,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(120,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(121,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(121,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -tests/cases/compiler/promisePermutations.ts(122,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(122,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(126,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(126,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(129,33): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(129,33): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(132,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(132,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(133,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(133,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -tests/cases/compiler/promisePermutations.ts(134,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(134,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(137,33): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(137,33): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations.ts(144,35): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(144,35): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -tests/cases/compiler/promisePermutations.ts(152,36): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(152,36): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -tests/cases/compiler/promisePermutations.ts(156,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(156,21): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations.ts(158,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(158,21): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations.ts(159,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(159,21): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'Promise' is not assignable to type 'IPromise'. @@ -206,126 +206,143 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No suitable o var s3c = s3.then(testFunction3P, testFunction3, testFunction3); var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'IPromise' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var r4: IPromise; var sIPromise: (x: any) => IPromise; var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. !!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -333,68 +350,78 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No suitable o var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. 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 TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. !!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. 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 TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. !!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var r10 = testFunction10(x => x); @@ -403,9 +430,10 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No suitable o var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok ~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. 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 @@ -415,38 +443,42 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No suitable o var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. !!! error TS2755: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. !!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. !!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. !!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. !!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2755: Type 'Promise' is not assignable to type 'IPromise'. @@ -455,6 +487,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No suitable o !!! 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'. +!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index 5845b3ab9aa..7c852d4e370 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/promisePermutations2.ts(73,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations2.ts(78,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(78,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. @@ -15,46 +15,46 @@ 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' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations2.ts(87,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(87,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(90,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. tests/cases/compiler/promisePermutations2.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(96,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(96,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(99,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(100,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. tests/cases/compiler/promisePermutations2.ts(101,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(105,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(105,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(108,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(108,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(109,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(109,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(110,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(110,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(116,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(116,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(119,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(120,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations2.ts(121,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(125,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(125,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(128,33): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(128,33): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. @@ -64,12 +64,12 @@ tests/cases/compiler/promisePermutations2.ts(132,19): error TS2345: Argument of tests/cases/compiler/promisePermutations2.ts(133,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(136,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations2.ts(143,35): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(143,35): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. tests/cases/compiler/promisePermutations2.ts(151,36): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -tests/cases/compiler/promisePermutations2.ts(155,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations2.ts(155,21): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. @@ -172,11 +172,12 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error @@ -199,9 +200,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error @@ -218,9 +220,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error @@ -237,32 +240,36 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. !!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -270,9 +277,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error @@ -289,18 +297,20 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. 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 TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. !!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error @@ -326,9 +336,10 @@ 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 TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. 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 @@ -346,11 +357,12 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. !!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 1e59f21ae1b..4e00aba27b4 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/promisePermutations3.ts(68,69): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(73,70): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(73,70): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. @@ -9,39 +9,39 @@ tests/cases/compiler/promisePermutations3.ts(73,70): error TS2755: No suitable o tests/cases/compiler/promisePermutations3.ts(78,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(81,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(81,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(82,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(82,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(83,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(83,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type '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' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(90,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(90,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(91,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(91,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations3.ts(92,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(92,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations3.ts(96,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(99,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(99,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(100,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(100,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations3.ts(101,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(101,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations3.ts(105,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. @@ -55,50 +55,50 @@ 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 '(a: T) => T'. tests/cases/compiler/promisePermutations3.ts(116,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(119,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(119,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(120,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(120,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -tests/cases/compiler/promisePermutations3.ts(121,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(121,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations3.ts(125,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations3.ts(128,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(131,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(131,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(132,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(132,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -tests/cases/compiler/promisePermutations3.ts(133,19): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(133,19): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(136,33): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(136,33): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. tests/cases/compiler/promisePermutations3.ts(143,35): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(151,36): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(151,36): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. tests/cases/compiler/promisePermutations3.ts(155,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations3.ts(157,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(157,21): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations3.ts(158,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(158,21): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations3.ts(159,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/promisePermutations3.ts(159,21): error TS2755: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'Promise' is not assignable to type 'IPromise'. @@ -190,11 +190,12 @@ 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 TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'IPromise' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var r4: IPromise; var sIPromise: (x: any) => IPromise; @@ -208,25 +209,28 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. !!! error TS2755: Types of parameters 'x' and 'value' are incompatible. !!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; @@ -237,19 +241,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; @@ -260,19 +267,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; @@ -308,19 +318,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; @@ -338,27 +351,31 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. 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 TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. !!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var r10 = testFunction10(x => x); @@ -377,11 +394,12 @@ 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 TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. !!! error TS2755: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. !!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; @@ -393,20 +411,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. !!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. !!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. +!!! error TS2755: No overload matches this call. !!! error TS2755: The last overload gave the following error. !!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2755: Type 'Promise' is not assignable to type 'IPromise'. @@ -415,6 +435,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! 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'. +!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/promiseTypeInference.errors.txt b/tests/baselines/reference/promiseTypeInference.errors.txt index ebd8bcf947b..237f3067063 100644 --- a/tests/baselines/reference/promiseTypeInference.errors.txt +++ b/tests/baselines/reference/promiseTypeInference.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2755: No suitable overload for this call. +tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2755: No overload matches this call. ==== tests/cases/compiler/promiseTypeInference.ts (1 errors) ==== @@ -13,10 +13,10 @@ tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2755: No suitable o var $$x = load("something").then(s => convert(s)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/promiseTypeInference.ts:10:39: Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/promiseTypeInference.ts:10:39: Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! related TS2757 tests/cases/compiler/promiseTypeInference.ts:10:39: Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. +!!! related TS2760 tests/cases/compiler/promiseTypeInference.ts:10:39: Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. Type 'IPromise' is not assignable to type 'number | PromiseLike'. Type 'IPromise' is not assignable to type 'PromiseLike'. Types of property 'then' are incompatible. diff --git a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt index d49b31bc38d..9d8f05d7b35 100644 --- a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt +++ b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,21): error TS2755: No suitable overload for this call. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,22): error TS2755: No suitable overload for this call. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: No suitable overload for this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,21): error TS2755: No overload matches this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,22): error TS2755: No overload matches this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: No overload matches this call. ==== tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx (3 errors) ==== @@ -32,12 +32,12 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: // Error: Void not assignable to boolean const Test2 = () => console.log(value)} />; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:27:36: Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:27:36: Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. Type 'void' is not assignable to type 'boolean'. -!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:27:36: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. +!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:27:36: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. @@ -57,12 +57,12 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: // Error: Void not assignable to boolean const Test2a = () => console.log(value)} error>Hah; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:43:41: Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:43:41: Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. Type 'void' is not assignable to type 'boolean'. -!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:43:41: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. +!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:43:41: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. @@ -87,11 +87,11 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: // Error: Void not assignable to boolean const Test4 = () => console.log(value)} />; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:64:37: Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:64:37: Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. Type 'void' is not assignable to type 'boolean'. -!!! related TS2757 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:64:37: Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. +!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:64:37: Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. // OK diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt index 72821c437af..b0091454264 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.errors.txt +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -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,1): error TS2755: No suitable overload for this call. +tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2755: No overload matches this call. ==== tests/cases/compiler/recursiveFunctionTypes.ts (13 errors) ==== @@ -85,11 +85,11 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2755: No suitable !!! error TS2554: Expected 0-1 arguments, but got 2. f7(""); // ok (function takes an any param) ~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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. +!!! related TS2760 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 \ No newline at end of file diff --git a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt index 8757e85713a..86f3e1c8904 100644 --- a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt +++ b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt @@ -1,5 +1,5 @@ -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(7,1): error TS2755: No overload matches this call. +tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2755: No overload matches this call. ==== tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts (2 errors) ==== @@ -11,19 +11,19 @@ tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2 // both are errors x3(1, (x: string) => 1); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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'. \ No newline at end of file diff --git a/tests/baselines/reference/strictBindCallApply1.errors.txt b/tests/baselines/reference/strictBindCallApply1.errors.txt index e5e6fe1e850..496bee9108f 100644 --- a/tests/baselines/reference/strictBindCallApply1.errors.txt +++ b/tests/baselines/reference/strictBindCallApply1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2755: No suitable overload for this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2755: No overload matches this call. tests/cases/conformance/functions/strictBindCallApply1.ts(17,15): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(18,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(19,44): error TS2554: Expected 3 arguments, but got 4. @@ -8,8 +8,8 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(23,37): error TS2322: tests/cases/conformance/functions/strictBindCallApply1.ts(24,32): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. -tests/cases/conformance/functions/strictBindCallApply1.ts(41,11): error TS2755: No suitable overload for this call. -tests/cases/conformance/functions/strictBindCallApply1.ts(42,11): error TS2755: No suitable overload for this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(41,11): error TS2755: No overload matches this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(42,11): error TS2755: No overload matches this call. tests/cases/conformance/functions/strictBindCallApply1.ts(48,17): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(49,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(50,38): error TS2554: Expected 3 arguments, but got 4. @@ -18,7 +18,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(54,26): error TS2345: tests/cases/conformance/functions/strictBindCallApply1.ts(55,31): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(56,26): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. tests/cases/conformance/functions/strictBindCallApply1.ts(57,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. -tests/cases/conformance/functions/strictBindCallApply1.ts(62,11): error TS2755: No suitable overload for this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(62,11): error TS2755: No overload matches this call. tests/cases/conformance/functions/strictBindCallApply1.ts(65,3): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(66,15): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(67,24): error TS2554: Expected 3 arguments, but got 4. @@ -40,10 +40,10 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f02 = foo.bind(undefined, 10, "hello"); let f03 = foo.bind(undefined, 10, 20); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:11:35: Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:11:35: Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. Argument of type '20' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:11:11: Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. +!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:11:11: Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. The 'this' context of type '(a: number, b: string) => string' is not assignable to method's 'this' of type '(this: undefined, ...args: (10 | 20)[]) => string'. Types of parameters 'b' and 'args' are incompatible. Type '10 | 20' is not assignable to type 'string'. @@ -94,20 +94,20 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f12 = c.foo.bind(c, 10, "hello"); let f13 = c.foo.bind(c, 10, 20); // Error ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:41:29: Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:41:29: Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. Argument of type '20' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:41:11: Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. +!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:41:11: Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (10 | 20)[]) => string'. Types of parameters 'b' and 'args' are incompatible. Type '10 | 20' is not assignable to type 'string'. Type '10' is not assignable to type 'string'. let f14 = c.foo.bind(undefined); // Error ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:42:22: Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:42:22: Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. Argument of type 'undefined' is not assignable to parameter of type 'C'. -!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:42:11: Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. +!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:42:11: Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (string | number)[]) => string'. Types of parameters 'a' and 'args' are incompatible. Type 'string | number' is not assignable to type 'number'. @@ -149,10 +149,10 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f22 = C.bind(undefined, 10, "hello"); let f23 = C.bind(undefined, 10, 20); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:62:33: Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:62:33: Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. Argument of type '20' is not assignable to parameter of type 'string'. -!!! related TS2757 tests/cases/conformance/functions/strictBindCallApply1.ts:62:11: Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. +!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:62:11: Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. The 'this' context of type 'typeof C' is not assignable to method's 'this' of type 'new (...args: (10 | 20)[]) => C'. Types of parameters 'b' and 'args' are incompatible. Type '10 | 20' is not assignable to type 'string'. diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt index 187d7dab5cc..c8528ceaf93 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt @@ -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,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(11,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,9): error TS2755: No overload matches 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,9): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,9): error TS2755: No overload matches this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4. @@ -28,24 +28,24 @@ 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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) ~ @@ -56,10 +56,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var w = foo `${1}${2}`; // boolean var x = foo `${1}${true}`; // boolean (with error) ~~~~~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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) diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt index 150c66be410..b103d9eef9e 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt @@ -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,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(11,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,9): error TS2755: No overload matches 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,9): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,9): error TS2755: No overload matches this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4. @@ -28,24 +28,24 @@ 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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) ~ @@ -56,10 +56,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var w = foo `${1}${2}`; // boolean var x = foo `${1}${true}`; // boolean (with error) ~~~~~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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) diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt index 4d5ec42700c..06986bf66f7 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(9,1): error TS2755: No suitable overload for this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(9,1): error TS2755: No overload matches 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,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(62,1): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,1): error TS2755: No overload matches this call. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(69,18): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -17,10 +17,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // No candidate overloads found fn1 `${ {} }`; // Error ~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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; @@ -81,17 +81,17 @@ 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt index 2e1e1f2ffc1..1d641d2611e 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt @@ -1,8 +1,8 @@ -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(9,1): error TS2755: No overload matches 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,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(62,1): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,1): error TS2755: No overload matches 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'? @@ -17,10 +17,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // No candidate overloads found fn1 `${ {} }`; // Error ~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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; @@ -81,17 +81,17 @@ 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 diff --git a/tests/baselines/reference/tsxElementResolution9.errors.txt b/tests/baselines/reference/tsxElementResolution9.errors.txt index b350fe0fdbc..6686890b839 100644 --- a/tests/baselines/reference/tsxElementResolution9.errors.txt +++ b/tests/baselines/reference/tsxElementResolution9.errors.txt @@ -1,6 +1,6 @@ -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(11,1): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(18,1): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches this call. ==== tests/cases/conformance/jsx/file.tsx (3 errors) ==== @@ -16,10 +16,10 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No suitable overload f var Obj1: Obj1; ; // Error, return type is not an object type ~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 { @@ -29,10 +29,10 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No suitable overload f var Obj2: Obj2; ; // Error, return type is not an object type ~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 { @@ -42,9 +42,9 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No suitable overload f var Obj3: Obj3; ; // OK ~~~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt index e06fffebe85..e85f25c0fdb 100644 --- a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt +++ b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt @@ -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,13): error TS2755: No suitable overload for this call. +tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2755: No overload matches this call. ==== tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx (2 errors) ==== @@ -23,10 +23,10 @@ tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2755: No s !!! error TS2322: '{}' is assignable to the constraint of type 'P', but 'P' could be instantiated with a different subtype of constraint '{}'. let y = ; // should error ~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx:15:14: Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx:15:14: Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. Type '{}' is not assignable to type 'Readonly

'. -!!! related TS2757 tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx:15:14: Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. +!!! related TS2760 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

'. let z = // should work diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt index e1969542774..c95de6de1f3 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/jsx/file.tsx(12,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(13,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(14,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(16,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(17,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(25,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(26,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(33,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(34,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(35,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(12,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(13,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(14,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(16,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(17,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(25,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(26,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(33,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(34,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(35,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches this call. ==== tests/cases/conformance/jsx/file.tsx (11 errors) ==== @@ -25,45 +25,45 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No suitable overload // Error const c0 = ; // extra property; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:12:13: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:12:13: Overload 1 of 2, '(): Element', gave the following error. Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. Property 'extraProp' does not exist on type 'IntrinsicAttributes'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:12:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:12:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. const c1 = ; // missing property; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:13:13: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:13:13: Overload 1 of 2, '(): Element', gave the following error. Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. Property 'yy' does not exist on type 'IntrinsicAttributes'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:13:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:13:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. const c2 = ; // type incompatible; ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:14:13: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:14:13: Overload 1 of 2, '(): Element', gave the following error. Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'. Property 'yy1' does not exist on type 'IntrinsicAttributes'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:14:31: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:14:31: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type 'true' is not assignable to type 'string'. const c3 = ; // This is OK becuase all attribute are spread const c4 = ; // extra property; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:16:13: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:16:13: Overload 1 of 2, '(): Element', gave the following error. Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'. Property 'y1' does not exist on type 'IntrinsicAttributes'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:16:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:16:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. const c5 = ; // type incompatible; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:17:13: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:17:13: Overload 1 of 2, '(): Element', gave the following error. Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:17:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:17:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. Types of property 'yy' are incompatible. Type 'boolean' is not assignable to type 'number'. @@ -76,18 +76,18 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No suitable overload // Error const d1 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:25:29: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:25:29: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. Type 'true' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:25:13: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:25:13: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. const d2 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:26:13: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:26:13: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:26:40: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:26:40: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. Type 'string' is not assignable to type 'number'. declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element; @@ -97,42 +97,42 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No suitable overload // Error const e1 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:33:29: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:33:29: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. Type 'true' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:33:29: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:33:29: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. Type 'true' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:33:32: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:33:32: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. const e2 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:34:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:34:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:34:13: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:34:13: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:34:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:34:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. const e3 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:35:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:35:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:35:50: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:35:50: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. Type 'string' is not assignable to type 'Element'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:35:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:35:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. const e4 = Hi ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:36:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:36:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:36:50: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:36:50: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:36:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:36:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt index 1b3b140d458..f364876a945 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/jsx/file.tsx(48,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(54,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(55,12): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(48,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(54,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(55,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No overload matches this call. ==== tests/cases/conformance/jsx/file.tsx (4 errors) ==== @@ -54,14 +54,14 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No suitable overload // Error const b0 = {}}>GO; // extra property; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:48:13: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:48:13: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:48:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:48:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:48:13: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:48:13: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. const b1 = {}} {...obj0}>Hello world; // extra property; @@ -71,28 +71,28 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No suitable overload const b5 = ; // Spread retain method declaration (see GitHub #13365), so now there is an extra attributes const b6 = ; // incorrect type for optional attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:54:51: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:54:51: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Type 'number' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:54:51: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:54:51: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. Type 'number' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:54:51: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:54:51: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type 'number' is not assignable to type 'string'. const b7 = ; // incorrect type for optional attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:55:68: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:55:68: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Type 'true' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:55:68: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:55:68: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. Type 'true' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:55:68: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:55:68: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type 'true' is not assignable to type 'string'. const b8 = ; // incorrect type for specified hyphanated name ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:56:13: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:56:13: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:56:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:56:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:56:24: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:56:24: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt index d956253311b..a8d2a1c004e 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/jsx/file.tsx(9,14): error TS2755: No suitable overload for this call. -tests/cases/conformance/jsx/file.tsx(10,14): error TS2755: No suitable overload for this call. +tests/cases/conformance/jsx/file.tsx(9,14): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(10,14): error TS2755: No overload matches this call. ==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== @@ -13,23 +13,23 @@ tests/cases/conformance/jsx/file.tsx(10,14): error TS2755: No suitable overload function Baz(arg1: T, arg2: U) { let a0 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:9:15: Overload 1 of 3, '(): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:9:15: Overload 1 of 3, '(): Element', gave the following error. Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. Property 'a' does not exist on type 'IntrinsicAttributes'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:9:33: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:9:33: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. Type 'number' is not assignable to type 'string'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:9:15: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:9:15: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. let a2 = // missing a ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No suitable overload for this call. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:10:15: Overload 1 of 3, '(): Element', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:10:15: Overload 1 of 3, '(): Element', gave the following error. Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:10:15: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:10:15: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }'. Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: string; "ignore-prop": boolean; }'. -!!! related TS2757 tests/cases/conformance/jsx/file.tsx:10:15: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. +!!! related TS2760 tests/cases/conformance/jsx/file.tsx:10:15: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. } \ No newline at end of file diff --git a/tests/baselines/reference/underscoreTest1.errors.txt b/tests/baselines/reference/underscoreTest1.errors.txt index 971650a4f14..256b6e873aa 100644 --- a/tests/baselines/reference/underscoreTest1.errors.txt +++ b/tests/baselines/reference/underscoreTest1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2755: No suitable overload for this call. +tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2755: No overload matches this call. ==== tests/cases/compiler/underscoreTest1_underscoreTests.ts (1 errors) ==== @@ -29,12 +29,12 @@ tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2755: No _.all([true, 1, null, 'yes'], _.identity); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 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_, context?: any): boolean', gave the following error. +!!! error TS2755: No overload matches this call. +!!! related TS2760 tests/cases/compiler/underscoreTest1_underscoreTests.ts:26:31: Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. 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, iterator?: Iterator_, context?: any): boolean', gave the following error. +!!! related TS2760 tests/cases/compiler/underscoreTest1_underscoreTests.ts:26:7: Overload 2 of 2, '(list: Dictionary, iterator?: Iterator_, context?: any): boolean', gave the following error. Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. Index signature is missing in type '(string | number | boolean)[]'. diff --git a/tests/baselines/reference/unionTypeCallSignatures.errors.txt b/tests/baselines/reference/unionTypeCallSignatures.errors.txt index b0ce088ca1b..fd1a5cdb379 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeCallSignatures.errors.txt @@ -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,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(10,1): error TS2755: No overload matches this call. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,1): error TS2755: No overload matches 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'. @@ -41,10 +41,10 @@ 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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; }; @@ -52,10 +52,10 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 strOrBoolean = unionOfDifferentReturnType1("hello"); unionOfDifferentReturnType1(true); // error in type of parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt index d0eadc3cedc..c277a2f6b24 100644 --- a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt @@ -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,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(10,1): error TS2755: No overload matches this call. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(15,1): error TS2755: No overload matches 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'. @@ -40,10 +40,10 @@ 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 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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; }; @@ -51,10 +51,10 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro strOrBoolean = new unionOfDifferentReturnType1("hello"); new unionOfDifferentReturnType1(true); // error in type of parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 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. +!!! error TS2755: No overload matches this call. +!!! related TS2760 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. +!!! related TS2760 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 0436cfca16f504feac2b13b3120d2c802a0231a4 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 26 Jun 2019 12:56:14 -0700 Subject: [PATCH 14/26] Do not report multiple diagnostics per signature. If there are multiple diagnostics per signature, choose the signature with the fewer diagnostics to report. If there are more than one with the minimum, choose the latest in the overload set. --- src/compiler/checker.ts | 18 ++++++++++++++---- src/compiler/core.ts | 1 + src/compiler/diagnosticMessages.json | 8 -------- src/compiler/utilities.ts | 2 +- .../heterogeneousArrayAndOverloads.errors.txt | 6 ------ 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a8f1c0de383..f38bcb88e1d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21632,19 +21632,29 @@ namespace ts { } } else { - const related: DiagnosticRelatedInformation[] = []; + const allDiagnostics: DiagnosticRelatedInformation[][] = []; + let max = 0; + let min = Number.MAX_VALUE; + let minIndex = 0; let i = 0; for (const c of candidatesForArgumentError) { - i++; - const chain = () => chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Overload_0_of_1_2_gave_the_following_error, i, candidates.length, signatureToString(c)); + const chain = () => chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Overload_0_of_1_2_gave_the_following_error, i + 1, candidates.length, signatureToString(c)); const diags = getSignatureApplicabilityError(node, args, c, assignableRelation, CheckMode.Normal, /*reportErrors*/ true, chain); if (diags) { - related.push(...diags); + if (diags.length <= min) { + min = diags.length; + minIndex = i; + } + max = Math.max(max, diags.length); + allDiagnostics.push(diags); } else { Debug.fail("No error for 3 or fewer overload signatures"); } + i++; } + + const related = max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics); diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(/*details*/ undefined, Diagnostics.No_overload_matches_this_call), related)); } } diff --git a/src/compiler/core.ts b/src/compiler/core.ts index f1511b79c12..896bf7d849c 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -600,6 +600,7 @@ namespace ts { * * @param array The array to flatten. */ + export function flatten(array: T[][]): T[]; export function flatten(array: ReadonlyArray | undefined>): T[]; export function flatten(array: ReadonlyArray | undefined> | undefined): T[] | undefined; export function flatten(array: ReadonlyArray | undefined> | undefined): T[] | undefined { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 8dbc74c6b12..8d96a91bd82 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2625,14 +2625,6 @@ "category": "Error", "code": 2755 }, - "The closest overload gave the following error.": { - "category": "Error", - "code": 2756 - }, - "The closest overload is declared here.": { - "category": "Error", - "code": 2757 - }, "The last overload gave the following error.": { "category": "Error", "code": 2758 diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index ae5b60cd864..ae230d75154 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -8092,7 +8092,7 @@ namespace ts { visitDirectory(basePath, combinePaths(currentDirectory, basePath), depth); } - return flatten(results); + return flatten(results); function visitDirectory(path: string, absolutePath: string, depth: number | undefined) { const canonicalPath = toCanonical(realpath(absolutePath)); diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt index d6ced6a25a1..9750b678e7f 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt @@ -15,11 +15,5 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No ov !!! error TS2755: No overload matches this call. !!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:26: Overload 1 of 2, '(arg1: number[]): any', gave the following error. Type 'string' is not assignable to type 'number'. -!!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:20: Overload 2 of 2, '(arg1: string[]): any', gave the following error. - Type 'number' is not assignable to type 'string'. -!!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:23: Overload 2 of 2, '(arg1: string[]): any', gave the following error. - Type 'number' is not assignable to type 'string'. -!!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:32: Overload 2 of 2, '(arg1: string[]): any', gave the following error. - Type 'number' is not assignable to type 'string'. } } \ No newline at end of file From 35dda10865bafcd01547bc0e89dae60db6057d22 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 27 Jun 2019 09:09:59 -0700 Subject: [PATCH 15/26] Fix lint, remove overloads --- src/compiler/core.ts | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 896bf7d849c..c93f6ccb3ab 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -600,25 +600,18 @@ namespace ts { * * @param array The array to flatten. */ - export function flatten(array: T[][]): T[]; - export function flatten(array: ReadonlyArray | undefined>): T[]; - export function flatten(array: ReadonlyArray | undefined> | undefined): T[] | undefined; - export function flatten(array: ReadonlyArray | undefined> | undefined): T[] | undefined { - let result: T[] | undefined; - if (array) { - result = []; - for (const v of array) { - if (v) { - if (isArray(v)) { - addRange(result, v); - } - else { - result.push(v); - } + export function flatten(array: T[][] | ReadonlyArray | undefined>): T[] { + const result = []; + for (const v of array) { + if (v) { + if (isArray(v)) { + addRange(result, v); + } + else { + result.push(v); } } } - return result; } From ba9d8e2e81736854734f07f4441100f29f603bcd Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 27 Jun 2019 16:30:35 -0700 Subject: [PATCH 16/26] Switch DiagnosticMessageChain to be a tree --- src/compiler/builder.ts | 26 ++--------- src/compiler/checker.ts | 5 ++- src/compiler/program.ts | 40 ++++++++--------- src/compiler/types.ts | 2 +- src/compiler/utilities.ts | 91 ++++++++++++++++++++++++++++----------- src/harness/fourslash.ts | 19 +++++--- 6 files changed, 104 insertions(+), 79 deletions(-) diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index d4c2132d36b..e8224e22866 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -20,7 +20,7 @@ namespace ts { messageText: string; category: DiagnosticCategory; code: number; - next?: ReusableDiagnosticMessageChain; + next?: ReusableDiagnosticMessageChain[]; } export interface ReusableBuilderProgramState extends ReusableBuilderState { @@ -263,20 +263,10 @@ namespace ts { } function convertToDiagnosticRelatedInformation(diagnostic: ReusableDiagnosticRelatedInformation, newProgram: Program): DiagnosticRelatedInformation { - const { file, messageText } = diagnostic; + const { file } = diagnostic; return { ...diagnostic, file: file && newProgram.getSourceFileByPath(file), - messageText: messageText === undefined || isString(messageText) ? - messageText : - convertToDiagnosticMessageChain(messageText, newProgram) - }; - } - - function convertToDiagnosticMessageChain(diagnostic: ReusableDiagnosticMessageChain, newProgram: Program): DiagnosticMessageChain { - return { - ...diagnostic, - next: diagnostic.next && convertToDiagnosticMessageChain(diagnostic.next, newProgram) }; } @@ -685,20 +675,10 @@ namespace ts { } function convertToReusableDiagnosticRelatedInformation(diagnostic: DiagnosticRelatedInformation): ReusableDiagnosticRelatedInformation { - const { file, messageText } = diagnostic; + const { file } = diagnostic; return { ...diagnostic, file: file && file.path, - messageText: messageText === undefined || isString(messageText) ? - messageText : - convertToReusableDiagnosticMessageChain(messageText) - }; - } - - function convertToReusableDiagnosticMessageChain(diagnostic: DiagnosticMessageChain): ReusableDiagnosticMessageChain { - return { - ...diagnostic, - next: diagnostic.next && convertToReusableDiagnosticMessageChain(diagnostic.next) }; } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f38bcb88e1d..75e477f55da 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -12460,7 +12460,8 @@ namespace ts { if (containingMessageChain) { const chain = containingMessageChain(); if (chain) { - errorInfo = concatenateDiagnosticMessageChains(chain, errorInfo); + concatenateDiagnosticMessageChains(chain, errorInfo); + errorInfo = chain; } } @@ -21655,7 +21656,7 @@ namespace ts { } const related = max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics); - diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(/*details*/ undefined, Diagnostics.No_overload_matches_this_call), related)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.No_overload_matches_this_call), related)); } } else if (candidateForArgumentArityError) { diff --git a/src/compiler/program.ts b/src/compiler/program.ts index f5ede694f8c..b409370d018 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -502,30 +502,30 @@ namespace ts { return output; } - export function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain | undefined, newLine: string): string { - if (isString(messageText)) { - return messageText; + export function flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent = 0): string { + if (isString(diag)) { + return diag; } - else { - let diagnosticChain = messageText; - let result = ""; + else if (diag === undefined) { + return ""; + } + let result = ""; + if (indent) { + result += newLine; - let indent = 0; - while (diagnosticChain) { - if (indent) { - result += newLine; - - for (let i = 0; i < indent; i++) { - result += " "; - } - } - result += diagnosticChain.messageText; - indent++; - diagnosticChain = diagnosticChain.next; + for (let i = 0; i < indent; i++) { + result += " "; } - - return result; } + result += diag.messageText; + indent++; + if (diag.next) { + // TODO: Should be possible to optimise the common, non-tree case + for (const kid of diag.next) { + result += flattenDiagnosticMessageText(kid, newLine, indent); + } + } + return result; } /* @internal */ diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 4442f339d83..86b5174278b 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4561,7 +4561,7 @@ namespace ts { messageText: string; category: DiagnosticCategory; code: number; - next?: DiagnosticMessageChain; + next?: DiagnosticMessageChain[]; } export interface Diagnostic extends DiagnosticRelatedInformation { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index ae230d75154..4d7eaf65a24 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -7112,8 +7112,8 @@ namespace ts { }; } - export function chainDiagnosticMessages(details: DiagnosticMessageChain | undefined, message: DiagnosticMessage, ...args: (string | number | undefined)[]): DiagnosticMessageChain; - export function chainDiagnosticMessages(details: DiagnosticMessageChain | undefined, message: DiagnosticMessage): DiagnosticMessageChain { + export function chainDiagnosticMessages(details: DiagnosticMessageChain | DiagnosticMessageChain[] | undefined, message: DiagnosticMessage, ...args: (string | number | undefined)[]): DiagnosticMessageChain; + export function chainDiagnosticMessages(details: DiagnosticMessageChain | DiagnosticMessageChain[] | undefined, message: DiagnosticMessage): DiagnosticMessageChain { let text = getLocaleSpecificMessage(message); if (arguments.length > 2) { @@ -7125,18 +7125,17 @@ namespace ts { category: message.category, code: message.code, - next: details + next: details === undefined || Array.isArray(details) ? details : [details] }; } - export function concatenateDiagnosticMessageChains(headChain: DiagnosticMessageChain, tailChain: DiagnosticMessageChain): DiagnosticMessageChain { + export function concatenateDiagnosticMessageChains(headChain: DiagnosticMessageChain, tailChain: DiagnosticMessageChain): void { let lastChain = headChain; while (lastChain.next) { - lastChain = lastChain.next; + lastChain = lastChain.next[0]; } - lastChain.next = tailChain; - return headChain; + lastChain.next = [tailChain]; } function getDiagnosticFilePath(diagnostic: Diagnostic): string | undefined { @@ -7171,30 +7170,70 @@ namespace ts { return d1.relatedInformation ? Comparison.LessThan : Comparison.GreaterThan; } - function compareMessageText(t1: string | DiagnosticMessageChain, t2: string | DiagnosticMessageChain): Comparison { - let text1: string | DiagnosticMessageChain | undefined = t1; - let text2: string | DiagnosticMessageChain | undefined = t2; - while (text1 && text2) { - // We still have both chains. - const string1 = isString(text1) ? text1 : text1.messageText; - const string2 = isString(text2) ? text2 : text2.messageText; + // function compareMessageText(t1: string | DiagnosticMessageChain[], t2: string | DiagnosticMessageChain[]): Comparison { + // if (typeof t1 === 'string' && typeof t2 === 'string') { + // return compareStringsCaseSensitive(t1, t2) + // } + // else if (Array.isArray(t1) && Array.isArray(t2)) { + // if (t1.length < t2.length) { + // return Comparison.LessThan; + // } + // else if (t1.length > t2.length) { + // return Comparison.GreaterThan; + // } + // else { + // for (let i = 0; i < t1.length; i++) { + // t1[i].messageText + // const res = cmps(t1[i], t2[i]); + // if (res) { + // return res; + // } + // } + // return Comparison.EqualTo; + // } + // } + // else if (typeof t1 === 'string') { + // return Comparison.LessThan; + // } + // else { + // return Comparison.GreaterThan; + // } + // } - const res = compareStringsCaseSensitive(string1, string2); + function compareMessageText(t1: string | DiagnosticMessageChain, t2: string | DiagnosticMessageChain): Comparison { + if (typeof t1 === 'string' && typeof t2 === 'string') { + return compareStringsCaseSensitive(t1, t2); + } + else if (typeof t1 === 'string') { + return Comparison.LessThan; + } + else if (typeof t2 === 'string') { + return Comparison.GreaterThan; + } + let res = compareStringsCaseSensitive(t1.messageText, t2.messageText); + if (res) { + return res; + } + if (!t1.next && !t2.next) { + return Comparison.EqualTo; + } + if (!t1.next) { + return Comparison.LessThan; + } + if (!t2.next) { + return Comparison.GreaterThan; + } + res = compareValues(t1.next.length, t2.next.length); + if (res) { + return res; + } + for (let i = 0; i < t1.next.length; i++) { + res = compareMessageText(t1.next[i], t2.next[i]) if (res) { return res; } - - text1 = isString(text1) ? undefined : text1.next; - text2 = isString(text2) ? undefined : text2.next; } - - if (!text1 && !text2) { - // if the chains are done, then these messages are the same. - return Comparison.EqualTo; - } - - // We still have one chain remaining. The shorter chain should come first. - return text1 ? Comparison.GreaterThan : Comparison.LessThan; + return Comparison.EqualTo; } export function getEmitScriptTarget(compilerOptions: CompilerOptions) { diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index cbe4c3336d7..84fb7f390ba 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1482,13 +1482,7 @@ Actual: ${stringify(fullActual)}`); const diagnostics = ts.getPreEmitDiagnostics(this.languageService.getProgram()!); // TODO: GH#18217 for (const diagnostic of diagnostics) { if (!ts.isString(diagnostic.messageText)) { - let chainedMessage: ts.DiagnosticMessageChain | undefined = diagnostic.messageText; - let indentation = " "; - while (chainedMessage) { - resultString += indentation + chainedMessage.messageText + Harness.IO.newLine(); - chainedMessage = chainedMessage.next; - indentation = indentation + " "; - } + resultString += this.flattenChainedMessage(diagnostic.messageText); } else { resultString += " " + diagnostic.messageText + Harness.IO.newLine(); @@ -1506,6 +1500,17 @@ Actual: ${stringify(fullActual)}`); Harness.Baseline.runBaseline(ts.Debug.assertDefined(this.testData.globalOptions[MetadataOptionNames.baselineFile]), resultString); } + private flattenChainedMessage(diag: ts.DiagnosticMessageChain, indent = " ") { + let result = ""; + result += indent + diag.messageText + Harness.IO.newLine(); + if (diag.next) { + for (const kid of diag.next) { + result += this.flattenChainedMessage(kid, indent + " "); + } + } + return result; + } + public baselineQuickInfo() { const baselineFile = this.getBaselineFileName(); Harness.Baseline.runBaseline( From 47bbc9546e032bfdaf2436f486178c27bee9c089 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 28 Jun 2019 15:42:27 -0700 Subject: [PATCH 17/26] Convert related spans to message chains --- src/compiler/checker.ts | 6 +- .../reference/bigintWithLib.errors.txt | 63 ++++-- .../constructorOverloads1.errors.txt | 24 ++- ...StringLiteralsInJsxAttributes02.errors.txt | 72 ++++--- .../controlFlowIterationErrors.errors.txt | 36 ++-- tests/baselines/reference/for-of39.errors.txt | 42 ++-- .../reference/functionOverloads2.errors.txt | 12 +- .../reference/functionOverloads40.errors.txt | 12 +- .../reference/functionOverloads41.errors.txt | 12 +- ...edMethodWithOverloadedArguments.errors.txt | 72 ++++--- .../heterogeneousArrayAndOverloads.errors.txt | 6 +- .../reference/incompatibleTypes.errors.txt | 48 +++-- ...ritedConstructorWithRestParams2.errors.txt | 24 ++- .../iterableArrayPattern28.errors.txt | 42 ++-- .../iteratorSpreadInArray6.errors.txt | 27 ++- ...attersForSignatureGroupIdentity.errors.txt | 36 ++-- .../baselines/reference/overload1.errors.txt | 12 +- .../reference/overloadResolution.errors.txt | 36 ++-- ...loadResolutionClassConstructors.errors.txt | 12 +- .../overloadResolutionConstructors.errors.txt | 36 ++-- .../overloadResolutionTest1.errors.txt | 36 ++-- .../overloadingOnConstants2.errors.txt | 12 +- ...nWithConstraintCheckingDeferred.errors.txt | 33 ++- .../overloadsWithProvisionalErrors.errors.txt | 24 ++- .../reference/promiseTypeInference.errors.txt | 30 ++- .../recursiveFunctionTypes.errors.txt | 18 +- ...edSignatureAsCallbackParameter1.errors.txt | 36 ++-- ...eStringsWithOverloadResolution1.errors.txt | 48 +++-- ...ingsWithOverloadResolution1_ES6.errors.txt | 48 +++-- ...eStringsWithOverloadResolution3.errors.txt | 36 ++-- ...ingsWithOverloadResolution3_ES6.errors.txt | 36 ++-- .../tsxElementResolution9.errors.txt | 36 ++-- ...elessFunctionComponentOverload4.errors.txt | 195 ++++++++++++------ ...elessFunctionComponentOverload5.errors.txt | 81 +++++--- ...ionComponentsWithTypeArguments4.errors.txt | 45 ++-- .../unionTypeCallSignatures.errors.txt | 24 ++- .../unionTypeConstructSignatures.errors.txt | 24 ++- 37 files changed, 928 insertions(+), 464 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 75e477f55da..3e35732ce49 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21655,8 +21655,10 @@ namespace ts { i++; } - const related = max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics); - diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.No_overload_matches_this_call), related)); + const related = map( + max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics), + d => typeof d.messageText === 'string' ? (d as DiagnosticMessageChain) : d.messageText); + diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(related, Diagnostics.No_overload_matches_this_call))); } } else if (candidateForArgumentArityError) { diff --git a/tests/baselines/reference/bigintWithLib.errors.txt b/tests/baselines/reference/bigintWithLib.errors.txt index 836e2397ae3..19dc04b17fe 100644 --- a/tests/baselines/reference/bigintWithLib.errors.txt +++ b/tests/baselines/reference/bigintWithLib.errors.txt @@ -1,7 +1,28 @@ 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,15): error TS2755: No overload matches this call. + Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'number'. + Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '() => IterableIterator' is not assignable to type '() => Iterator'. + Type 'IterableIterator' is not assignable to type 'Iterator'. + Types of property 'next' are incompatible. + Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. + Type 'IteratorResult' is not assignable to type 'IteratorResult'. + Type 'number' is not assignable to type 'bigint'. + 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] 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,16): error TS2755: No overload matches this call. + Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'number'. + Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. + 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'. 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,20 +49,20 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 bigIntArray = new BigInt64Array([1, 2, 3]); // should error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. - Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. - Types of property '[Symbol.iterator]' are incompatible. - Type '() => IterableIterator' is not assignable to type '() => Iterator'. - Type 'IterableIterator' is not assignable to type 'Iterator'. - Types of property 'next' are incompatible. - Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. - Type 'IteratorResult' is not assignable to type 'IteratorResult'. - Type 'number' is not assignable to type 'bigint'. -!!! related TS2760 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] +!!! error TS2755: Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. +!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. +!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2755: Types of property '[Symbol.iterator]' are incompatible. +!!! error TS2755: Type '() => IterableIterator' is not assignable to type '() => Iterator'. +!!! error TS2755: Type 'IterableIterator' is not assignable to type 'Iterator'. +!!! error TS2755: Types of property 'next' are incompatible. +!!! error TS2755: Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. +!!! error TS2755: Type 'IteratorResult' is not assignable to type 'IteratorResult'. +!!! error TS2755: Type 'number' is not assignable to type 'bigint'. +!!! error TS2755: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error. +!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. +!!! error TS2755: 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); @@ -58,13 +79,13 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 bigUintArray = new BigUint64Array([1, 2, 3]); // should error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. - Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. -!!! related TS2760 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'. +!!! error TS2755: Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. +!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. +!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2755: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error. +!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. +!!! error TS2755: 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); diff --git a/tests/baselines/reference/constructorOverloads1.errors.txt b/tests/baselines/reference/constructorOverloads1.errors.txt index 5f560ff38d8..9c2db5b39e6 100644 --- a/tests/baselines/reference/constructorOverloads1.errors.txt +++ b/tests/baselines/reference/constructorOverloads1.errors.txt @@ -3,7 +3,15 @@ tests/cases/compiler/constructorOverloads1.ts(3,5): error TS2392: Multiple const 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,10): error TS2755: No overload matches this call. + Overload 1 of 2, '(s: string): Foo', gave the following error. + Argument of type 'Foo' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(n: number): Foo', gave the following error. + Argument of type 'Foo' is not assignable to parameter of type 'number'. tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2755: No overload matches this call. + Overload 1 of 2, '(s: string): Foo', gave the following error. + Argument of type 'any[]' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(n: number): Foo', gave the following error. + Argument of type 'any[]' is not assignable to parameter of type 'number'. ==== tests/cases/compiler/constructorOverloads1.ts (6 errors) ==== @@ -37,17 +45,17 @@ tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2755: No overload var f3 = new Foo(f1); ~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(s: string): Foo', gave the following error. +!!! error TS2755: Argument of type 'Foo' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(n: number): Foo', gave the following error. +!!! error TS2755: Argument of type 'Foo' is not assignable to parameter of type 'number'. var f4 = new Foo([f1,f2,f3]); ~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(s: string): Foo', gave the following error. +!!! error TS2755: Argument of type 'any[]' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(n: number): Foo', gave the following error. +!!! error TS2755: Argument of type 'any[]' is not assignable to parameter of type 'number'. f1.bar1(); f1.bar2(); diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt index 73fc41eeaf8..28aa026b11f 100644 --- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt @@ -1,7 +1,31 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,12): error TS2755: No overload matches this call. + 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'. + 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'. tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,12): error TS2755: No overload matches this call. + 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'. + 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'. tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,12): error TS2755: No overload matches this call. + 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'. + 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'. tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,12): error TS2755: No overload matches this call. + 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'. + 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'. 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'. @@ -38,39 +62,39 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): err const b0 = {console.log(k)}}} extra />; // k has type "left" | "right" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2755: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. const b2 = {console.log(k)}} extra />; // k has type "left" | "right" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2755: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2755: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. const b3 = ; // goTo has type"home" | "contact" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2755: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. const b4 = ; // goTo has type "home" | "contact" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2755: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. export function NoOverload(buttonProps: ButtonProps): JSX.Element { return undefined } const c1 = {console.log(k)}}} extra />; // k has type any diff --git a/tests/baselines/reference/controlFlowIterationErrors.errors.txt b/tests/baselines/reference/controlFlowIterationErrors.errors.txt index 4ce7e28a5d1..b8c4c21906c 100644 --- a/tests/baselines/reference/controlFlowIterationErrors.errors.txt +++ b/tests/baselines/reference/controlFlowIterationErrors.errors.txt @@ -3,7 +3,19 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(11,17): error 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,13): error TS2755: No overload matches this call. + 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'. + 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'. tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error TS2755: No overload matches this call. + 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'. + 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'. ==== tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts (4 errors) ==== @@ -49,12 +61,12 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error x = foo(x); ~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(x: string): number', gave the following error. +!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'string'. +!!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 2, '(x: number): string', gave the following error. +!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'number'. +!!! error TS2755: Type 'string' is not assignable to type 'number'. x; } x; @@ -68,12 +80,12 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error x = foo(x); ~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(x: string): number', gave the following error. +!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'string'. +!!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 2, '(x: number): string', gave the following error. +!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'number'. +!!! error TS2755: Type 'string' is not assignable to type 'number'. } x; } diff --git a/tests/baselines/reference/for-of39.errors.txt b/tests/baselines/reference/for-of39.errors.txt index 36bdbdf9447..77f8bff4412 100644 --- a/tests/baselines/reference/for-of39.errors.txt +++ b/tests/baselines/reference/for-of39.errors.txt @@ -1,24 +1,38 @@ tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2755: No overload matches this call. + Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. + Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '() => IterableIterator<[string, number] | [string, true]>' is not assignable to type '() => Iterator'. + Type 'IterableIterator<[string, number] | [string, true]>' is not assignable to type 'Iterator'. + Types of property 'next' are incompatible. + Type '(value?: any) => IteratorResult<[string, number] | [string, true]>' is not assignable to type '(value?: any) => IteratorResult'. + Type 'IteratorResult<[string, number] | [string, true]>' is not assignable to type 'IteratorResult'. + Type '[string, number] | [string, true]' is not assignable to type 'readonly [string, boolean]'. + Type '[string, number]' is not assignable to type 'readonly [string, boolean]'. + Types of property '1' are incompatible. + Type 'number' is not assignable to type 'boolean'. + Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map', gave the following error. + Type 'number' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/for-ofStatements/for-of39.ts (1 errors) ==== var map = new Map([["", true], ["", 0]]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:19: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. - Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable'. - Types of property '[Symbol.iterator]' are incompatible. - Type '() => IterableIterator<[string, number] | [string, true]>' is not assignable to type '() => Iterator'. - Type 'IterableIterator<[string, number] | [string, true]>' is not assignable to type 'Iterator'. - Types of property 'next' are incompatible. - Type '(value?: any) => IteratorResult<[string, number] | [string, true]>' is not assignable to type '(value?: any) => IteratorResult'. - Type 'IteratorResult<[string, number] | [string, true]>' is not assignable to type 'IteratorResult'. - Type '[string, number] | [string, true]' is not assignable to type 'readonly [string, boolean]'. - Type '[string, number]' is not assignable to type 'readonly [string, boolean]'. - Types of property '1' are incompatible. - Type 'number' is not assignable to type 'boolean'. -!!! related TS2760 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:37: Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map', gave the following error. - Type 'number' is not assignable to type 'boolean'. +!!! error TS2755: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. +!!! error TS2755: Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2755: Types of property '[Symbol.iterator]' are incompatible. +!!! error TS2755: Type '() => IterableIterator<[string, number] | [string, true]>' is not assignable to type '() => Iterator'. +!!! error TS2755: Type 'IterableIterator<[string, number] | [string, true]>' is not assignable to type 'Iterator'. +!!! error TS2755: Types of property 'next' are incompatible. +!!! error TS2755: Type '(value?: any) => IteratorResult<[string, number] | [string, true]>' is not assignable to type '(value?: any) => IteratorResult'. +!!! error TS2755: Type 'IteratorResult<[string, number] | [string, true]>' is not assignable to type 'IteratorResult'. +!!! error TS2755: Type '[string, number] | [string, true]' is not assignable to type 'readonly [string, boolean]'. +!!! error TS2755: Type '[string, number]' is not assignable to type 'readonly [string, boolean]'. +!!! error TS2755: Types of property '1' are incompatible. +!!! error TS2755: Type 'number' is not assignable to type 'boolean'. +!!! error TS2755: Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map', gave the following error. +!!! error TS2755: Type 'number' is not assignable to type 'boolean'. for (var [k, v] of map) { k; v; diff --git a/tests/baselines/reference/functionOverloads2.errors.txt b/tests/baselines/reference/functionOverloads2.errors.txt index 913c3cb49e3..785844037fa 100644 --- a/tests/baselines/reference/functionOverloads2.errors.txt +++ b/tests/baselines/reference/functionOverloads2.errors.txt @@ -1,4 +1,8 @@ tests/cases/compiler/functionOverloads2.ts(4,9): error TS2755: No overload matches this call. + Overload 1 of 2, '(bar: string): string', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(bar: number): number', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. ==== tests/cases/compiler/functionOverloads2.ts (1 errors) ==== @@ -8,7 +12,7 @@ tests/cases/compiler/functionOverloads2.ts(4,9): error TS2755: No overload match var x = foo(true); ~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. \ No newline at end of file +!!! error TS2755: Overload 1 of 2, '(bar: string): string', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(bar: number): number', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt index 9e99d383746..ce7472e1936 100644 --- a/tests/baselines/reference/functionOverloads40.errors.txt +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -1,4 +1,8 @@ tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No overload matches this call. + Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. + Type 'string' is not assignable to type 'number'. + Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. + Type 'string' is not assignable to type 'boolean'. ==== tests/cases/compiler/functionOverloads40.ts (1 errors) ==== @@ -8,8 +12,8 @@ tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No overload matc var x = foo([{a:'bar'}]); ~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. - Type 'string' is not assignable to type 'number'. -!!! related TS2760 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. - Type 'string' is not assignable to type 'boolean'. +!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads41.errors.txt b/tests/baselines/reference/functionOverloads41.errors.txt index 95b3296e5c9..a26840f22f0 100644 --- a/tests/baselines/reference/functionOverloads41.errors.txt +++ b/tests/baselines/reference/functionOverloads41.errors.txt @@ -1,4 +1,8 @@ tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No overload matches this call. + Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. + Property 'a' is missing in type '{}' but required in type '{ a: number; }'. + Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. + Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. ==== tests/cases/compiler/functionOverloads41.ts (1 errors) ==== @@ -8,8 +12,8 @@ tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No overload matc var x = foo([{}]); ~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. - Property 'a' is missing in type '{}' but required in type '{ a: number; }'. -!!! related TS2760 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. - Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. +!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2755: Property 'a' is missing in type '{}' but required in type '{ a: number; }'. +!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. +!!! error TS2755: Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt index 9c1f49a581b..10673021477 100644 --- a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt +++ b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt @@ -2,8 +2,32 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(52,22): error TS2755: No overload matches this call. + Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. + Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(68,22): error TS2755: No overload matches this call. + Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. + Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(84,22): error TS2755: No overload matches this call. + Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'boolean'. + Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts (4 errors) ==== @@ -65,13 +89,13 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:52:38: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. - Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:52:38: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. - Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2755: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. +!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. +!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. } ////////////////////////////////////// @@ -90,16 +114,16 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. - Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. - Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. -!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. - Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2755: Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. +!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. +!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2755: Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. +!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. } ////////////////////////////////////// @@ -118,12 +142,12 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:84:38: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. - Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'boolean'. -!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:84:38: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. - Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2755: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. +!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2755: Type 'number' is not assignable to type 'boolean'. +!!! error TS2755: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. +!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. } \ No newline at end of file diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt index 9750b678e7f..2f3a813bf85 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt @@ -1,4 +1,6 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No overload matches this call. + Overload 1 of 2, '(arg1: number[]): any', gave the following error. + Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/heterogeneousArrayAndOverloads.ts (1 errors) ==== @@ -13,7 +15,7 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No ov this.test([1, 2, "hi", 5]); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:26: Overload 1 of 2, '(arg1: number[]): any', gave the following error. - Type 'string' is not assignable to type 'number'. +!!! error TS2755: Overload 1 of 2, '(arg1: number[]): any', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'number'. } } \ No newline at end of file diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index a9290e9988a..296b749cce8 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -10,7 +10,23 @@ tests/cases/compiler/incompatibleTypes.ts(26,12): error TS2416: Property 'p1' in 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,1): error TS2755: No overload matches this call. + 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'. + 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'. tests/cases/compiler/incompatibleTypes.ts(49,1): error TS2755: No overload matches this call. + 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; }'. + 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; }'. 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'. @@ -77,16 +93,16 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => if1(c1); ~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(i: IFoo1): void', gave the following error. +!!! error TS2755: Argument of type 'C1' is not assignable to parameter of type 'IFoo1'. +!!! error TS2755: Types of property 'p1' are incompatible. +!!! error TS2755: Type '() => string' is not assignable to type '() => number'. +!!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! error TS2755: Overload 2 of 2, '(i: IFoo2): void', gave the following error. +!!! error TS2755: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. +!!! error TS2755: Types of property 'p1' are incompatible. +!!! error TS2755: Type '() => string' is not assignable to type '(s: string) => number'. +!!! error TS2755: Type 'string' is not assignable to type 'number'. function of1(n: { a: { a: string; }; b: string; }): number; @@ -96,12 +112,12 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => of1({ e: 0, f: 0 }); ~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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; }'. +!!! error TS2755: Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. +!!! error TS2755: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'. +!!! error TS2755: Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. +!!! error TS2755: Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error. +!!! error TS2755: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. +!!! error TS2755: Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. interface IMap { [key:string]:string; diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt index da0ca0f92f9..c11826196c4 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt @@ -1,6 +1,14 @@ 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,1): error TS2755: No overload matches this call. + Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. + Argument of type '""' is not assignable to parameter of type 'number'. + 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'. tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2755: No overload matches this call. + Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. + Argument of type '""' is not assignable to parameter of type 'number'. + 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'. ==== tests/cases/compiler/inheritedConstructorWithRestParams2.ts (3 errors) ==== @@ -41,14 +49,14 @@ tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2755: new Derived("", 3, "", 3); ~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. +!!! error TS2755: Argument of type '""' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. +!!! error TS2755: Argument of type '3' is not assignable to parameter of type 'string'. new Derived("", 3, "", ""); ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. \ No newline at end of file +!!! error TS2755: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. +!!! error TS2755: Argument of type '""' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. +!!! error TS2755: Argument of type '3' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern28.errors.txt b/tests/baselines/reference/iterableArrayPattern28.errors.txt index a64d2b9a413..2591d3f9ef7 100644 --- a/tests/baselines/reference/iterableArrayPattern28.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern28.errors.txt @@ -1,4 +1,18 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error TS2755: No overload matches this call. + Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. + Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator'. + Type 'IterableIterator<[string, number] | [string, boolean]>' is not assignable to type 'Iterator'. + Types of property 'next' are incompatible. + Type '(value?: any) => IteratorResult<[string, number] | [string, boolean]>' is not assignable to type '(value?: any) => IteratorResult'. + Type 'IteratorResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. + Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. + Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. + Types of property '1' are incompatible. + Type 'boolean' is not assignable to type 'number'. + Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. + Type 'true' is not assignable to type 'number'. ==== tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts (1 errors) ==== @@ -6,17 +20,17 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:32: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. - Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. - Types of property '[Symbol.iterator]' are incompatible. - Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator'. - Type 'IterableIterator<[string, number] | [string, boolean]>' is not assignable to type 'Iterator'. - Types of property 'next' are incompatible. - Type '(value?: any) => IteratorResult<[string, number] | [string, boolean]>' is not assignable to type '(value?: any) => IteratorResult'. - Type 'IteratorResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. - Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. - Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. - Types of property '1' are incompatible. - Type 'boolean' is not assignable to type 'number'. -!!! related TS2760 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:52: Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. - Type 'true' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2755: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. +!!! error TS2755: Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2755: Types of property '[Symbol.iterator]' are incompatible. +!!! error TS2755: Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator'. +!!! error TS2755: Type 'IterableIterator<[string, number] | [string, boolean]>' is not assignable to type 'Iterator'. +!!! error TS2755: Types of property 'next' are incompatible. +!!! error TS2755: Type '(value?: any) => IteratorResult<[string, number] | [string, boolean]>' is not assignable to type '(value?: any) => IteratorResult'. +!!! error TS2755: Type 'IteratorResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. +!!! error TS2755: Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. +!!! error TS2755: Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. +!!! error TS2755: Types of property '1' are incompatible. +!!! error TS2755: Type 'boolean' is not assignable to type 'number'. +!!! error TS2755: Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt index 6a11cc31fff..b3ce072c8e4 100644 --- a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt @@ -1,4 +1,13 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. + Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. + 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'. + Overload 2 of 2, '(...items: (number | ConcatArray)[]): number[]', gave the following error. + Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. + Type 'symbol[]' is not assignable to type 'ConcatArray'. ==== tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts (1 errors) ==== @@ -19,12 +28,12 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2755 array.concat([...new SymbolIterator]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts:15:14: Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. - Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. - 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 TS2760 tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts:15:14: Overload 2 of 2, '(...items: (number | ConcatArray)[]): number[]', gave the following error. - Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. - Type 'symbol[]' is not assignable to type 'ConcatArray'. \ No newline at end of file +!!! error TS2755: Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. +!!! error TS2755: Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. +!!! error TS2755: Types of property 'slice' are incompatible. +!!! error TS2755: Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'. +!!! error TS2755: Type 'symbol[]' is not assignable to type 'number[]'. +!!! error TS2755: Type 'symbol' is not assignable to type 'number'. +!!! error TS2755: Overload 2 of 2, '(...items: (number | ConcatArray)[]): number[]', gave the following error. +!!! error TS2755: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. +!!! error TS2755: Type 'symbol[]' is not assignable to type 'ConcatArray'. \ No newline at end of file diff --git a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt index bcab0991b08..3365a92b749 100644 --- a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt +++ b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt @@ -1,6 +1,18 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,1): error TS2755: No overload matches this call. + 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; }'. + 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; }'. 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,1): error TS2755: No overload matches this call. + 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; }'. + 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; }'. ==== tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts (3 errors) ==== @@ -25,12 +37,12 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS275 v({ s: "", n: 0 }).toLowerCase(); ~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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; }'. +!!! error TS2755: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. +!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. +!!! error TS2755: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. +!!! error TS2755: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. +!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. +!!! error TS2755: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. var w: A; var w: C; @@ -41,9 +53,9 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS275 w({ s: "", n: 0 }).toLowerCase(); ~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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; }'. \ No newline at end of file +!!! error TS2755: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. +!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. +!!! error TS2755: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. +!!! error TS2755: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. +!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. +!!! error TS2755: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/overload1.errors.txt b/tests/baselines/reference/overload1.errors.txt index 6625de2f9a6..c8ac63bf4ee 100644 --- a/tests/baselines/reference/overload1.errors.txt +++ b/tests/baselines/reference/overload1.errors.txt @@ -4,6 +4,10 @@ tests/cases/compiler/overload1.ts(31,11): error TS2554: Expected 1-2 arguments, tests/cases/compiler/overload1.ts(32,5): 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,3): error TS2755: No overload matches this call. + 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'. + 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'. ==== tests/cases/compiler/overload1.ts (6 errors) ==== @@ -54,10 +58,10 @@ tests/cases/compiler/overload1.ts(34,3): error TS2755: No overload matches this z=x.h(2,2); // no match ~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(s1: string, s2: number): string', gave the following error. +!!! error TS2755: Argument of type '2' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(s1: number, s2: string): number', gave the following error. +!!! error TS2755: Argument of type '2' is not assignable to parameter of type 'string'. z=x.h("hello",0); // good var v=x.g; diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index a64c341f2cb..d2c21b4ea7b 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,11 +1,23 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(s: string): string', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(s: number): number', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'number'. 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,1): error TS2755: No overload matches this call. + 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'. + 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'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,1): error TS2755: No overload matches this call. + 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'. + 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'. 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'. @@ -40,10 +52,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): fn1({}); // Error ~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(s: string): string', gave the following error. +!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(s: number): number', gave the following error. +!!! error TS2755: 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; @@ -113,17 +125,17 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): fn4(true, null); // Error ~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(n: string, m: any): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(n: number, m: any): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. fn4(null, true); // Error ~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(n: any, m: number): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 2, '(n: any, m: string): any', gave the following error. +!!! error TS2755: 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; diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index 569fe146ac8..2eaf7490759 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -1,4 +1,8 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(s: string): fn1', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(s: number): fn1', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'number'. 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. @@ -44,10 +48,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru new fn1({}); // Error ~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(s: string): fn1', gave the following error. +!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(s: number): fn1', gave the following error. +!!! error TS2755: 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 { diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index eef196f17cb..c4972bb89eb 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,11 +1,23 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(s: string): string', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(s: number): number', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'number'. 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,1): error TS2755: No overload matches this call. + 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'. + 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'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,1): error TS2755: No overload matches this call. + 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'. + 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'. 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'. @@ -40,10 +52,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors new fn1({}); // Error ~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(s: string): string', gave the following error. +!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(s: number): number', gave the following error. +!!! error TS2755: 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 { @@ -120,17 +132,17 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors new fn4(true, null); // Error ~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(n: string, m: any): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(n: number, m: any): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. new fn4(null, true); // Error ~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(n: any, m: number): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 2, '(n: any, m: string): any', gave the following error. +!!! error TS2755: 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 { diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt index 46f0bb623ff..06050fb2192 100644 --- a/tests/baselines/reference/overloadResolutionTest1.errors.txt +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -1,6 +1,18 @@ tests/cases/compiler/overloadResolutionTest1.ts(7,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. + Type 'string' is not assignable to type 'number'. + Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. + Type 'string' is not assignable to type 'boolean'. tests/cases/compiler/overloadResolutionTest1.ts(18,10): error TS2755: No overload matches this call. + Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. + Type 'string' is not assignable to type 'number'. + Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. + Type 'string' is not assignable to type 'boolean'. tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload matches this call. + Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. + Type 'true' is not assignable to type 'number'. + Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. + Type 'true' is not assignable to type 'string'. ==== tests/cases/compiler/overloadResolutionTest1.ts (3 errors) ==== @@ -13,10 +25,10 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload var x111 = foo([{a:"s"}]); // error - does not match any signature ~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. - Type 'string' is not assignable to type 'number'. -!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. - Type 'string' is not assignable to type 'boolean'. +!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'boolean'. var x1111 = foo([{a:null}]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string @@ -30,10 +42,10 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload var x4 = foo2({a:"s"}); // error ~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. - Type 'string' is not assignable to type 'number'. -!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. - Type 'string' is not assignable to type 'boolean'. +!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'boolean'. function foo4(bar:{a:number;}):number; @@ -42,7 +54,7 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload var x = foo4({a:true}); // error ~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. - Type 'true' is not assignable to type 'number'. -!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. - Type 'true' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'number'. +!!! error TS2755: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadingOnConstants2.errors.txt b/tests/baselines/reference/overloadingOnConstants2.errors.txt index d9844b26e28..aafe28250ad 100644 --- a/tests/baselines/reference/overloadingOnConstants2.errors.txt +++ b/tests/baselines/reference/overloadingOnConstants2.errors.txt @@ -1,5 +1,9 @@ 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,9): error TS2755: No overload matches this call. + 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"'. + 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"'. tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: This overload signature is not compatible with its implementation signature. @@ -24,10 +28,10 @@ tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: This overl var c = foo("um", []); // error ~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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"'. +!!! error TS2755: Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error. +!!! error TS2755: Argument of type '"um"' is not assignable to parameter of type '"hi"'. +!!! error TS2755: Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error. +!!! error TS2755: Argument of type '"um"' is not assignable to parameter of type '"bye"'. //function bar(x: "hi", items: string[]): D; diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt index b1254d24a8a..75688b0d459 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -4,6 +4,17 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,37): 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,23): error TS2755: No overload matches this call. + Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. + Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. + Type 'G' is not assignable to type 'number'. + Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. + Argument of type '(x: D) => G' 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'. + Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. + Argument of type '(x: D) => G' 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(19,14): error TS2344: Type 'D' does not satisfy the constraint 'A'. @@ -46,15 +57,15 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): }); ~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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' is not assignable to parameter of type '(x: D) => number'. - Type 'G' is not assignable to type 'number'. -!!! related TS2760 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' 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 TS2760 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' 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'. +!!! error TS2755: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. +!!! error TS2755: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. +!!! error TS2755: Type 'G' is not assignable to type 'number'. +!!! error TS2755: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. +!!! error TS2755: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. +!!! error TS2755: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2755: Property 'q' is missing in type 'C' but required in type 'D'. +!!! error TS2755: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. +!!! error TS2755: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. +!!! error TS2755: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2755: Property 'q' is missing in type 'B' but required in type 'D'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt index cc65c84b4a5..3bdc2092e9f 100644 --- a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt @@ -1,6 +1,14 @@ tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(s: string): number', gave the following error. + Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. + Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b tests/cases/compiler/overloadsWithProvisionalErrors.ts(7,17): error TS2304: Cannot find name 'blah'. tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(s: string): number', gave the following error. + Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. + Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cannot find name 'blah'. @@ -13,19 +21,19 @@ tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cann func(s => ({})); // Error for no applicable overload (object type is missing a and b) ~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:6: Overload 1 of 2, '(s: string): number', gave the following error. - Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. - Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b +!!! error TS2755: Overload 1 of 2, '(s: string): number', gave the following error. +!!! error TS2755: Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. +!!! error TS2755: Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) ~~~~ !!! error TS2304: Cannot find name 'blah'. func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:6: Overload 1 of 2, '(s: string): number', gave the following error. - Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. - Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. +!!! error TS2755: Overload 1 of 2, '(s: string): number', gave the following error. +!!! error TS2755: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. +!!! error TS2755: Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. ~~~~ !!! error TS2304: Cannot find name 'blah'. \ No newline at end of file diff --git a/tests/baselines/reference/promiseTypeInference.errors.txt b/tests/baselines/reference/promiseTypeInference.errors.txt index 237f3067063..c2f3c51f0ec 100644 --- a/tests/baselines/reference/promiseTypeInference.errors.txt +++ b/tests/baselines/reference/promiseTypeInference.errors.txt @@ -1,4 +1,14 @@ tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2755: No overload matches this call. + Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. + Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. + Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. + Type 'IPromise' is not assignable to type 'number | PromiseLike'. + Type 'IPromise' is not assignable to type 'PromiseLike'. + Types of property 'then' are incompatible. + Type '(success?: (value: number) => IPromise) => IPromise' is not assignable to type '(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. + Types of parameters 'success' and 'onfulfilled' are incompatible. + Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. + Type 'TResult1' is not assignable to type 'IPromise'. ==== tests/cases/compiler/promiseTypeInference.ts (1 errors) ==== @@ -14,14 +24,14 @@ tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2755: No overload m var $$x = load("something").then(s => convert(s)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/promiseTypeInference.ts:10:39: Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. - Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! related TS2760 tests/cases/compiler/promiseTypeInference.ts:10:39: Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. - Type 'IPromise' is not assignable to type 'number | PromiseLike'. - Type 'IPromise' is not assignable to type 'PromiseLike'. - Types of property 'then' are incompatible. - Type '(success?: (value: number) => IPromise) => IPromise' is not assignable to type '(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. - Types of parameters 'success' and 'onfulfilled' are incompatible. - Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. - Type 'TResult1' is not assignable to type 'IPromise'. +!!! error TS2755: Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. +!!! error TS2755: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +!!! error TS2755: Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. +!!! error TS2755: Type 'IPromise' is not assignable to type 'number | PromiseLike'. +!!! error TS2755: Type 'IPromise' is not assignable to type 'PromiseLike'. +!!! error TS2755: Types of property 'then' are incompatible. +!!! error TS2755: Type '(success?: (value: number) => IPromise) => IPromise' is not assignable to type '(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. +!!! error TS2755: Types of parameters 'success' and 'onfulfilled' are incompatible. +!!! error TS2755: Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. +!!! error TS2755: Type 'TResult1' is not assignable to type 'IPromise'. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt index b0091454264..2a473c2d22f 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.errors.txt +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -12,6 +12,12 @@ tests/cases/compiler/recursiveFunctionTypes.ts(33,8): error TS2554: Expected 0-1 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,1): error TS2755: No overload matches this call. + 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; }'. + Overload 2 of 4, '(a: number): number', gave the following error. + Argument of type '""' is not assignable to parameter of type 'number'. + 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; }'. ==== tests/cases/compiler/recursiveFunctionTypes.ts (13 errors) ==== @@ -86,10 +92,10 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2755: No overload f7(""); // ok (function takes an any param) ~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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 TS2760 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; }'. +!!! error TS2755: Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error. +!!! error TS2755: 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: Overload 2 of 4, '(a: number): number', gave the following error. +!!! error TS2755: Argument of type '""' is not assignable to parameter of type 'number'. +!!! error TS2755: 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. +!!! error TS2755: 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 \ No newline at end of file diff --git a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt index 86f3e1c8904..e1a2004542c 100644 --- a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt +++ b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt @@ -1,5 +1,17 @@ tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(7,1): error TS2755: No overload matches this call. + 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'. + 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'. tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2755: No overload matches this call. + 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"'. + 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'. ==== tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts (2 errors) ==== @@ -12,18 +24,18 @@ tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2 x3(1, (x: string) => 1); ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. +!!! error TS2755: Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'. +!!! error TS2755: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. +!!! error TS2755: Argument of type '1' is not assignable to parameter of type 'string'. x3(1, (x: 'hm') => 1); ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. \ No newline at end of file +!!! error TS2755: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. +!!! error TS2755: Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'. +!!! error TS2755: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2755: Type 'number' is not assignable to type '"hm"'. +!!! error TS2755: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. +!!! error TS2755: Argument of type '1' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt index c8528ceaf93..541a327b311 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt @@ -2,10 +2,26 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio 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,9): error TS2755: No overload matches this call. + 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'. + 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'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,9): error TS2755: No overload matches this call. + 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'. + 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'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,9): error TS2755: No overload matches this call. + 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'. + 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'. 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,9): error TS2755: No overload matches this call. + 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'. + 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'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4. @@ -29,24 +45,24 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var c = foo([], 1, 2); // boolean ~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var d = foo([], 1, true); // boolean (with error) ~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var e = foo([], 1, "2"); // {} ~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2755: 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. @@ -57,10 +73,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var x = foo `${1}${true}`; // boolean (with error) ~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2755: 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) ~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt index b103d9eef9e..409cf9fb676 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt @@ -2,10 +2,26 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio 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,9): error TS2755: No overload matches this call. + 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'. + 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'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,9): error TS2755: No overload matches this call. + 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'. + 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'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,9): error TS2755: No overload matches this call. + 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'. + 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'. 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,9): error TS2755: No overload matches this call. + 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'. + 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'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4. @@ -29,24 +45,24 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var c = foo([], 1, 2); // boolean ~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var d = foo([], 1, true); // boolean (with error) ~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var e = foo([], 1, "2"); // {} ~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2755: 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. @@ -57,10 +73,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var x = foo `${1}${true}`; // boolean (with error) ~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2755: 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) ~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt index 06986bf66f7..1432360eba8 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt @@ -1,8 +1,20 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(9,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'number'. 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,1): error TS2755: No overload matches this call. + 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'. + 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'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,1): error TS2755: No overload matches this call. + 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'. + 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'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(69,18): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -18,10 +30,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio fn1 `${ {} }`; // Error ~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. +!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. +!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'. function fn2(strs: TemplateStringsArray, s: string, n: number): number; function fn2(strs: TemplateStringsArray, n: number, t: T): T; @@ -82,17 +94,17 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio fn4 `${ true }${ null }`; ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. +!!! error TS2755: 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; diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt index 1d641d2611e..c3b049af05f 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt @@ -1,8 +1,20 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'number'. 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,1): error TS2755: No overload matches this call. + 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'. + 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'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,1): error TS2755: No overload matches this call. + 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'. + 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'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(69,18): error TS2551: Property 'toFixed' does not exist on type 'string'. Did you mean 'fixed'? @@ -18,10 +30,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio fn1 `${ {} }`; // Error ~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. +!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. +!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'. function fn2(strs: TemplateStringsArray, s: string, n: number): number; function fn2(strs: TemplateStringsArray, n: number, t: T): T; @@ -82,17 +94,17 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio fn4 `${ true }${ null }`; ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. +!!! error TS2755: 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; diff --git a/tests/baselines/reference/tsxElementResolution9.errors.txt b/tests/baselines/reference/tsxElementResolution9.errors.txt index 6686890b839..37a847d0126 100644 --- a/tests/baselines/reference/tsxElementResolution9.errors.txt +++ b/tests/baselines/reference/tsxElementResolution9.errors.txt @@ -1,6 +1,18 @@ tests/cases/conformance/jsx/file.tsx(11,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(n: string): { x: number; }', gave the following error. + Type '{}' is not assignable to type 'string'. + Overload 2 of 2, '(n: number): { y: string; }', gave the following error. + Type '{}' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(18,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(n: string): { x: number; }', gave the following error. + Type '{}' is not assignable to type 'string'. + Overload 2 of 2, '(n: number): { y: string; }', gave the following error. + Type '{}' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(n: string): { x: number; }', gave the following error. + Type '{ x: number; }' is not assignable to type 'string'. + Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. + Type '{ x: number; }' is not assignable to type 'number'. ==== tests/cases/conformance/jsx/file.tsx (3 errors) ==== @@ -17,10 +29,10 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches th ; // Error, return type is not an object type ~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. +!!! error TS2755: Type '{}' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. +!!! error TS2755: Type '{}' is not assignable to type 'number'. interface Obj2 { (n: string): { x: number }; @@ -30,10 +42,10 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches th ; // Error, return type is not an object type ~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. +!!! error TS2755: Type '{}' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. +!!! error TS2755: Type '{}' is not assignable to type 'number'. interface Obj3 { (n: string): { x: number }; @@ -43,8 +55,8 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches th ; // OK ~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. +!!! error TS2755: Type '{ x: number; }' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. +!!! error TS2755: Type '{ x: number; }' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt index c95de6de1f3..bd90b09a12a 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt @@ -1,14 +1,79 @@ tests/cases/conformance/jsx/file.tsx(12,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(): Element', gave the following error. + Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. + Property 'extraProp' does not exist on type 'IntrinsicAttributes'. + Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. + Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. tests/cases/conformance/jsx/file.tsx(13,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(): Element', gave the following error. + Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. + Property 'yy' does not exist on type 'IntrinsicAttributes'. + Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. tests/cases/conformance/jsx/file.tsx(14,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(): Element', gave the following error. + Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'. + Property 'yy1' does not exist on type 'IntrinsicAttributes'. + Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Type 'true' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(16,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(): Element', gave the following error. + Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'. + Property 'y1' does not exist on type 'IntrinsicAttributes'. + Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. + Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. tests/cases/conformance/jsx/file.tsx(17,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(): Element', gave the following error. + Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'. + Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. + Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. + Types of property 'yy' are incompatible. + Type 'boolean' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(25,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. + Type 'true' is not assignable to type 'string'. + Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. + Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. tests/cases/conformance/jsx/file.tsx(26,12): error TS2755: No overload matches this call. + Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. + Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. + Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. + Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(33,12): error TS2755: No overload matches this call. + Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type 'true' is not assignable to type 'string'. + Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + Type 'true' is not assignable to type 'string'. + Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. + Type 'string' is not assignable to type 'boolean'. tests/cases/conformance/jsx/file.tsx(34,12): error TS2755: No overload matches this call. + Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. + Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. + Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. + Type 'string' is not assignable to type 'boolean'. tests/cases/conformance/jsx/file.tsx(35,12): error TS2755: No overload matches this call. + Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + Type 'string' is not assignable to type 'Element'. + Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. + Type 'string' is not assignable to type 'boolean'. tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches this call. + Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. + Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. + Type 'string' is not assignable to type 'boolean'. ==== tests/cases/conformance/jsx/file.tsx (11 errors) ==== @@ -26,47 +91,47 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches t const c0 = ; // extra property; ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:12:13: Overload 1 of 2, '(): Element', gave the following error. - Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. - Property 'extraProp' does not exist on type 'IntrinsicAttributes'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:12:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. - Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. - Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. +!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2755: Property 'extraProp' does not exist on type 'IntrinsicAttributes'. +!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2755: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. +!!! error TS2755: Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. const c1 = ; // missing property; ~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:13:13: Overload 1 of 2, '(): Element', gave the following error. - Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. - Property 'yy' does not exist on type 'IntrinsicAttributes'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:13:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. - Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. +!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2755: Property 'yy' does not exist on type 'IntrinsicAttributes'. +!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2755: Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. const c2 = ; // type incompatible; ~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:14:13: Overload 1 of 2, '(): Element', gave the following error. - Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'. - Property 'yy1' does not exist on type 'IntrinsicAttributes'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:14:31: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. - Type 'true' is not assignable to type 'string'. +!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2755: Property 'yy1' does not exist on type 'IntrinsicAttributes'. +!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'string'. const c3 = ; // This is OK becuase all attribute are spread const c4 = ; // extra property; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:16:13: Overload 1 of 2, '(): Element', gave the following error. - Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'. - Property 'y1' does not exist on type 'IntrinsicAttributes'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:16:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. - Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. - Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. +!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2755: Property 'y1' does not exist on type 'IntrinsicAttributes'. +!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2755: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. +!!! error TS2755: Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. const c5 = ; // type incompatible; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:17:13: Overload 1 of 2, '(): Element', gave the following error. - Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:17:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. - Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. - Types of property 'yy' are incompatible. - Type 'boolean' is not assignable to type 'number'. +!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2755: Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'. +!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2755: Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. +!!! error TS2755: Types of property 'yy' are incompatible. +!!! error TS2755: Type 'boolean' is not assignable to type 'number'. const c6 = ; // Should error as there is extra attribute that doesn't match any. Current it is not const c7 = ; // Should error as there is extra attribute that doesn't match any. Current it is not @@ -77,18 +142,18 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches t const d1 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:25:29: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. - Type 'true' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:25:13: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. - Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. +!!! error TS2755: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. +!!! error TS2755: Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. const d2 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:26:13: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. - Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. - Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:26:40: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. - Type 'string' is not assignable to type 'number'. +!!! error TS2755: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. +!!! error TS2755: Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. +!!! error TS2755: Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. +!!! error TS2755: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'number'. declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element; declare function TestingOptional(a: {y1?: string, y2?: number, children: JSX.Element}): JSX.Element; @@ -98,41 +163,41 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches t const e1 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:33:29: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. - Type 'true' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:33:29: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. - Type 'true' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:33:32: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. - Type 'string' is not assignable to type 'boolean'. +!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'string'. +!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'boolean'. const e2 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:34:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. - Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. - Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:34:13: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. - Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. - Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:34:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. - Type 'string' is not assignable to type 'boolean'. +!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2755: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2755: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2755: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. +!!! error TS2755: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. +!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'boolean'. const e3 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:35:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. - Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. - Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:35:50: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. - Type 'string' is not assignable to type 'Element'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:35:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. - Type 'string' is not assignable to type 'boolean'. +!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2755: Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2755: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'Element'. +!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'boolean'. const e4 = Hi ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:36:13: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. - Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. - Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:36:50: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. - 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:36:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. - Type 'string' is not assignable to type 'boolean'. +!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2755: Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2755: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2755: 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. +!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! error TS2755: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt index f364876a945..680f2903b77 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt @@ -1,7 +1,34 @@ tests/cases/conformance/jsx/file.tsx(48,12): error TS2755: No overload matches this call. + Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. + Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. + Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. + Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. + Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. + Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. tests/cases/conformance/jsx/file.tsx(54,12): error TS2755: No overload matches this call. + Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Type 'number' is not assignable to type 'string'. + Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Type 'number' is not assignable to type 'string'. + Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(55,12): error TS2755: No overload matches this call. + Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Type 'true' is not assignable to type 'string'. + Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Type 'true' is not assignable to type 'string'. + Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. + Type 'true' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No overload matches this call. + Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'. + Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'. + Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. + Type 'true' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (4 errors) ==== @@ -55,15 +82,15 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No overload matches t const b0 = {}}>GO; // extra property; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:48:13: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. - Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. - Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:48:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. - Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:48:13: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. - Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. - Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. +!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2755: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2755: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! error TS2755: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. +!!! error TS2755: Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. const b1 = {}} {...obj0}>Hello world; // extra property; const b2 = ; // extra property const b3 = {}}} />; // extra property @@ -72,27 +99,27 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No overload matches t const b6 = ; // incorrect type for optional attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:54:51: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. - Type 'number' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:54:51: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. - Type 'number' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:54:51: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. - Type 'number' is not assignable to type 'string'. +!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! error TS2755: Type 'number' is not assignable to type 'string'. const b7 = ; // incorrect type for optional attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:55:68: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. - Type 'true' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:55:68: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. - Type 'true' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:55:68: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. - Type 'true' is not assignable to type 'string'. +!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'string'. +!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'string'. +!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'string'. const b8 = ; // incorrect type for specified hyphanated name ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:56:13: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. - Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:56:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. - Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:56:24: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. - Type 'true' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2755: Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'. +!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2755: Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'. +!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! error TS2755: Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt index a8d2a1c004e..ea279fdedfb 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt @@ -1,5 +1,20 @@ tests/cases/conformance/jsx/file.tsx(9,14): error TS2755: No overload matches this call. + Overload 1 of 3, '(): Element', gave the following error. + Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. + Property 'a' does not exist on type 'IntrinsicAttributes'. + Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. + Type 'number' is not assignable to type 'string'. + Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. + Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. tests/cases/conformance/jsx/file.tsx(10,14): error TS2755: No overload matches this call. + Overload 1 of 3, '(): Element', gave the following error. + Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'. + Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. + Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }'. + Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: string; "ignore-prop": boolean; }'. + Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. + Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. + Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. ==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== @@ -14,22 +29,22 @@ tests/cases/conformance/jsx/file.tsx(10,14): error TS2755: No overload matches t let a0 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:9:15: Overload 1 of 3, '(): Element', gave the following error. - Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. - Property 'a' does not exist on type 'IntrinsicAttributes'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:9:33: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. - Type 'number' is not assignable to type 'string'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:9:15: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. - Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. +!!! error TS2755: Overload 1 of 3, '(): Element', gave the following error. +!!! error TS2755: Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2755: Property 'a' does not exist on type 'IntrinsicAttributes'. +!!! error TS2755: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. +!!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! error TS2755: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. +!!! error TS2755: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. let a2 = // missing a ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:10:15: Overload 1 of 3, '(): Element', gave the following error. - Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:10:15: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. - Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }'. - Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: string; "ignore-prop": boolean; }'. -!!! related TS2760 tests/cases/conformance/jsx/file.tsx:10:15: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. - Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. - Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. +!!! error TS2755: Overload 1 of 3, '(): Element', gave the following error. +!!! error TS2755: Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'. +!!! error TS2755: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. +!!! error TS2755: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }'. +!!! error TS2755: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: string; "ignore-prop": boolean; }'. +!!! error TS2755: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. +!!! error TS2755: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. +!!! error TS2755: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. } \ No newline at end of file diff --git a/tests/baselines/reference/unionTypeCallSignatures.errors.txt b/tests/baselines/reference/unionTypeCallSignatures.errors.txt index fd1a5cdb379..01bb58176aa 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeCallSignatures.errors.txt @@ -1,6 +1,14 @@ 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,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(a: number): number | Date', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. + Overload 2 of 2, '(a: string): string | boolean', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(a: number): number | Date', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. + Overload 2 of 2, '(a: string): string | boolean', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. 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'. @@ -42,10 +50,10 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 unionOfDifferentReturnType1(true); // error in type of parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! error TS2755: 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); @@ -53,10 +61,10 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 unionOfDifferentReturnType1(true); // error in type of parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. unionOfDifferentReturnType1(); // error missing parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. diff --git a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt index c277a2f6b24..5913799605b 100644 --- a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt @@ -1,6 +1,14 @@ 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,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(a: number): number | Date', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. + Overload 2 of 2, '(a: string): string | boolean', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(15,1): error TS2755: No overload matches this call. + Overload 1 of 2, '(a: number): number | Date', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'number'. + Overload 2 of 2, '(a: string): string | boolean', gave the following error. + Argument of type 'true' is not assignable to parameter of type 'string'. 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'. @@ -41,10 +49,10 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro new unionOfDifferentReturnType1(true); // error in type of parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! error TS2755: 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); @@ -52,10 +60,10 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro new unionOfDifferentReturnType1(true); // error in type of parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2755: No overload matches this call. -!!! related TS2760 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 TS2760 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'. +!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! error TS2755: 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. From 97784749b5e218843cd5b2574e802900a71cfe2d Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 28 Jun 2019 16:09:54 -0700 Subject: [PATCH 18/26] Fix lint --- src/compiler/checker.ts | 2 +- src/compiler/utilities.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 0f0ba5c786a..5bb5210248d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21658,7 +21658,7 @@ namespace ts { const related = map( max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics), - d => typeof d.messageText === 'string' ? (d as DiagnosticMessageChain) : d.messageText); + d => typeof d.messageText === "string" ? (d as DiagnosticMessageChain) : d.messageText); diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(related, Diagnostics.No_overload_matches_this_call))); } } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 4d7eaf65a24..b575deab62f 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -7201,13 +7201,13 @@ namespace ts { // } function compareMessageText(t1: string | DiagnosticMessageChain, t2: string | DiagnosticMessageChain): Comparison { - if (typeof t1 === 'string' && typeof t2 === 'string') { + if (typeof t1 === "string" && typeof t2 === "string") { return compareStringsCaseSensitive(t1, t2); } - else if (typeof t1 === 'string') { + else if (typeof t1 === "string") { return Comparison.LessThan; } - else if (typeof t2 === 'string') { + else if (typeof t2 === "string") { return Comparison.GreaterThan; } let res = compareStringsCaseSensitive(t1.messageText, t2.messageText); @@ -7228,7 +7228,7 @@ namespace ts { return res; } for (let i = 0; i < t1.next.length; i++) { - res = compareMessageText(t1.next[i], t2.next[i]) + res = compareMessageText(t1.next[i], t2.next[i]); if (res) { return res; } From 34c4047371ea606787238955a5ebe064d0aaaddc Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 28 Jun 2019 16:26:52 -0700 Subject: [PATCH 19/26] Update baselines with new error numbers --- .../reference/bigintWithLib.errors.txt | 50 ++--- .../constructorOverloads1.errors.txt | 24 +-- ...StringLiteralsInJsxAttributes02.errors.txt | 64 +++---- .../controlFlowIterationErrors.errors.txt | 32 ++-- tests/baselines/reference/for-of39.errors.txt | 32 ++-- .../reference/functionOverloads2.errors.txt | 12 +- .../reference/functionOverloads40.errors.txt | 12 +- .../reference/functionOverloads41.errors.txt | 12 +- ...edMethodWithOverloadedArguments.errors.txt | 60 +++--- .../heterogeneousArrayAndOverloads.errors.txt | 8 +- .../reference/incompatibleTypes.errors.txt | 40 ++-- ...ritedConstructorWithRestParams2.errors.txt | 24 +-- .../iterableArrayPattern28.errors.txt | 32 ++-- .../iteratorSpreadInArray6.errors.txt | 22 +-- ...attersForSignatureGroupIdentity.errors.txt | 32 ++-- .../baselines/reference/overload1.errors.txt | 12 +- .../reference/overloadResolution.errors.txt | 36 ++-- ...loadResolutionClassConstructors.errors.txt | 12 +- .../overloadResolutionConstructors.errors.txt | 36 ++-- .../overloadResolutionTest1.errors.txt | 36 ++-- .../overloadingOnConstants2.errors.txt | 12 +- ...nWithConstraintCheckingDeferred.errors.txt | 26 +-- .../overloadsWithProvisionalErrors.errors.txt | 24 +-- .../reference/promiseTypeInference.errors.txt | 24 +-- .../recursiveFunctionTypes.errors.txt | 16 +- ...edSignatureAsCallbackParameter1.errors.txt | 32 ++-- ...eStringsWithOverloadResolution1.errors.txt | 48 ++--- ...ingsWithOverloadResolution1_ES6.errors.txt | 48 ++--- ...eStringsWithOverloadResolution3.errors.txt | 36 ++-- ...ingsWithOverloadResolution3_ES6.errors.txt | 36 ++-- .../tsxElementResolution9.errors.txt | 36 ++-- ...elessFunctionComponentOverload4.errors.txt | 174 +++++++++--------- ...elessFunctionComponentOverload5.errors.txt | 70 +++---- ...ionComponentsWithTypeArguments4.errors.txt | 38 ++-- .../unionTypeCallSignatures.errors.txt | 24 +-- .../unionTypeConstructSignatures.errors.txt | 24 +-- 36 files changed, 628 insertions(+), 628 deletions(-) diff --git a/tests/baselines/reference/bigintWithLib.errors.txt b/tests/baselines/reference/bigintWithLib.errors.txt index 19dc04b17fe..3cb6306a1e0 100644 --- a/tests/baselines/reference/bigintWithLib.errors.txt +++ b/tests/baselines/reference/bigintWithLib.errors.txt @@ -1,5 +1,5 @@ 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,15): error TS2755: No overload matches this call. +tests/cases/compiler/bigintWithLib.ts(16,15): error TS2763: No overload matches this call. Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. Argument of type 'number[]' is not assignable to parameter of type 'number'. Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. @@ -15,7 +15,7 @@ tests/cases/compiler/bigintWithLib.ts(16,15): error TS2755: No overload matches 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(21,13): error TS2540: Cannot assign to 'length' because it is a read-only property. -tests/cases/compiler/bigintWithLib.ts(28,16): error TS2755: No overload matches this call. +tests/cases/compiler/bigintWithLib.ts(28,16): error TS2763: No overload matches this call. Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. Argument of type 'number[]' is not assignable to parameter of type 'number'. Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. @@ -48,21 +48,21 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 bigIntArray = new BigInt64Array([1n, 2n, 3n]); bigIntArray = new BigInt64Array([1, 2, 3]); // should error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. -!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. -!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. -!!! error TS2755: Types of property '[Symbol.iterator]' are incompatible. -!!! error TS2755: Type '() => IterableIterator' is not assignable to type '() => Iterator'. -!!! error TS2755: Type 'IterableIterator' is not assignable to type 'Iterator'. -!!! error TS2755: Types of property 'next' are incompatible. -!!! error TS2755: Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. -!!! error TS2755: Type 'IteratorResult' is not assignable to type 'IteratorResult'. -!!! error TS2755: Type 'number' is not assignable to type 'bigint'. -!!! error TS2755: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error. -!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. -!!! error TS2755: Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. +!!! error TS2763: Argument of type 'number[]' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. +!!! error TS2763: Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2763: Types of property '[Symbol.iterator]' are incompatible. +!!! error TS2763: Type '() => IterableIterator' is not assignable to type '() => Iterator'. +!!! error TS2763: Type 'IterableIterator' is not assignable to type 'Iterator'. +!!! error TS2763: Types of property 'next' are incompatible. +!!! error TS2763: Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. +!!! error TS2763: Type 'IteratorResult' is not assignable to type 'IteratorResult'. +!!! error TS2763: Type 'number' is not assignable to type 'bigint'. +!!! error TS2763: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error. +!!! error TS2763: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. +!!! error TS2763: 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); @@ -78,14 +78,14 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 bigUintArray = new BigUint64Array([1n, 2n, 3n]); bigUintArray = new BigUint64Array([1, 2, 3]); // should error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. -!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. -!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. -!!! error TS2755: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error. -!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. -!!! error TS2755: Type 'number[]' is not assignable to type 'SharedArrayBuffer'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. +!!! error TS2763: Argument of type 'number[]' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. +!!! error TS2763: Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2763: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error. +!!! error TS2763: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. +!!! error TS2763: 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); diff --git a/tests/baselines/reference/constructorOverloads1.errors.txt b/tests/baselines/reference/constructorOverloads1.errors.txt index 9c2db5b39e6..dd0353bbc0e 100644 --- a/tests/baselines/reference/constructorOverloads1.errors.txt +++ b/tests/baselines/reference/constructorOverloads1.errors.txt @@ -2,12 +2,12 @@ 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,10): error TS2755: No overload matches this call. +tests/cases/compiler/constructorOverloads1.ts(16,10): error TS2763: No overload matches this call. Overload 1 of 2, '(s: string): Foo', gave the following error. Argument of type 'Foo' is not assignable to parameter of type 'string'. Overload 2 of 2, '(n: number): Foo', gave the following error. Argument of type 'Foo' is not assignable to parameter of type 'number'. -tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2755: No overload matches this call. +tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2763: No overload matches this call. Overload 1 of 2, '(s: string): Foo', gave the following error. Argument of type 'any[]' is not assignable to parameter of type 'string'. Overload 2 of 2, '(n: number): Foo', gave the following error. @@ -44,18 +44,18 @@ tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2755: No overload var f2 = new Foo(0); var f3 = new Foo(f1); ~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(s: string): Foo', gave the following error. -!!! error TS2755: Argument of type 'Foo' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(n: number): Foo', gave the following error. -!!! error TS2755: Argument of type 'Foo' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(s: string): Foo', gave the following error. +!!! error TS2763: Argument of type 'Foo' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(n: number): Foo', gave the following error. +!!! error TS2763: Argument of type 'Foo' is not assignable to parameter of type 'number'. var f4 = new Foo([f1,f2,f3]); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(s: string): Foo', gave the following error. -!!! error TS2755: Argument of type 'any[]' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(n: number): Foo', gave the following error. -!!! error TS2755: Argument of type 'any[]' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(s: string): Foo', gave the following error. +!!! error TS2763: Argument of type 'any[]' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(n: number): Foo', gave the following error. +!!! error TS2763: Argument of type 'any[]' is not assignable to parameter of type 'number'. f1.bar1(); f1.bar2(); diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt index 28aa026b11f..e09d3c59572 100644 --- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt @@ -1,25 +1,25 @@ -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,12): error TS2755: No overload matches this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,12): error TS2763: No overload matches this call. 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'. 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'. -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,12): error TS2755: No overload matches this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,12): error TS2763: No overload matches this call. 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'. 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'. -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,12): error TS2755: No overload matches this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,12): error TS2763: No overload matches this call. 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'. 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'. -tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,12): error TS2755: No overload matches this call. +tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,12): error TS2763: No overload matches this call. 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'. @@ -61,40 +61,40 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): err const b0 = {console.log(k)}}} extra />; // k has type "left" | "right" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2755: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2755: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2763: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2763: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. const b2 = {console.log(k)}} extra />; // k has type "left" | "right" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2755: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2755: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2755: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2763: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2763: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. const b3 = ; // goTo has type"home" | "contact" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2755: Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2755: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2763: Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2763: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. const b4 = ; // goTo has type "home" | "contact" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2755: Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2755: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2763: Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2763: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. export function NoOverload(buttonProps: ButtonProps): JSX.Element { return undefined } const c1 = {console.log(k)}}} extra />; // k has type any diff --git a/tests/baselines/reference/controlFlowIterationErrors.errors.txt b/tests/baselines/reference/controlFlowIterationErrors.errors.txt index b8c4c21906c..4fe96c97dd3 100644 --- a/tests/baselines/reference/controlFlowIterationErrors.errors.txt +++ b/tests/baselines/reference/controlFlowIterationErrors.errors.txt @@ -2,14 +2,14 @@ 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,13): error TS2755: No overload matches this call. +tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(34,13): error TS2763: No overload matches this call. 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'. 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'. -tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error TS2755: No overload matches this call. +tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error TS2763: No overload matches this call. 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'. @@ -60,13 +60,13 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error while (cond) { x = foo(x); ~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(x: string): number', gave the following error. -!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'string'. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 2, '(x: number): string', gave the following error. -!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'number'. -!!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(x: string): number', gave the following error. +!!! error TS2763: Argument of type 'string | number' is not assignable to parameter of type 'string'. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 2, '(x: number): string', gave the following error. +!!! error TS2763: Argument of type 'string | number' is not assignable to parameter of type 'number'. +!!! error TS2763: Type 'string' is not assignable to type 'number'. x; } x; @@ -79,13 +79,13 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error x; x = foo(x); ~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(x: string): number', gave the following error. -!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'string'. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 2, '(x: number): string', gave the following error. -!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'number'. -!!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(x: string): number', gave the following error. +!!! error TS2763: Argument of type 'string | number' is not assignable to parameter of type 'string'. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 2, '(x: number): string', gave the following error. +!!! error TS2763: Argument of type 'string | number' is not assignable to parameter of type 'number'. +!!! error TS2763: Type 'string' is not assignable to type 'number'. } x; } diff --git a/tests/baselines/reference/for-of39.errors.txt b/tests/baselines/reference/for-of39.errors.txt index 77f8bff4412..364f225e497 100644 --- a/tests/baselines/reference/for-of39.errors.txt +++ b/tests/baselines/reference/for-of39.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2755: No overload matches this call. +tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2763: No overload matches this call. Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable'. Types of property '[Symbol.iterator]' are incompatible. @@ -18,21 +18,21 @@ tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2755: No ==== tests/cases/conformance/es6/for-ofStatements/for-of39.ts (1 errors) ==== var map = new Map([["", true], ["", 0]]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. -!!! error TS2755: Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable'. -!!! error TS2755: Types of property '[Symbol.iterator]' are incompatible. -!!! error TS2755: Type '() => IterableIterator<[string, number] | [string, true]>' is not assignable to type '() => Iterator'. -!!! error TS2755: Type 'IterableIterator<[string, number] | [string, true]>' is not assignable to type 'Iterator'. -!!! error TS2755: Types of property 'next' are incompatible. -!!! error TS2755: Type '(value?: any) => IteratorResult<[string, number] | [string, true]>' is not assignable to type '(value?: any) => IteratorResult'. -!!! error TS2755: Type 'IteratorResult<[string, number] | [string, true]>' is not assignable to type 'IteratorResult'. -!!! error TS2755: Type '[string, number] | [string, true]' is not assignable to type 'readonly [string, boolean]'. -!!! error TS2755: Type '[string, number]' is not assignable to type 'readonly [string, boolean]'. -!!! error TS2755: Types of property '1' are incompatible. -!!! error TS2755: Type 'number' is not assignable to type 'boolean'. -!!! error TS2755: Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map', gave the following error. -!!! error TS2755: Type 'number' is not assignable to type 'boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. +!!! error TS2763: Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2763: Types of property '[Symbol.iterator]' are incompatible. +!!! error TS2763: Type '() => IterableIterator<[string, number] | [string, true]>' is not assignable to type '() => Iterator'. +!!! error TS2763: Type 'IterableIterator<[string, number] | [string, true]>' is not assignable to type 'Iterator'. +!!! error TS2763: Types of property 'next' are incompatible. +!!! error TS2763: Type '(value?: any) => IteratorResult<[string, number] | [string, true]>' is not assignable to type '(value?: any) => IteratorResult'. +!!! error TS2763: Type 'IteratorResult<[string, number] | [string, true]>' is not assignable to type 'IteratorResult'. +!!! error TS2763: Type '[string, number] | [string, true]' is not assignable to type 'readonly [string, boolean]'. +!!! error TS2763: Type '[string, number]' is not assignable to type 'readonly [string, boolean]'. +!!! error TS2763: Types of property '1' are incompatible. +!!! error TS2763: Type 'number' is not assignable to type 'boolean'. +!!! error TS2763: Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map', gave the following error. +!!! error TS2763: Type 'number' is not assignable to type 'boolean'. for (var [k, v] of map) { k; v; diff --git a/tests/baselines/reference/functionOverloads2.errors.txt b/tests/baselines/reference/functionOverloads2.errors.txt index 785844037fa..e07242a9c0d 100644 --- a/tests/baselines/reference/functionOverloads2.errors.txt +++ b/tests/baselines/reference/functionOverloads2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads2.ts(4,9): error TS2755: No overload matches this call. +tests/cases/compiler/functionOverloads2.ts(4,9): error TS2763: No overload matches this call. Overload 1 of 2, '(bar: string): string', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. Overload 2 of 2, '(bar: number): number', gave the following error. @@ -11,8 +11,8 @@ tests/cases/compiler/functionOverloads2.ts(4,9): error TS2755: No overload match function foo(bar: any): any { return bar }; var x = foo(true); ~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(bar: string): string', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(bar: number): number', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. \ No newline at end of file +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(bar: string): string', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(bar: number): number', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt index ce7472e1936..e3e7d3a25e7 100644 --- a/tests/baselines/reference/functionOverloads40.errors.txt +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No overload matches this call. +tests/cases/compiler/functionOverloads40.ts(4,9): error TS2763: No overload matches this call. Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. Type 'string' is not assignable to type 'number'. Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. @@ -11,9 +11,9 @@ tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No overload matc function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{a:'bar'}]); ~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! error TS2763: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads41.errors.txt b/tests/baselines/reference/functionOverloads41.errors.txt index a26840f22f0..f475095fdb9 100644 --- a/tests/baselines/reference/functionOverloads41.errors.txt +++ b/tests/baselines/reference/functionOverloads41.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No overload matches this call. +tests/cases/compiler/functionOverloads41.ts(4,9): error TS2763: No overload matches this call. Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. Property 'a' is missing in type '{}' but required in type '{ a: number; }'. Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. @@ -11,9 +11,9 @@ tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No overload matc function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{}]); ~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. -!!! error TS2755: Property 'a' is missing in type '{}' but required in type '{ a: number; }'. -!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. -!!! error TS2755: Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2763: Property 'a' is missing in type '{}' but required in type '{ a: number; }'. +!!! error TS2763: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. +!!! error TS2763: Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt index 10673021477..bc4ecd03fdb 100644 --- a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt +++ b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(23,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(52,22): error TS2755: No overload matches this call. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(52,22): error TS2763: No overload matches this call. Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. @@ -9,7 +9,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(68,22): error TS2755: No overload matches this call. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(68,22): error TS2763: No overload matches this call. Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. @@ -20,7 +20,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(84,22): error TS2755: No overload matches this call. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(84,22): error TS2763: No overload matches this call. Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. @@ -88,14 +88,14 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. -!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. -!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. +!!! error TS2763: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. +!!! error TS2763: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. } ////////////////////////////////////// @@ -113,17 +113,17 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. -!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. -!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2755: Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. -!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. +!!! error TS2763: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. +!!! error TS2763: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2763: Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. +!!! error TS2763: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. } ////////////////////////////////////// @@ -141,13 +141,13 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var numPromise: Promise; var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. -!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2755: Type 'number' is not assignable to type 'boolean'. -!!! error TS2755: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. -!!! error TS2755: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. +!!! error TS2763: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2763: Type 'number' is not assignable to type 'boolean'. +!!! error TS2763: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. +!!! error TS2763: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. } \ No newline at end of file diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt index 2f3a813bf85..8b7672c3b24 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No overload matches this call. +tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2763: No overload matches this call. Overload 1 of 2, '(arg1: number[]): any', gave the following error. Type 'string' is not assignable to type 'number'. @@ -14,8 +14,8 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No ov this.test([]); this.test([1, 2, "hi", 5]); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(arg1: number[]): any', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(arg1: number[]): any', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'number'. } } \ No newline at end of file diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index 296b749cce8..eb1496057cc 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -9,7 +9,7 @@ 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,1): error TS2755: No overload matches this call. +tests/cases/compiler/incompatibleTypes.ts(42,1): error TS2763: No overload matches this call. 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. @@ -20,7 +20,7 @@ tests/cases/compiler/incompatibleTypes.ts(42,1): error TS2755: No overload match 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,1): error TS2755: No overload matches this call. +tests/cases/compiler/incompatibleTypes.ts(49,1): error TS2763: No overload matches this call. 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; }'. @@ -92,17 +92,17 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => var c2: C2; if1(c1); ~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(i: IFoo1): void', gave the following error. -!!! error TS2755: Argument of type 'C1' is not assignable to parameter of type 'IFoo1'. -!!! error TS2755: Types of property 'p1' are incompatible. -!!! error TS2755: Type '() => string' is not assignable to type '() => number'. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! error TS2755: Overload 2 of 2, '(i: IFoo2): void', gave the following error. -!!! error TS2755: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. -!!! error TS2755: Types of property 'p1' are incompatible. -!!! error TS2755: Type '() => string' is not assignable to type '(s: string) => number'. -!!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(i: IFoo1): void', gave the following error. +!!! error TS2763: Argument of type 'C1' is not assignable to parameter of type 'IFoo1'. +!!! error TS2763: Types of property 'p1' are incompatible. +!!! error TS2763: Type '() => string' is not assignable to type '() => number'. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! error TS2763: Overload 2 of 2, '(i: IFoo2): void', gave the following error. +!!! error TS2763: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. +!!! error TS2763: Types of property 'p1' are incompatible. +!!! error TS2763: Type '() => string' is not assignable to type '(s: string) => number'. +!!! error TS2763: Type 'string' is not assignable to type 'number'. function of1(n: { a: { a: string; }; b: string; }): number; @@ -111,13 +111,13 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => of1({ e: 0, f: 0 }); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. -!!! error TS2755: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'. -!!! error TS2755: Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. -!!! error TS2755: Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error. -!!! error TS2755: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. -!!! error TS2755: Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. +!!! error TS2763: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'. +!!! error TS2763: Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. +!!! error TS2763: Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error. +!!! error TS2763: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. +!!! error TS2763: Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. interface IMap { [key:string]:string; diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt index c11826196c4..dcd7912511e 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt @@ -1,10 +1,10 @@ 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,1): error TS2755: No overload matches this call. +tests/cases/compiler/inheritedConstructorWithRestParams2.ts(33,1): error TS2763: No overload matches this call. Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. Argument of type '""' is not assignable to parameter of type 'number'. 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'. -tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2755: No overload matches this call. +tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2763: No overload matches this call. Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. Argument of type '""' is not assignable to parameter of type 'number'. Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. @@ -48,15 +48,15 @@ tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2755: !!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new Derived("", 3, "", 3); ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. -!!! error TS2755: Argument of type '""' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. -!!! error TS2755: Argument of type '3' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. +!!! error TS2763: Argument of type '""' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. +!!! error TS2763: Argument of type '3' is not assignable to parameter of type 'string'. new Derived("", 3, "", ""); ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. -!!! error TS2755: Argument of type '""' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. -!!! error TS2755: Argument of type '3' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. +!!! error TS2763: Argument of type '""' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. +!!! error TS2763: Argument of type '3' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern28.errors.txt b/tests/baselines/reference/iterableArrayPattern28.errors.txt index 2591d3f9ef7..1d7a98f24cb 100644 --- a/tests/baselines/reference/iterableArrayPattern28.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern28.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error TS2755: No overload matches this call. +tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error TS2763: No overload matches this call. Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. Types of property '[Symbol.iterator]' are incompatible. @@ -19,18 +19,18 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. -!!! error TS2755: Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. -!!! error TS2755: Types of property '[Symbol.iterator]' are incompatible. -!!! error TS2755: Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator'. -!!! error TS2755: Type 'IterableIterator<[string, number] | [string, boolean]>' is not assignable to type 'Iterator'. -!!! error TS2755: Types of property 'next' are incompatible. -!!! error TS2755: Type '(value?: any) => IteratorResult<[string, number] | [string, boolean]>' is not assignable to type '(value?: any) => IteratorResult'. -!!! error TS2755: Type 'IteratorResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. -!!! error TS2755: Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. -!!! error TS2755: Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. -!!! error TS2755: Types of property '1' are incompatible. -!!! error TS2755: Type 'boolean' is not assignable to type 'number'. -!!! error TS2755: Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(iterable: Iterable): Map', gave the following error. +!!! error TS2763: Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2763: Types of property '[Symbol.iterator]' are incompatible. +!!! error TS2763: Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator'. +!!! error TS2763: Type 'IterableIterator<[string, number] | [string, boolean]>' is not assignable to type 'Iterator'. +!!! error TS2763: Types of property 'next' are incompatible. +!!! error TS2763: Type '(value?: any) => IteratorResult<[string, number] | [string, boolean]>' is not assignable to type '(value?: any) => IteratorResult'. +!!! error TS2763: Type 'IteratorResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. +!!! error TS2763: Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. +!!! error TS2763: Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. +!!! error TS2763: Types of property '1' are incompatible. +!!! error TS2763: Type 'boolean' is not assignable to type 'number'. +!!! error TS2763: Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt index b3ce072c8e4..7a3695df7e3 100644 --- a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2755: No overload matches this call. +tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2763: No overload matches this call. Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. Types of property 'slice' are incompatible. @@ -27,13 +27,13 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2755 var array: number[] = [0, 1]; array.concat([...new SymbolIterator]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. -!!! error TS2755: Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. -!!! error TS2755: Types of property 'slice' are incompatible. -!!! error TS2755: Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'. -!!! error TS2755: Type 'symbol[]' is not assignable to type 'number[]'. -!!! error TS2755: Type 'symbol' is not assignable to type 'number'. -!!! error TS2755: Overload 2 of 2, '(...items: (number | ConcatArray)[]): number[]', gave the following error. -!!! error TS2755: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. -!!! error TS2755: Type 'symbol[]' is not assignable to type 'ConcatArray'. \ No newline at end of file +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. +!!! error TS2763: Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. +!!! error TS2763: Types of property 'slice' are incompatible. +!!! error TS2763: Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'. +!!! error TS2763: Type 'symbol[]' is not assignable to type 'number[]'. +!!! error TS2763: Type 'symbol' is not assignable to type 'number'. +!!! error TS2763: Overload 2 of 2, '(...items: (number | ConcatArray)[]): number[]', gave the following error. +!!! error TS2763: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. +!!! error TS2763: Type 'symbol[]' is not assignable to type 'ConcatArray'. \ No newline at end of file diff --git a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt index 3365a92b749..da785d6b8eb 100644 --- a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt +++ b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,1): error TS2755: No overload matches this call. +tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,1): error TS2763: No overload matches this call. 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; }'. @@ -6,7 +6,7 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,1): error TS275 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(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,1): error TS2755: No overload matches this call. +tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS2763: No overload matches this call. 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; }'. @@ -36,13 +36,13 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS275 v({ s: "", n: 0 }).toLowerCase(); ~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. -!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. -!!! error TS2755: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. -!!! error TS2755: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. -!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. -!!! error TS2755: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. +!!! error TS2763: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. +!!! error TS2763: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. +!!! error TS2763: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. +!!! error TS2763: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. +!!! error TS2763: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. var w: A; var w: C; @@ -52,10 +52,10 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS275 w({ s: "", n: 0 }).toLowerCase(); ~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. -!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. -!!! error TS2755: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. -!!! error TS2755: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. -!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. -!!! error TS2755: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. \ No newline at end of file +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. +!!! error TS2763: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'. +!!! error TS2763: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. +!!! error TS2763: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. +!!! error TS2763: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. +!!! error TS2763: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/overload1.errors.txt b/tests/baselines/reference/overload1.errors.txt index 576ca81fe73..e92f1440618 100644 --- a/tests/baselines/reference/overload1.errors.txt +++ b/tests/baselines/reference/overload1.errors.txt @@ -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,5): 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,3): error TS2755: No overload matches this call. +tests/cases/compiler/overload1.ts(34,3): error TS2763: No overload matches this call. 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'. Overload 2 of 2, '(s1: number, s2: string): number', gave the following error. @@ -57,11 +57,11 @@ tests/cases/compiler/overload1.ts(34,3): error TS2755: No overload matches this !!! error TS2322: Type 'C' is not assignable to type 'string'. z=x.h(2,2); // no match ~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(s1: string, s2: number): string', gave the following error. -!!! error TS2755: Argument of type '2' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(s1: number, s2: string): number', gave the following error. -!!! error TS2755: Argument of type '2' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(s1: string, s2: number): string', gave the following error. +!!! error TS2763: Argument of type '2' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(s1: number, s2: string): number', gave the following error. +!!! error TS2763: Argument of type '2' is not assignable to parameter of type 'string'. z=x.h("hello",0); // good var v=x.g; diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index d2c21b4ea7b..bb4952cef67 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,1): error TS2755: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,1): error TS2763: No overload matches this call. Overload 1 of 2, '(s: string): string', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. Overload 2 of 2, '(s: number): number', gave the following error. @@ -8,12 +8,12 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): e 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,1): error TS2755: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,1): error TS2763: No overload matches this call. 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'. 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'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,1): error TS2755: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,1): error TS2763: No overload matches this call. 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'. Overload 2 of 2, '(n: any, m: string): any', gave the following error. @@ -51,11 +51,11 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // No candidate overloads found fn1({}); // Error ~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(s: string): string', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(s: number): number', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(s: string): string', gave the following error. +!!! error TS2763: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(s: number): number', gave the following error. +!!! error TS2763: 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; @@ -124,18 +124,18 @@ 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 TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(n: string, m: any): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(n: number, m: any): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(n: string, m: any): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(n: number, m: any): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. fn4(null, true); // Error ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(n: any, m: number): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 2, '(n: any, m: string): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(n: any, m: number): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 2, '(n: any, m: string): any', gave the following error. +!!! error TS2763: 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; diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index 2eaf7490759..295c219e26e 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,1): error TS2755: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,1): error TS2763: No overload matches this call. Overload 1 of 2, '(s: string): fn1', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. Overload 2 of 2, '(s: number): fn1', gave the following error. @@ -47,11 +47,11 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru // No candidate overloads found new fn1({}); // Error ~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(s: string): fn1', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(s: number): fn1', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(s: string): fn1', gave the following error. +!!! error TS2763: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(s: number): fn1', gave the following error. +!!! error TS2763: 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 { diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index c4972bb89eb..0f0468bf630 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,1): error TS2755: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,1): error TS2763: No overload matches this call. Overload 1 of 2, '(s: string): string', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. Overload 2 of 2, '(s: number): number', gave the following error. @@ -8,12 +8,12 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors 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,1): error TS2755: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,1): error TS2763: No overload matches this call. 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'. 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'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,1): error TS2755: No overload matches this call. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,1): error TS2763: No overload matches this call. 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'. Overload 2 of 2, '(n: any, m: string): any', gave the following error. @@ -51,11 +51,11 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // No candidate overloads found new fn1({}); // Error ~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(s: string): string', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(s: number): number', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(s: string): string', gave the following error. +!!! error TS2763: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(s: number): number', gave the following error. +!!! error TS2763: 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 { @@ -131,18 +131,18 @@ 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 TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(n: string, m: any): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(n: number, m: any): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(n: string, m: any): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(n: number, m: any): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. new fn4(null, true); // Error ~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(n: any, m: number): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 2, '(n: any, m: string): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(n: any, m: number): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 2, '(n: any, m: string): any', gave the following error. +!!! error TS2763: 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 { diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt index 06050fb2192..ad3b6779be5 100644 --- a/tests/baselines/reference/overloadResolutionTest1.errors.txt +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -1,14 +1,14 @@ -tests/cases/compiler/overloadResolutionTest1.ts(7,12): error TS2755: No overload matches this call. +tests/cases/compiler/overloadResolutionTest1.ts(7,12): error TS2763: No overload matches this call. Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. Type 'string' is not assignable to type 'number'. Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. Type 'string' is not assignable to type 'boolean'. -tests/cases/compiler/overloadResolutionTest1.ts(18,10): error TS2755: No overload matches this call. +tests/cases/compiler/overloadResolutionTest1.ts(18,10): error TS2763: No overload matches this call. Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. Type 'string' is not assignable to type 'number'. Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. Type 'string' is not assignable to type 'boolean'. -tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload matches this call. +tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2763: No overload matches this call. Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. Type 'true' is not assignable to type 'number'. Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. @@ -24,11 +24,11 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload var x11 = foo([{a:0}]); // works var x111 = foo([{a:"s"}]); // error - does not match any signature ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! error TS2763: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'boolean'. var x1111 = foo([{a:null}]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string @@ -41,11 +41,11 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload var x3 = foo2({a:true}); // works var x4 = foo2({a:"s"}); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! error TS2763: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'boolean'. function foo4(bar:{a:number;}):number; @@ -53,8 +53,8 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload function foo4(bar:{a:any;}):any{ return bar }; var x = foo4({a:true}); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'number'. -!!! error TS2755: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'number'. +!!! error TS2763: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadingOnConstants2.errors.txt b/tests/baselines/reference/overloadingOnConstants2.errors.txt index aafe28250ad..e252ebc8d69 100644 --- a/tests/baselines/reference/overloadingOnConstants2.errors.txt +++ b/tests/baselines/reference/overloadingOnConstants2.errors.txt @@ -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,9): error TS2755: No overload matches this call. +tests/cases/compiler/overloadingOnConstants2.ts(15,9): error TS2763: No overload matches this call. 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"'. Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error. @@ -27,11 +27,11 @@ tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: This overl var b: E = foo("bye", []); // E var c = foo("um", []); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error. -!!! error TS2755: Argument of type '"um"' is not assignable to parameter of type '"hi"'. -!!! error TS2755: Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error. -!!! error TS2755: Argument of type '"um"' is not assignable to parameter of type '"bye"'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error. +!!! error TS2763: Argument of type '"um"' is not assignable to parameter of type '"hi"'. +!!! error TS2763: Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error. +!!! error TS2763: Argument of type '"um"' is not assignable to parameter of type '"bye"'. //function bar(x: "hi", items: string[]): D; diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt index 75688b0d459..e6f568f0d29 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -3,7 +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,23): error TS2755: No overload matches this call. +tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,23): error TS2763: No overload matches this call. Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. Type 'G' is not assignable to type 'number'. @@ -56,16 +56,16 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): ~~~~~~~~~~~~~ }); ~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. -!!! error TS2755: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. -!!! error TS2755: Type 'G' is not assignable to type 'number'. -!!! error TS2755: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. -!!! error TS2755: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. -!!! error TS2755: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2755: Property 'q' is missing in type 'C' but required in type 'D'. -!!! error TS2755: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. -!!! error TS2755: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. -!!! error TS2755: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2755: Property 'q' is missing in type 'B' but required in type 'D'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. +!!! error TS2763: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. +!!! error TS2763: Type 'G' is not assignable to type 'number'. +!!! error TS2763: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. +!!! error TS2763: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. +!!! error TS2763: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2763: Property 'q' is missing in type 'C' but required in type 'D'. +!!! error TS2763: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. +!!! error TS2763: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. +!!! error TS2763: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2763: Property 'q' is missing in type 'B' but required in type 'D'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt index 3bdc2092e9f..0c9a607b13c 100644 --- a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,1): error TS2755: No overload matches this call. +tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,1): error TS2763: No overload matches this call. Overload 1 of 2, '(s: string): number', gave the following error. Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b tests/cases/compiler/overloadsWithProvisionalErrors.ts(7,17): error TS2304: Cannot find name 'blah'. -tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,1): error TS2755: No overload matches this call. +tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,1): error TS2763: No overload matches this call. Overload 1 of 2, '(s: string): number', gave the following error. Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. @@ -20,20 +20,20 @@ tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cann func(s => ({})); // Error for no applicable overload (object type is missing a and b) ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(s: string): number', gave the following error. -!!! error TS2755: Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. -!!! error TS2755: Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(s: string): number', gave the following error. +!!! error TS2763: Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. +!!! error TS2763: Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) ~~~~ !!! error TS2304: Cannot find name 'blah'. func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(s: string): number', gave the following error. -!!! error TS2755: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. -!!! error TS2755: Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(s: string): number', gave the following error. +!!! error TS2763: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. +!!! error TS2763: Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. ~~~~ !!! error TS2304: Cannot find name 'blah'. \ No newline at end of file diff --git a/tests/baselines/reference/promiseTypeInference.errors.txt b/tests/baselines/reference/promiseTypeInference.errors.txt index c2f3c51f0ec..9207b909984 100644 --- a/tests/baselines/reference/promiseTypeInference.errors.txt +++ b/tests/baselines/reference/promiseTypeInference.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2755: No overload matches this call. +tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2763: No overload matches this call. Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. @@ -23,15 +23,15 @@ tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2755: No overload m var $$x = load("something").then(s => convert(s)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. -!!! error TS2755: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! error TS2755: Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. -!!! error TS2755: Type 'IPromise' is not assignable to type 'number | PromiseLike'. -!!! error TS2755: Type 'IPromise' is not assignable to type 'PromiseLike'. -!!! error TS2755: Types of property 'then' are incompatible. -!!! error TS2755: Type '(success?: (value: number) => IPromise) => IPromise' is not assignable to type '(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. -!!! error TS2755: Types of parameters 'success' and 'onfulfilled' are incompatible. -!!! error TS2755: Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. -!!! error TS2755: Type 'TResult1' is not assignable to type 'IPromise'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(success?: (value: string) => Promise): Promise', gave the following error. +!!! error TS2763: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +!!! error TS2763: Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike, onrejected?: (reason: any) => PromiseLike): Promise', gave the following error. +!!! error TS2763: Type 'IPromise' is not assignable to type 'number | PromiseLike'. +!!! error TS2763: Type 'IPromise' is not assignable to type 'PromiseLike'. +!!! error TS2763: Types of property 'then' are incompatible. +!!! error TS2763: Type '(success?: (value: number) => IPromise) => IPromise' is not assignable to type '(onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. +!!! error TS2763: Types of parameters 'success' and 'onfulfilled' are incompatible. +!!! error TS2763: Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. +!!! error TS2763: Type 'TResult1' is not assignable to type 'IPromise'. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt index 2a473c2d22f..a0dd30498aa 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.errors.txt +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -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,1): error TS2755: No overload matches this call. +tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2763: No overload matches this call. 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; }'. Overload 2 of 4, '(a: number): number', gave the following error. @@ -91,11 +91,11 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2755: No overload !!! error TS2554: Expected 0-1 arguments, but got 2. f7(""); // ok (function takes an any param) ~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error. -!!! error TS2755: 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: Overload 2 of 4, '(a: number): number', gave the following error. -!!! error TS2755: Argument of type '""' is not assignable to parameter of type 'number'. -!!! error TS2755: 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. -!!! error TS2755: 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 TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error. +!!! error TS2763: 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 TS2763: Overload 2 of 4, '(a: number): number', gave the following error. +!!! error TS2763: Argument of type '""' is not assignable to parameter of type 'number'. +!!! error TS2763: 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. +!!! error TS2763: 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 \ No newline at end of file diff --git a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt index e1a2004542c..eb6f115089e 100644 --- a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt +++ b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(7,1): error TS2755: No overload matches this call. +tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(7,1): error TS2763: No overload matches this call. 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'. 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'. -tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2755: No overload matches this call. +tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2763: No overload matches this call. 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. @@ -23,19 +23,19 @@ tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2 // both are errors x3(1, (x: string) => 1); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. -!!! error TS2755: Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'. -!!! error TS2755: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. -!!! error TS2755: Argument of type '1' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. +!!! error TS2763: Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'. +!!! error TS2763: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. +!!! error TS2763: Argument of type '1' is not assignable to parameter of type 'string'. x3(1, (x: 'hm') => 1); ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. -!!! error TS2755: Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'. -!!! error TS2755: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2755: Type 'number' is not assignable to type '"hm"'. -!!! error TS2755: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. -!!! error TS2755: Argument of type '1' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. +!!! error TS2763: Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'. +!!! error TS2763: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2763: Type 'number' is not assignable to type '"hm"'. +!!! error TS2763: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. +!!! error TS2763: Argument of type '1' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt index 541a327b311..30cd75338e6 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt @@ -1,23 +1,23 @@ 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,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(11,9): error TS2763: No overload matches this call. 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'. 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'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,9): error TS2763: No overload matches this call. 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'. 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'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,9): error TS2763: No overload matches this call. 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'. 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'. 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,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,9): error TS2763: No overload matches this call. 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'. Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. @@ -44,25 +44,25 @@ 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 TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var d = foo([], 1, true); // boolean (with error) ~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var e = foo([], 1, "2"); // {} ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2763: 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. @@ -72,11 +72,11 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var w = foo `${1}${2}`; // boolean var x = foo `${1}${true}`; // boolean (with error) ~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2763: 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) ~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt index 409cf9fb676..d2c259d125b 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt @@ -1,23 +1,23 @@ 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,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,9): error TS2763: No overload matches this call. 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'. 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'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,9): error TS2763: No overload matches this call. 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'. 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'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,9): error TS2763: No overload matches this call. 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'. 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'. 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,9): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,9): error TS2763: No overload matches this call. 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'. Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. @@ -44,25 +44,25 @@ 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 TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var d = foo([], 1, true); // boolean (with error) ~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. var e = foo([], 1, "2"); // {} ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2763: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2763: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2763: 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. @@ -72,11 +72,11 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var w = foo `${1}${2}`; // boolean var x = foo `${1}${true}`; // boolean (with error) ~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2763: 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) ~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt index 1432360eba8..12fd697fc67 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(9,1): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(9,1): error TS2763: No overload matches this call. Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. Argument of type '{}' is not assignable to parameter of type 'number'. 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,1): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(62,1): error TS2763: No overload matches this call. 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'. 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'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,1): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,1): error TS2763: No overload matches this call. 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'. Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. @@ -29,11 +29,11 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // No candidate overloads found fn1 `${ {} }`; // Error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. +!!! error TS2763: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. +!!! error TS2763: Argument of type '{}' is not assignable to parameter of type 'number'. function fn2(strs: TemplateStringsArray, s: string, n: number): number; function fn2(strs: TemplateStringsArray, n: number, t: T): T; @@ -93,18 +93,18 @@ 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 TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. +!!! error TS2763: 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; diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt index c3b049af05f..312f22e0e71 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,1): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,1): error TS2763: No overload matches this call. Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. Argument of type '{}' is not assignable to parameter of type 'string'. Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. Argument of type '{}' is not assignable to parameter of type 'number'. 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,1): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,1): error TS2763: No overload matches this call. 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'. 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'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,1): error TS2755: No overload matches this call. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,1): error TS2763: No overload matches this call. 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'. Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. @@ -29,11 +29,11 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // No candidate overloads found fn1 `${ {} }`; // Error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. -!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. +!!! error TS2763: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. +!!! error TS2763: Argument of type '{}' is not assignable to parameter of type 'number'. function fn2(strs: TemplateStringsArray, s: string, n: number): number; function fn2(strs: TemplateStringsArray, n: number, t: T): T; @@ -93,18 +93,18 @@ 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 TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. -!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. +!!! error TS2763: 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; diff --git a/tests/baselines/reference/tsxElementResolution9.errors.txt b/tests/baselines/reference/tsxElementResolution9.errors.txt index 37a847d0126..3aa151d7f5d 100644 --- a/tests/baselines/reference/tsxElementResolution9.errors.txt +++ b/tests/baselines/reference/tsxElementResolution9.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/jsx/file.tsx(11,1): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(11,1): error TS2763: No overload matches this call. Overload 1 of 2, '(n: string): { x: number; }', gave the following error. Type '{}' is not assignable to type 'string'. Overload 2 of 2, '(n: number): { y: string; }', gave the following error. Type '{}' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(18,1): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(18,1): error TS2763: No overload matches this call. Overload 1 of 2, '(n: string): { x: number; }', gave the following error. Type '{}' is not assignable to type 'string'. Overload 2 of 2, '(n: number): { y: string; }', gave the following error. Type '{}' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(25,1): error TS2763: No overload matches this call. Overload 1 of 2, '(n: string): { x: number; }', gave the following error. Type '{ x: number; }' is not assignable to type 'string'. Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. @@ -28,11 +28,11 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches th var Obj1: Obj1; ; // Error, return type is not an object type ~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. -!!! error TS2755: Type '{}' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. -!!! error TS2755: Type '{}' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. +!!! error TS2763: Type '{}' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. +!!! error TS2763: Type '{}' is not assignable to type 'number'. interface Obj2 { (n: string): { x: number }; @@ -41,11 +41,11 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches th var Obj2: Obj2; ; // Error, return type is not an object type ~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. -!!! error TS2755: Type '{}' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. -!!! error TS2755: Type '{}' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. +!!! error TS2763: Type '{}' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. +!!! error TS2763: Type '{}' is not assignable to type 'number'. interface Obj3 { (n: string): { x: number }; @@ -54,9 +54,9 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches th var Obj3: Obj3; ; // OK ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. -!!! error TS2755: Type '{ x: number; }' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. -!!! error TS2755: Type '{ x: number; }' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. +!!! error TS2763: Type '{ x: number; }' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. +!!! error TS2763: Type '{ x: number; }' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt index bd90b09a12a..c9f17da6254 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt @@ -1,55 +1,55 @@ -tests/cases/conformance/jsx/file.tsx(12,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(12,12): error TS2763: No overload matches this call. Overload 1 of 2, '(): Element', gave the following error. Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. Property 'extraProp' does not exist on type 'IntrinsicAttributes'. Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -tests/cases/conformance/jsx/file.tsx(13,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(13,12): error TS2763: No overload matches this call. Overload 1 of 2, '(): Element', gave the following error. Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. Property 'yy' does not exist on type 'IntrinsicAttributes'. Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. -tests/cases/conformance/jsx/file.tsx(14,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(14,12): error TS2763: No overload matches this call. Overload 1 of 2, '(): Element', gave the following error. Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'. Property 'yy1' does not exist on type 'IntrinsicAttributes'. Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type 'true' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(16,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(16,12): error TS2763: No overload matches this call. Overload 1 of 2, '(): Element', gave the following error. Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'. Property 'y1' does not exist on type 'IntrinsicAttributes'. Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -tests/cases/conformance/jsx/file.tsx(17,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(17,12): error TS2763: No overload matches this call. Overload 1 of 2, '(): Element', gave the following error. Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'. Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. Types of property 'yy' are incompatible. Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(25,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(25,12): error TS2763: No overload matches this call. Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. Type 'true' is not assignable to type 'string'. Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. -tests/cases/conformance/jsx/file.tsx(26,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(26,12): error TS2763: No overload matches this call. Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(33,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(33,12): error TS2763: No overload matches this call. Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. Type 'true' is not assignable to type 'string'. Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. Type 'true' is not assignable to type 'string'. Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/file.tsx(34,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(34,12): error TS2763: No overload matches this call. Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. @@ -58,7 +58,7 @@ tests/cases/conformance/jsx/file.tsx(34,12): error TS2755: No overload matches t Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/file.tsx(35,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(35,12): error TS2763: No overload matches this call. Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. @@ -66,7 +66,7 @@ tests/cases/conformance/jsx/file.tsx(35,12): error TS2755: No overload matches t Type 'string' is not assignable to type 'Element'. Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(36,12): error TS2763: No overload matches this call. Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. @@ -90,48 +90,48 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches t // Error const c0 = ; // extra property; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. -!!! error TS2755: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. -!!! error TS2755: Property 'extraProp' does not exist on type 'IntrinsicAttributes'. -!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -!!! error TS2755: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -!!! error TS2755: Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2763: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2763: Property 'extraProp' does not exist on type 'IntrinsicAttributes'. +!!! error TS2763: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2763: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. +!!! error TS2763: Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. const c1 = ; // missing property; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. -!!! error TS2755: Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. -!!! error TS2755: Property 'yy' does not exist on type 'IntrinsicAttributes'. -!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -!!! error TS2755: Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2763: Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2763: Property 'yy' does not exist on type 'IntrinsicAttributes'. +!!! error TS2763: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2763: Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. const c2 = ; // type incompatible; ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. -!!! error TS2755: Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'. -!!! error TS2755: Property 'yy1' does not exist on type 'IntrinsicAttributes'. -!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2763: Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2763: Property 'yy1' does not exist on type 'IntrinsicAttributes'. +!!! error TS2763: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'string'. const c3 = ; // This is OK becuase all attribute are spread const c4 = ; // extra property; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. -!!! error TS2755: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'. -!!! error TS2755: Property 'y1' does not exist on type 'IntrinsicAttributes'. -!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -!!! error TS2755: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -!!! error TS2755: Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2763: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2763: Property 'y1' does not exist on type 'IntrinsicAttributes'. +!!! error TS2763: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2763: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. +!!! error TS2763: Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. const c5 = ; // type incompatible; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error. -!!! error TS2755: Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'. -!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -!!! error TS2755: Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. -!!! error TS2755: Types of property 'yy' are incompatible. -!!! error TS2755: Type 'boolean' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2763: Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'. +!!! error TS2763: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. +!!! error TS2763: Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. +!!! error TS2763: Types of property 'yy' are incompatible. +!!! error TS2763: Type 'boolean' is not assignable to type 'number'. const c6 = ; // Should error as there is extra attribute that doesn't match any. Current it is not const c7 = ; // Should error as there is extra attribute that doesn't match any. Current it is not @@ -141,19 +141,19 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches t // Error const d1 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. -!!! error TS2755: Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. +!!! error TS2763: Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. const d2 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. -!!! error TS2755: Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. -!!! error TS2755: Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. -!!! error TS2755: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. +!!! error TS2763: Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. +!!! error TS2763: Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. +!!! error TS2763: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'number'. declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element; declare function TestingOptional(a: {y1?: string, y2?: number, children: JSX.Element}): JSX.Element; @@ -162,42 +162,42 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches t // Error const e1 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'string'. -!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'string'. +!!! error TS2763: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'boolean'. const e2 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. -!!! error TS2755: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! error TS2755: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. -!!! error TS2755: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. -!!! error TS2755: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. -!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2763: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2763: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2763: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2763: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. +!!! error TS2763: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. +!!! error TS2763: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'boolean'. const e3 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. -!!! error TS2755: Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! error TS2755: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'Element'. -!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2763: Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2763: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2763: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'Element'. +!!! error TS2763: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'boolean'. const e4 = Hi ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. -!!! error TS2755: Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! error TS2755: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. -!!! error TS2755: 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. -!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. -!!! error TS2755: Type 'string' is not assignable to type 'boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2763: Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2763: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2763: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2763: 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. +!!! error TS2763: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. +!!! error TS2763: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt index 680f2903b77..214418e3375 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(48,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(48,12): error TS2763: No overload matches this call. Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. @@ -8,21 +8,21 @@ tests/cases/conformance/jsx/file.tsx(48,12): error TS2755: No overload matches t Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. -tests/cases/conformance/jsx/file.tsx(54,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(54,12): error TS2763: No overload matches this call. Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Type 'number' is not assignable to type 'string'. Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. Type 'number' is not assignable to type 'string'. Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(55,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(55,12): error TS2763: No overload matches this call. Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Type 'true' is not assignable to type 'string'. Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. Type 'true' is not assignable to type 'string'. Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type 'true' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(56,12): error TS2763: No overload matches this call. Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'. Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. @@ -81,16 +81,16 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No overload matches t // Error const b0 = {}}>GO; // extra property; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2755: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. -!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2755: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -!!! error TS2755: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. -!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. -!!! error TS2755: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. -!!! error TS2755: Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2763: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2763: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2763: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2763: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! error TS2763: Type '{ children: string; to: string; onClick: (e: MouseEvent) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. +!!! error TS2763: Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. const b1 = {}} {...obj0}>Hello world; // extra property; const b2 = ; // extra property const b3 = {}}} />; // extra property @@ -98,28 +98,28 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No overload matches t const b5 = ; // Spread retain method declaration (see GitHub #13365), so now there is an extra attributes const b6 = ; // incorrect type for optional attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. -!!! error TS2755: Type 'number' is not assignable to type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! error TS2763: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! error TS2763: Type 'number' is not assignable to type 'string'. const b7 = ; // incorrect type for optional attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'string'. -!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'string'. -!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'string'. +!!! error TS2763: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'string'. +!!! error TS2763: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'string'. const b8 = ; // incorrect type for specified hyphanated name ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. -!!! error TS2755: Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'. -!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. -!!! error TS2755: Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'. -!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. -!!! error TS2755: Type 'true' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2763: Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'. +!!! error TS2763: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2763: Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'. +!!! error TS2763: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! error TS2763: Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt index ea279fdedfb..fffd57b6272 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(9,14): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(9,14): error TS2763: No overload matches this call. Overload 1 of 3, '(): Element', gave the following error. Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. Property 'a' does not exist on type 'IntrinsicAttributes'. @@ -6,7 +6,7 @@ tests/cases/conformance/jsx/file.tsx(9,14): error TS2755: No overload matches th Type 'number' is not assignable to type 'string'. Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. -tests/cases/conformance/jsx/file.tsx(10,14): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/file.tsx(10,14): error TS2763: No overload matches this call. Overload 1 of 3, '(): Element', gave the following error. Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'. Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. @@ -28,23 +28,23 @@ tests/cases/conformance/jsx/file.tsx(10,14): error TS2755: No overload matches t function Baz(arg1: T, arg2: U) { let a0 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(): Element', gave the following error. -!!! error TS2755: Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. -!!! error TS2755: Property 'a' does not exist on type 'IntrinsicAttributes'. -!!! error TS2755: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! error TS2755: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. -!!! error TS2755: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(): Element', gave the following error. +!!! error TS2763: Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2763: Property 'a' does not exist on type 'IntrinsicAttributes'. +!!! error TS2763: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! error TS2763: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. +!!! error TS2763: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. let a2 = // missing a ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 3, '(): Element', gave the following error. -!!! error TS2755: Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'. -!!! error TS2755: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. -!!! error TS2755: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }'. -!!! error TS2755: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: string; "ignore-prop": boolean; }'. -!!! error TS2755: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. -!!! error TS2755: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. -!!! error TS2755: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 3, '(): Element', gave the following error. +!!! error TS2763: Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'. +!!! error TS2763: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. +!!! error TS2763: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }'. +!!! error TS2763: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: string; "ignore-prop": boolean; }'. +!!! error TS2763: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. +!!! error TS2763: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. +!!! error TS2763: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. } \ No newline at end of file diff --git a/tests/baselines/reference/unionTypeCallSignatures.errors.txt b/tests/baselines/reference/unionTypeCallSignatures.errors.txt index d842c9b235f..952196e6e02 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeCallSignatures.errors.txt @@ -1,10 +1,10 @@ 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,1): error TS2755: No overload matches this call. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(10,1): error TS2763: No overload matches this call. Overload 1 of 2, '(a: number): number | Date', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 2, '(a: string): string | boolean', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,1): error TS2755: No overload matches this call. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,1): error TS2763: No overload matches this call. Overload 1 of 2, '(a: number): number | Date', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 2, '(a: string): string | boolean', gave the following error. @@ -49,22 +49,22 @@ 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 TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! error TS2763: 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 TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'string'. unionOfDifferentReturnType1(); // error missing parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. diff --git a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt index 5913799605b..cbd108cac27 100644 --- a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt @@ -1,10 +1,10 @@ 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,1): error TS2755: No overload matches this call. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(10,1): error TS2763: No overload matches this call. Overload 1 of 2, '(a: number): number | Date', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 2, '(a: string): string | boolean', gave the following error. Argument of type 'true' is not assignable to parameter of type 'string'. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(15,1): error TS2755: No overload matches this call. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(15,1): error TS2763: No overload matches this call. Overload 1 of 2, '(a: number): number | Date', gave the following error. Argument of type 'true' is not assignable to parameter of type 'number'. Overload 2 of 2, '(a: string): string | boolean', gave the following error. @@ -48,22 +48,22 @@ 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 TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! error TS2763: 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 TS2755: No overload matches this call. -!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'. -!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error. -!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2763: Argument of type 'true' is not assignable to parameter of type 'number'. +!!! error TS2763: Overload 2 of 2, '(a: string): string | boolean', gave the following error. +!!! error TS2763: 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. From 19061420af15698672505e11a889315ca1c12532 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Mon, 1 Jul 2019 10:22:11 -0700 Subject: [PATCH 20/26] Update baselines --- .../reference/api/tsserverlibrary.d.ts | 4 +- tests/baselines/reference/api/typescript.d.ts | 4 +- .../checkJsxChildrenCanBeTupleType.errors.txt | 34 +- .../reference/promisePermutations.errors.txt | 392 +++++++++--------- .../reference/promisePermutations2.errors.txt | 144 +++---- .../reference/promisePermutations3.errors.txt | 248 +++++------ ...actDefaultPropsInferenceSuccess.errors.txt | 69 +-- .../reference/strictBindCallApply1.errors.txt | 100 +++-- .../tsxNotUsingApparentTypeOfSFC.errors.txt | 16 +- .../reference/underscoreTest1.errors.txt | 25 +- 10 files changed, 552 insertions(+), 484 deletions(-) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index e9d797bfa0d..54a31fb07a8 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2453,7 +2453,7 @@ declare namespace ts { messageText: string; category: DiagnosticCategory; code: number; - next?: DiagnosticMessageChain; + next?: DiagnosticMessageChain[]; } interface Diagnostic extends DiagnosticRelatedInformation { /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */ @@ -4272,7 +4272,7 @@ declare namespace ts { function formatDiagnostics(diagnostics: ReadonlyArray, host: FormatDiagnosticsHost): string; function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string; function formatDiagnosticsWithColorAndContext(diagnostics: ReadonlyArray, host: FormatDiagnosticsHost): string; - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain | undefined, newLine: string): string; + function flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent?: number): string; function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): ReadonlyArray; /** * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions' diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index be8eea8062b..89c0831d981 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2453,7 +2453,7 @@ declare namespace ts { messageText: string; category: DiagnosticCategory; code: number; - next?: DiagnosticMessageChain; + next?: DiagnosticMessageChain[]; } interface Diagnostic extends DiagnosticRelatedInformation { /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */ @@ -4272,7 +4272,7 @@ declare namespace ts { function formatDiagnostics(diagnostics: ReadonlyArray, host: FormatDiagnosticsHost): string; function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string; function formatDiagnosticsWithColorAndContext(diagnostics: ReadonlyArray, host: FormatDiagnosticsHost): string; - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain | undefined, newLine: string): string; + function flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent?: number): string; function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): ReadonlyArray; /** * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions' diff --git a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt index 5e38aa9c574..d66298c0368 100644 --- a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt @@ -1,4 +1,14 @@ -tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2755: No overload matches this call. +tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2763: No overload matches this call. + Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. + Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. + 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'. + Overload 2 of 2, '(props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error. + Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. + Types of property 'children' are incompatible. + Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. ==== tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx (1 errors) ==== @@ -20,17 +30,17 @@ tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2 const testErr = ~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx:17:18: Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. - Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. - 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 TS2760 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'. - Types of property 'children' are incompatible. - Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. +!!! error TS2763: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. +!!! error TS2763: Types of property 'children' are incompatible. +!!! error TS2763: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. +!!! error TS2763: Types of property 'length' are incompatible. +!!! error TS2763: Type '3' is not assignable to type '2'. +!!! error TS2763: Overload 2 of 2, '(props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error. +!!! error TS2763: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. +!!! error TS2763: Types of property 'children' are incompatible. +!!! error TS2763: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'.

diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index 2a27563fa24..cfc491027ee 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -1,125 +1,125 @@ -tests/cases/compiler/promisePermutations.ts(74,70): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(74,70): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(79,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(79,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(82,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(82,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(83,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(83,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(84,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(84,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(88,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(88,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(91,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(91,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(92,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(92,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations.ts(93,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(93,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(97,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(97,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(100,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(100,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(101,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(101,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations.ts(102,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(102,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(106,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(106,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(109,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(109,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(110,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(110,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(111,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(111,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(117,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(117,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(120,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(120,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(121,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(121,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -tests/cases/compiler/promisePermutations.ts(122,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(122,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(126,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(126,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(129,33): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(129,33): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(132,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(132,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(133,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(133,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -tests/cases/compiler/promisePermutations.ts(134,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(134,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(137,33): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(137,33): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations.ts(144,35): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(144,35): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -tests/cases/compiler/promisePermutations.ts(152,36): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(152,36): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -tests/cases/compiler/promisePermutations.ts(156,21): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(156,21): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations.ts(158,21): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(158,21): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations.ts(159,21): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(159,21): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(160,21): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'Promise' is not assignable to type 'IPromise'. @@ -206,143 +206,143 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No overload m var s3c = s3.then(testFunction3P, testFunction3, testFunction3); var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'IPromise' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'IPromise' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var r4: IPromise; var sIPromise: (x: any) => IPromise; var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -350,78 +350,78 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No overload m var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. 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 TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. 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 TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var r10 = testFunction10(x => x); @@ -430,10 +430,10 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No overload m var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok ~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. 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 @@ -443,51 +443,51 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2755: No overload m var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. -!!! error TS2755: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. +!!! error TS2763: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. !!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'IPromise'. -!!! error TS2755: Types of property 'then' are incompatible. -!!! error TS2755: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. -!!! error 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'. -!!! related TS2759 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'IPromise'. +!!! error TS2763: Types of property 'then' are incompatible. +!!! error TS2763: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. +!!! error TS2763: Types of parameters 'onfulfilled' and 'success' are incompatible. +!!! error TS2763: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index 7c852d4e370..5ef78ed5769 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/promisePermutations2.ts(73,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations2.ts(78,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(78,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. @@ -15,46 +15,46 @@ 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' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations2.ts(87,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(87,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(90,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. tests/cases/compiler/promisePermutations2.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(96,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(96,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(99,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(100,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. tests/cases/compiler/promisePermutations2.ts(101,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(105,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(105,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(108,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(108,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(109,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(109,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(110,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(110,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(116,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(116,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(119,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(120,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations2.ts(121,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(125,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(125,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(128,33): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(128,33): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. @@ -64,12 +64,12 @@ tests/cases/compiler/promisePermutations2.ts(132,19): error TS2345: Argument of tests/cases/compiler/promisePermutations2.ts(133,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(136,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations2.ts(143,35): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(143,35): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. tests/cases/compiler/promisePermutations2.ts(151,36): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -tests/cases/compiler/promisePermutations2.ts(155,21): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(155,21): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. @@ -172,12 +172,12 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error @@ -200,10 +200,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error @@ -220,10 +220,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error @@ -240,36 +240,36 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -277,10 +277,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error @@ -297,20 +297,20 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. 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 TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error @@ -336,10 +336,10 @@ 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 TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. 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 @@ -357,12 +357,12 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! related TS2759 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 4e00aba27b4..89a154c9c7f 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/promisePermutations3.ts(68,69): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(73,70): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(73,70): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. @@ -9,39 +9,39 @@ tests/cases/compiler/promisePermutations3.ts(73,70): error TS2755: No overload m tests/cases/compiler/promisePermutations3.ts(78,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(81,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(81,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(82,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(82,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(83,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(83,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type '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' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(90,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(90,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(91,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(91,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations3.ts(92,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(92,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations3.ts(96,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(99,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(99,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(100,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(100,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations3.ts(101,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(101,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations3.ts(105,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. @@ -55,50 +55,50 @@ 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 '(a: T) => T'. tests/cases/compiler/promisePermutations3.ts(116,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(119,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(119,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(120,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(120,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -tests/cases/compiler/promisePermutations3.ts(121,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(121,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations3.ts(125,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations3.ts(128,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(131,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(131,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(132,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(132,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -tests/cases/compiler/promisePermutations3.ts(133,19): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(133,19): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(136,33): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(136,33): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. tests/cases/compiler/promisePermutations3.ts(143,35): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(151,36): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(151,36): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. tests/cases/compiler/promisePermutations3.ts(155,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations3.ts(157,21): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(157,21): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations3.ts(158,21): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(158,21): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations3.ts(159,21): error TS2755: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(159,21): error TS2763: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'Promise' is not assignable to type 'IPromise'. @@ -190,12 +190,12 @@ 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 TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'IPromise' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'IPromise' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var r4: IPromise; var sIPromise: (x: any) => IPromise; @@ -209,28 +209,28 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2755: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2755: Type 'string' is not assignable to type 'number'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; @@ -241,22 +241,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; @@ -267,22 +267,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; @@ -318,22 +318,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; @@ -351,31 +351,31 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. 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 TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var r10 = testFunction10(x => x); @@ -394,12 +394,12 @@ 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 TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. -!!! error TS2755: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. +!!! error TS2763: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. !!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; @@ -411,31 +411,31 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2755: Type 'IPromise' is not assignable to type 'IPromise'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2755: Type 'number' is not assignable to type 'string'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! error TS2755: The last overload gave the following error. -!!! error TS2755: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2755: Type 'Promise' is not assignable to type 'IPromise'. -!!! error TS2755: Types of property 'then' are incompatible. -!!! error TS2755: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. -!!! 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'. -!!! related TS2759 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2763: No overload matches this call. +!!! error TS2763: The last overload gave the following error. +!!! error TS2763: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2763: Type 'Promise' is not assignable to type 'IPromise'. +!!! error TS2763: Types of property 'then' are incompatible. +!!! error TS2763: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. +!!! error TS2763: Types of parameters 'onfulfilled' and 'success' are incompatible. +!!! error TS2763: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt index 9d8f05d7b35..5168e5aa361 100644 --- a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt +++ b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt @@ -1,6 +1,25 @@ -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,21): error TS2755: No overload matches this call. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,22): error TS2755: No overload matches this call. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: No overload matches this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,21): error TS2763: No overload matches this call. + Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. + Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,22): error TS2763: No overload matches this call. + Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. + Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2763: No overload matches this call. + Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. + Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. ==== tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx (3 errors) ==== @@ -32,14 +51,14 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: // Error: Void not assignable to boolean const Test2 = () => console.log(value)} />; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:27:36: Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. - Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. - Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. - Type 'void' is not assignable to type 'boolean'. -!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:27:36: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. - Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. - Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2763: Type 'void' is not assignable to type 'boolean'. +!!! error TS2763: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. class FieldFeedbackBeta

extends React.Component

{ static defaultProps: BaseProps = { @@ -57,14 +76,14 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: // Error: Void not assignable to boolean const Test2a = () => console.log(value)} error>Hah; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:43:41: Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. - Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. - Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. - Type 'void' is not assignable to type 'boolean'. -!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:43:41: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. - Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. - Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2763: Type 'void' is not assignable to type 'boolean'. +!!! error TS2763: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. interface MyPropsProps extends Props { when: (value: string) => boolean; @@ -87,12 +106,12 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2755: // Error: Void not assignable to boolean const Test4 = () => console.log(value)} />; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:64:37: Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. - Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. - Type 'void' is not assignable to type 'boolean'. -!!! related TS2760 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:64:37: Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. - Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2763: Type 'void' is not assignable to type 'boolean'. +!!! error TS2763: Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. +!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. // OK const Test5 = () => ; diff --git a/tests/baselines/reference/strictBindCallApply1.errors.txt b/tests/baselines/reference/strictBindCallApply1.errors.txt index 3a596bfdb31..e14635b1075 100644 --- a/tests/baselines/reference/strictBindCallApply1.errors.txt +++ b/tests/baselines/reference/strictBindCallApply1.errors.txt @@ -1,4 +1,11 @@ -tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2755: No overload matches this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2763: No overload matches this call. + Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. + Argument of type '20' is not assignable to parameter of type 'string'. + Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. + The 'this' context of type '(a: number, b: string) => string' is not assignable to method's 'this' of type '(this: undefined, ...args: (10 | 20)[]) => string'. + Types of parameters 'b' and 'args' are incompatible. + Type '10 | 20' is not assignable to type 'string'. + Type '10' is not assignable to type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(17,15): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(18,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(19,44): error TS2554: Expected 3 arguments, but got 4. @@ -8,8 +15,22 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(23,37): error TS2322: tests/cases/conformance/functions/strictBindCallApply1.ts(24,32): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. -tests/cases/conformance/functions/strictBindCallApply1.ts(41,11): error TS2755: No overload matches this call. -tests/cases/conformance/functions/strictBindCallApply1.ts(42,11): error TS2755: No overload matches this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(41,11): error TS2763: No overload matches this call. + Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. + Argument of type '20' is not assignable to parameter of type 'string'. + Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. + The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (10 | 20)[]) => string'. + Types of parameters 'b' and 'args' are incompatible. + Type '10 | 20' is not assignable to type 'string'. + Type '10' is not assignable to type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(42,11): error TS2763: No overload matches this call. + Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type 'C'. + Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. + The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (string | number)[]) => string'. + Types of parameters 'a' and 'args' are incompatible. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/functions/strictBindCallApply1.ts(48,17): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(49,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(50,38): error TS2554: Expected 3 arguments, but got 4. @@ -18,7 +39,14 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(54,26): error TS2345: tests/cases/conformance/functions/strictBindCallApply1.ts(55,31): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(56,26): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. tests/cases/conformance/functions/strictBindCallApply1.ts(57,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. -tests/cases/conformance/functions/strictBindCallApply1.ts(62,11): error TS2755: No overload matches this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(62,11): error TS2763: No overload matches this call. + Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. + Argument of type '20' is not assignable to parameter of type 'string'. + Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. + The 'this' context of type 'typeof C' is not assignable to method's 'this' of type 'new (...args: (10 | 20)[]) => C'. + Types of parameters 'b' and 'args' are incompatible. + Type '10 | 20' is not assignable to type 'string'. + Type '10' is not assignable to type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(65,3): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(66,15): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(67,24): error TS2554: Expected 3 arguments, but got 4. @@ -40,14 +68,14 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f02 = foo.bind(undefined, 10, "hello"); let f03 = foo.bind(undefined, 10, 20); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:11:35: Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. - Argument of type '20' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:11:11: Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. - The 'this' context of type '(a: number, b: string) => string' is not assignable to method's 'this' of type '(this: undefined, ...args: (10 | 20)[]) => string'. - Types of parameters 'b' and 'args' are incompatible. - Type '10 | 20' is not assignable to type 'string'. - Type '10' is not assignable to type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. +!!! error TS2763: Argument of type '20' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. +!!! error TS2763: The 'this' context of type '(a: number, b: string) => string' is not assignable to method's 'this' of type '(this: undefined, ...args: (10 | 20)[]) => string'. +!!! error TS2763: Types of parameters 'b' and 'args' are incompatible. +!!! error TS2763: Type '10 | 20' is not assignable to type 'string'. +!!! error TS2763: Type '10' is not assignable to type 'string'. let f04 = overloaded.bind(undefined); // typeof overloaded let f05 = generic.bind(undefined); // typeof generic @@ -94,24 +122,24 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f12 = c.foo.bind(c, 10, "hello"); let f13 = c.foo.bind(c, 10, 20); // Error ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:41:29: Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. - Argument of type '20' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:41:11: Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. - The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (10 | 20)[]) => string'. - Types of parameters 'b' and 'args' are incompatible. - Type '10 | 20' is not assignable to type 'string'. - Type '10' is not assignable to type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. +!!! error TS2763: Argument of type '20' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. +!!! error TS2763: The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (10 | 20)[]) => string'. +!!! error TS2763: Types of parameters 'b' and 'args' are incompatible. +!!! error TS2763: Type '10 | 20' is not assignable to type 'string'. +!!! error TS2763: Type '10' is not assignable to type 'string'. let f14 = c.foo.bind(undefined); // Error ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:42:22: Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. - Argument of type 'undefined' is not assignable to parameter of type 'C'. -!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:42:11: Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. - The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (string | number)[]) => string'. - Types of parameters 'a' and 'args' are incompatible. - Type 'string | number' is not assignable to type 'number'. - Type 'string' is not assignable to type 'number'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. +!!! error TS2763: Argument of type 'undefined' is not assignable to parameter of type 'C'. +!!! error TS2763: Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. +!!! error TS2763: The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (string | number)[]) => string'. +!!! error TS2763: Types of parameters 'a' and 'args' are incompatible. +!!! error TS2763: Type 'string | number' is not assignable to type 'number'. +!!! error TS2763: Type 'string' is not assignable to type 'number'. let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded let f16 = c.generic.bind(c); // typeof C.prototype.generic @@ -149,14 +177,14 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f22 = C.bind(undefined, 10, "hello"); let f23 = C.bind(undefined, 10, 20); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:62:33: Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. - Argument of type '20' is not assignable to parameter of type 'string'. -!!! related TS2760 tests/cases/conformance/functions/strictBindCallApply1.ts:62:11: Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. - The 'this' context of type 'typeof C' is not assignable to method's 'this' of type 'new (...args: (10 | 20)[]) => C'. - Types of parameters 'b' and 'args' are incompatible. - Type '10 | 20' is not assignable to type 'string'. - Type '10' is not assignable to type 'string'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. +!!! error TS2763: Argument of type '20' is not assignable to parameter of type 'string'. +!!! error TS2763: Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. +!!! error TS2763: The 'this' context of type 'typeof C' is not assignable to method's 'this' of type 'new (...args: (10 | 20)[]) => C'. +!!! error TS2763: Types of parameters 'b' and 'args' are incompatible. +!!! error TS2763: Type '10 | 20' is not assignable to type 'string'. +!!! error TS2763: Type '10' is not assignable to type 'string'. C.call(c, 10, "hello"); C.call(c, 10); // Error diff --git a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt index e85f25c0fdb..80230ec72b1 100644 --- a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt +++ b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt @@ -1,6 +1,10 @@ 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,13): error TS2755: No overload matches this call. +tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2763: No overload matches this call. + Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. + Type '{}' is not assignable to type 'Readonly

'. + Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. + Type '{}' is not assignable to type 'Readonly

'. ==== tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx (2 errors) ==== @@ -23,11 +27,11 @@ tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2755: No o !!! error TS2322: '{}' is assignable to the constraint of type 'P', but 'P' could be instantiated with a different subtype of constraint '{}'. let y = ; // should error ~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx:15:14: Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. - Type '{}' is not assignable to type 'Readonly

'. -!!! related TS2760 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

'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. +!!! error TS2763: Type '{}' is not assignable to type 'Readonly

'. +!!! error TS2763: Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. +!!! error TS2763: Type '{}' is not assignable to type 'Readonly

'. let z = // should work let q = // should work diff --git a/tests/baselines/reference/underscoreTest1.errors.txt b/tests/baselines/reference/underscoreTest1.errors.txt index 256b6e873aa..e51de99e216 100644 --- a/tests/baselines/reference/underscoreTest1.errors.txt +++ b/tests/baselines/reference/underscoreTest1.errors.txt @@ -1,4 +1,11 @@ -tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2755: No overload matches this call. +tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2763: No overload matches this call. + Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. + Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. + Type 'string | number | boolean' is not assignable to type 'boolean'. + Type 'string' is not assignable to type 'boolean'. + Overload 2 of 2, '(list: Dictionary, iterator?: Iterator_, context?: any): boolean', gave the following error. + Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. + Index signature is missing in type '(string | number | boolean)[]'. ==== tests/cases/compiler/underscoreTest1_underscoreTests.ts (1 errors) ==== @@ -29,14 +36,14 @@ tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2755: No _.all([true, 1, null, 'yes'], _.identity); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2755: No overload matches this call. -!!! related TS2760 tests/cases/compiler/underscoreTest1_underscoreTests.ts:26:31: Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. - Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. - Type 'string | number | boolean' is not assignable to type 'boolean'. - Type 'string' is not assignable to type 'boolean'. -!!! related TS2760 tests/cases/compiler/underscoreTest1_underscoreTests.ts:26:7: Overload 2 of 2, '(list: Dictionary, iterator?: Iterator_, context?: any): boolean', gave the following error. - Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. - Index signature is missing in type '(string | number | boolean)[]'. +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. +!!! error TS2763: Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. +!!! error TS2763: Type 'string | number | boolean' is not assignable to type 'boolean'. +!!! error TS2763: Type 'string' is not assignable to type 'boolean'. +!!! error TS2763: Overload 2 of 2, '(list: Dictionary, iterator?: Iterator_, context?: any): boolean', gave the following error. +!!! error TS2763: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. +!!! error TS2763: Index signature is missing in type '(string | number | boolean)[]'. _.any([null, 0, 'yes', false]); From f139455229d0789cd79a433cd5fd07bcc30a1f52 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Mon, 1 Jul 2019 15:06:16 -0700 Subject: [PATCH 21/26] Address PR comments --- src/compiler/checker.ts | 8 ++-- src/compiler/utilities.ts | 43 ++++--------------- .../reference/functionOverloads40.errors.txt | 2 + .../reference/functionOverloads41.errors.txt | 2 + .../overloadResolutionTest1.errors.txt | 8 +++- ...nWithConstraintCheckingDeferred.errors.txt | 2 + .../overloadsWithProvisionalErrors.errors.txt | 3 ++ .../reference/promiseTypeInference.errors.txt | 3 ++ ...elessFunctionComponentOverload4.errors.txt | 13 ++++++ ...elessFunctionComponentOverload5.errors.txt | 11 ++++- ...ionComponentsWithTypeArguments4.errors.txt | 4 ++ 11 files changed, 58 insertions(+), 41 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index eeb72f42df8..b0fb305d317 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21693,10 +21693,10 @@ namespace ts { i++; } - const related = map( - max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics), - d => typeof d.messageText === "string" ? (d as DiagnosticMessageChain) : d.messageText); - diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(related, Diagnostics.No_overload_matches_this_call))); + const diags = max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics); + const chain = map(diags, d => typeof d.messageText === "string" ? (d as DiagnosticMessageChain) : d.messageText); + const related = flatMap(diags, d => (d as Diagnostic).relatedInformation) as DiagnosticRelatedInformation[]; + diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(chain, Diagnostics.No_overload_matches_this_call), related)); } } else if (candidateForArgumentArityError) { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 56f11078fc0..33c75a05fce 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -7170,36 +7170,6 @@ namespace ts { return d1.relatedInformation ? Comparison.LessThan : Comparison.GreaterThan; } - // function compareMessageText(t1: string | DiagnosticMessageChain[], t2: string | DiagnosticMessageChain[]): Comparison { - // if (typeof t1 === 'string' && typeof t2 === 'string') { - // return compareStringsCaseSensitive(t1, t2) - // } - // else if (Array.isArray(t1) && Array.isArray(t2)) { - // if (t1.length < t2.length) { - // return Comparison.LessThan; - // } - // else if (t1.length > t2.length) { - // return Comparison.GreaterThan; - // } - // else { - // for (let i = 0; i < t1.length; i++) { - // t1[i].messageText - // const res = cmps(t1[i], t2[i]); - // if (res) { - // return res; - // } - // } - // return Comparison.EqualTo; - // } - // } - // else if (typeof t1 === 'string') { - // return Comparison.LessThan; - // } - // else { - // return Comparison.GreaterThan; - // } - // } - function compareMessageText(t1: string | DiagnosticMessageChain, t2: string | DiagnosticMessageChain): Comparison { if (typeof t1 === "string" && typeof t2 === "string") { return compareStringsCaseSensitive(t1, t2); @@ -7223,16 +7193,19 @@ namespace ts { if (!t2.next) { return Comparison.GreaterThan; } - res = compareValues(t1.next.length, t2.next.length); - if (res) { - return res; - } - for (let i = 0; i < t1.next.length; i++) { + const len = Math.min(t1.next.length, t2.next.length); + for (let i = 0; i < len; i++) { res = compareMessageText(t1.next[i], t2.next[i]); if (res) { return res; } } + if (t1.next.length < t2.next.length) { + return Comparison.LessThan; + } + else if (t1.next.length > t2.next.length) { + return Comparison.GreaterThan; + } return Comparison.EqualTo; } diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt index e3e7d3a25e7..ecfda613f8b 100644 --- a/tests/baselines/reference/functionOverloads40.errors.txt +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -16,4 +16,6 @@ tests/cases/compiler/functionOverloads40.ts(4,9): error TS2763: No overload matc !!! error TS2763: Type 'string' is not assignable to type 'number'. !!! error TS2763: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. !!! error TS2763: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/compiler/functionOverloads40.ts:1:19: The expected type comes from property 'a' which is declared here on type '{ a: number; }' +!!! related TS6500 tests/cases/compiler/functionOverloads40.ts:2:19: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }' \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads41.errors.txt b/tests/baselines/reference/functionOverloads41.errors.txt index f475095fdb9..1ae82358453 100644 --- a/tests/baselines/reference/functionOverloads41.errors.txt +++ b/tests/baselines/reference/functionOverloads41.errors.txt @@ -16,4 +16,6 @@ tests/cases/compiler/functionOverloads41.ts(4,9): error TS2763: No overload matc !!! error TS2763: Property 'a' is missing in type '{}' but required in type '{ a: number; }'. !!! error TS2763: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. !!! error TS2763: Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. +!!! related TS2728 tests/cases/compiler/functionOverloads41.ts:1:19: 'a' is declared here. +!!! related TS2728 tests/cases/compiler/functionOverloads41.ts:2:19: 'a' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt index ad3b6779be5..a3e0a1c26a9 100644 --- a/tests/baselines/reference/overloadResolutionTest1.errors.txt +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -29,6 +29,8 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2763: No overload !!! error TS2763: Type 'string' is not assignable to type 'number'. !!! error TS2763: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. !!! error TS2763: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:1:19: The expected type comes from property 'a' which is declared here on type '{ a: number; }' +!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:2:19: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }' var x1111 = foo([{a:null}]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string @@ -46,6 +48,8 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2763: No overload !!! error TS2763: Type 'string' is not assignable to type 'number'. !!! error TS2763: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. !!! error TS2763: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:12:20: The expected type comes from property 'a' which is declared here on type '{ a: number; }' +!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:13:20: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }' function foo4(bar:{a:number;}):number; @@ -57,4 +61,6 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2763: No overload !!! error TS2763: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. !!! error TS2763: Type 'true' is not assignable to type 'number'. !!! error TS2763: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. -!!! error TS2763: Type 'true' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2763: Type 'true' is not assignable to type 'string'. +!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:21:20: The expected type comes from property 'a' which is declared here on type '{ a: number; }' +!!! related TS6500 tests/cases/compiler/overloadResolutionTest1.ts:22:20: The expected type comes from property 'a' which is declared here on type '{ a: string; }' \ No newline at end of file diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt index e6f568f0d29..8e9d1136547 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -68,4 +68,6 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): !!! error TS2763: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. !!! error TS2763: Types of parameters 'x' and 'x' are incompatible. !!! error TS2763: 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. +!!! related TS2728 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt index 0c9a607b13c..a806a1ddf82 100644 --- a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt @@ -25,6 +25,7 @@ tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cann !!! error TS2763: Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. !!! error TS2763: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. !!! error TS2763: Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b +!!! related TS6502 tests/cases/compiler/overloadsWithProvisionalErrors.ts:3:14: The expected type comes from the return type of this signature. func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) ~~~~ !!! error TS2304: Cannot find name 'blah'. @@ -35,5 +36,7 @@ tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cann !!! error TS2763: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. !!! error TS2763: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. !!! error TS2763: Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. +!!! related TS2728 tests/cases/compiler/overloadsWithProvisionalErrors.ts:3:42: 'b' is declared here. +!!! related TS6502 tests/cases/compiler/overloadsWithProvisionalErrors.ts:3:14: The expected type comes from the return type of this signature. ~~~~ !!! error TS2304: Cannot find name 'blah'. \ No newline at end of file diff --git a/tests/baselines/reference/promiseTypeInference.errors.txt b/tests/baselines/reference/promiseTypeInference.errors.txt index 9207b909984..d08c33a3957 100644 --- a/tests/baselines/reference/promiseTypeInference.errors.txt +++ b/tests/baselines/reference/promiseTypeInference.errors.txt @@ -34,4 +34,7 @@ tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2763: No overload m !!! error TS2763: Types of parameters 'success' and 'onfulfilled' are incompatible. !!! error TS2763: Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. !!! error TS2763: Type 'TResult1' is not assignable to type 'IPromise'. +!!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. +!!! related TS6502 tests/cases/compiler/promiseTypeInference.ts:2:23: The expected type comes from the return type of this signature. +!!! related TS6502 /.ts/lib.es5.d.ts:1406:57: The expected type comes from the return type of this signature. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt index c9f17da6254..9fc44f4dc8c 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt @@ -105,6 +105,7 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2763: No overload matches t !!! error TS2763: Property 'yy' does not exist on type 'IntrinsicAttributes'. !!! error TS2763: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. !!! error TS2763: Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. +!!! related TS2728 tests/cases/conformance/jsx/file.tsx:3:43: 'yy1' is declared here. const c2 = ; // type incompatible; ~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2763: No overload matches this call. @@ -113,6 +114,7 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2763: No overload matches t !!! error TS2763: Property 'yy1' does not exist on type 'IntrinsicAttributes'. !!! error TS2763: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. !!! error TS2763: Type 'true' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:43: The expected type comes from property 'yy1' which is declared here on type 'IntrinsicAttributes & { yy: number; yy1: string; }' const c3 = ; // This is OK becuase all attribute are spread const c4 = ; // extra property; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -146,6 +148,8 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2763: No overload matches t !!! error TS2763: Type 'true' is not assignable to type 'string'. !!! error TS2763: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. !!! error TS2763: Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:21:38: The expected type comes from property 'extra-data' which is declared here on type 'IntrinsicAttributes & { "extra-data": string; }' +!!! related TS2728 tests/cases/conformance/jsx/file.tsx:22:38: 'yy' is declared here. const d2 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2763: No overload matches this call. @@ -154,6 +158,7 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2763: No overload matches t !!! error TS2763: Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. !!! error TS2763: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. !!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:22:50: The expected type comes from property 'direction' which is declared here on type 'IntrinsicAttributes & { yy: string; direction?: number; }' declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element; declare function TestingOptional(a: {y1?: string, y2?: number, children: JSX.Element}): JSX.Element; @@ -169,6 +174,9 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2763: No overload matches t !!! error TS2763: Type 'true' is not assignable to type 'string'. !!! error TS2763: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. !!! error TS2763: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:28:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; }' +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:29:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }' +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:64: The expected type comes from property 'y3' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' const e2 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2763: No overload matches this call. @@ -180,6 +188,7 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2763: No overload matches t !!! error TS2763: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. !!! error TS2763: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. !!! error TS2763: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' const e3 = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2763: No overload matches this call. @@ -190,6 +199,8 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2763: No overload matches t !!! error TS2763: Type 'string' is not assignable to type 'Element'. !!! error TS2763: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. !!! error TS2763: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:29:64: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }' +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' const e4 = Hi ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2763: No overload matches this call. @@ -200,4 +211,6 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2763: No overload matches t !!! error TS2763: 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. !!! error TS2763: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. !!! error TS2763: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:29:64: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }' +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt index 214418e3375..df01c8fe94c 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt @@ -105,6 +105,9 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2763: No overload matches t !!! error TS2763: Type 'number' is not assignable to type 'string'. !!! error TS2763: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. !!! error TS2763: Type 'number' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & ButtonProps' +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & LinkProps' +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & HyphenProps' const b7 = ; // incorrect type for optional attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2763: No overload matches this call. @@ -114,6 +117,9 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2763: No overload matches t !!! error TS2763: Type 'true' is not assignable to type 'string'. !!! error TS2763: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. !!! error TS2763: Type 'true' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:5:5: The expected type comes from property 'className' which is declared here on type 'IntrinsicAttributes & ButtonProps' +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:5:5: The expected type comes from property 'className' which is declared here on type 'IntrinsicAttributes & LinkProps' +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:5:5: The expected type comes from property 'className' which is declared here on type 'IntrinsicAttributes & HyphenProps' const b8 = ; // incorrect type for specified hyphanated name ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2763: No overload matches this call. @@ -122,4 +128,7 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2763: No overload matches t !!! error TS2763: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. !!! error TS2763: Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'. !!! error TS2763: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. -!!! error TS2763: Type 'true' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2763: Type 'true' is not assignable to type 'string'. +!!! related TS2728 tests/cases/conformance/jsx/file.tsx:9:5: 'onClick' is declared here. +!!! related TS2728 tests/cases/conformance/jsx/file.tsx:13:5: 'to' is declared here. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:17:5: The expected type comes from property 'data-format' which is declared here on type 'IntrinsicAttributes & HyphenProps' \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt index fffd57b6272..5508a111e4d 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt @@ -36,6 +36,8 @@ tests/cases/conformance/jsx/file.tsx(10,14): error TS2763: No overload matches t !!! error TS2763: Type 'number' is not assignable to type 'string'. !!! error TS2763: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. !!! error TS2763: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:52: The expected type comes from property 'a' which is declared here on type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }' +!!! related TS2728 tests/cases/conformance/jsx/file.tsx:5:49: 'b' is declared here. let a2 = // missing a ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2763: No overload matches this call. @@ -47,4 +49,6 @@ tests/cases/conformance/jsx/file.tsx(10,14): error TS2763: No overload matches t !!! error TS2763: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. !!! error TS2763: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. !!! error TS2763: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. +!!! related TS2728 tests/cases/conformance/jsx/file.tsx:4:52: 'a' is declared here. +!!! related TS2728 tests/cases/conformance/jsx/file.tsx:5:55: 'a' is declared here. } \ No newline at end of file From de52797873952a58a8f2413e4eb3f095a0e0868f Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 2 Jul 2019 08:34:34 -0700 Subject: [PATCH 22/26] Update baselines --- .../reference/reactDefaultPropsInferenceSuccess.errors.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt index 5168e5aa361..b972a5bb7c5 100644 --- a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt +++ b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt @@ -59,6 +59,8 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2763: !!! error TS2763: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. !!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. !!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' +!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' class FieldFeedbackBeta

extends React.Component

{ static defaultProps: BaseProps = { @@ -84,6 +86,8 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2763: !!! error TS2763: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. !!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. !!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, "when" | "error">> & Partial>' +!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, "when" | "error">> & Partial>' interface MyPropsProps extends Props { when: (value: string) => boolean; @@ -112,6 +116,8 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2763: !!! error TS2763: Type 'void' is not assignable to type 'boolean'. !!! error TS2763: Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. !!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' +!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' // OK const Test5 = () => ; From d92e8ea4a1745e666775dcca61cf30d2ba061bd8 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 3 Jul 2019 09:49:00 -0700 Subject: [PATCH 23/26] Update baselines --- .../reference/destructuringTuple.errors.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/baselines/reference/destructuringTuple.errors.txt b/tests/baselines/reference/destructuringTuple.errors.txt index cd366409dc8..10b997f87cd 100644 --- a/tests/baselines/reference/destructuringTuple.errors.txt +++ b/tests/baselines/reference/destructuringTuple.errors.txt @@ -1,5 +1,9 @@ tests/cases/compiler/destructuringTuple.ts(11,8): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. -tests/cases/compiler/destructuringTuple.ts(11,60): error TS2345: Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. +tests/cases/compiler/destructuringTuple.ts(11,48): error TS2763: No overload matches this call. + Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. + Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. ==== tests/cases/compiler/destructuringTuple.ts (2 errors) ==== @@ -16,8 +20,12 @@ tests/cases/compiler/destructuringTuple.ts(11,60): error TS2345: Argument of typ const [oops1] = [1, 2, 3].reduce((accu, el) => accu.concat(el), []); ~~~~~ !!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. - ~~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. + ~~~~~~~~~~~~~~~ +!!! error TS2763: No overload matches this call. +!!! error TS2763: Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. +!!! error TS2763: Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. +!!! error TS2763: Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. +!!! error TS2763: Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. const [oops2] = [1, 2, 3].reduce((acc: number[], e) => acc.concat(e), []); \ No newline at end of file From 722917f04ea47bc6bb3f33287d4db8b55a22dd4e Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 3 Jul 2019 09:50:03 -0700 Subject: [PATCH 24/26] Remove TODO --- src/compiler/program.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index d96a4dc68ab..664e2d0319d 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -520,7 +520,6 @@ namespace ts { result += diag.messageText; indent++; if (diag.next) { - // TODO: Should be possible to optimise the common, non-tree case for (const kid of diag.next) { result += flattenDiagnosticMessageText(kid, newLine, indent); } From 2233ebadeaf98162c2ffdb9e07ee90776baabe85 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Mon, 8 Jul 2019 09:52:12 -0700 Subject: [PATCH 25/26] Update baselines --- .../reference/promisePermutations.errors.txt | 392 +++++++++--------- .../reference/promisePermutations2.errors.txt | 144 +++---- .../reference/promisePermutations3.errors.txt | 248 +++++------ .../reference/underscoreTest1.errors.txt | 18 +- 4 files changed, 401 insertions(+), 401 deletions(-) diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index cfc491027ee..1cb61562fe3 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -1,125 +1,125 @@ -tests/cases/compiler/promisePermutations.ts(74,70): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(74,70): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(79,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(79,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(82,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(82,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(83,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(83,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(84,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(84,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(88,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(88,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(91,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(91,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(92,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(92,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations.ts(93,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(93,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(97,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(97,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(100,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(100,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(101,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(101,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations.ts(102,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(102,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(106,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(106,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(109,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(109,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations.ts(110,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(110,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(111,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(111,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations.ts(117,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(117,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(120,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(120,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(121,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(121,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -tests/cases/compiler/promisePermutations.ts(122,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(122,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(126,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(126,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(129,33): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(129,33): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations.ts(132,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(132,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(133,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(133,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -tests/cases/compiler/promisePermutations.ts(134,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(134,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(137,33): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(137,33): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations.ts(144,35): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(144,35): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -tests/cases/compiler/promisePermutations.ts(152,36): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(152,36): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -tests/cases/compiler/promisePermutations.ts(156,21): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(156,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations.ts(158,21): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(158,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations.ts(159,21): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(159,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations.ts(160,21): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'Promise' is not assignable to type 'IPromise'. @@ -206,143 +206,143 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2763: No overload m var s3c = s3.then(testFunction3P, testFunction3, testFunction3); var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'IPromise' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'IPromise' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var r4: IPromise; var sIPromise: (x: any) => IPromise; var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2769: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -350,78 +350,78 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2763: No overload m var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. 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 TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2769: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. 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 TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2769: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var r10 = testFunction10(x => x); @@ -430,10 +430,10 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2763: No overload m var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok ~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. 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 @@ -443,51 +443,51 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2763: No overload m var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error ~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. -!!! error TS2763: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. +!!! error TS2769: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. !!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2763: Type 'number' is not assignable to type 'string'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2769: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2769: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. -!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2763: Type 'number' is not assignable to type 'string'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2763: Type 'Promise' is not assignable to type 'IPromise'. -!!! error TS2763: Types of property 'then' are incompatible. -!!! error TS2763: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. -!!! error TS2763: Types of parameters 'onfulfilled' and 'success' are incompatible. -!!! error TS2763: Types of parameters 'value' and 'value' are incompatible. -!!! error TS2763: Type 'number' is not assignable to type 'string'. -!!! related TS2765 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2769: Type 'Promise' is not assignable to type 'IPromise'. +!!! error TS2769: Types of property 'then' are incompatible. +!!! error TS2769: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. +!!! error TS2769: Types of parameters 'onfulfilled' and 'success' are incompatible. +!!! error TS2769: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index 5ef78ed5769..d601a5049bf 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/promisePermutations2.ts(73,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations2.ts(78,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(78,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. @@ -15,46 +15,46 @@ 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' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations2.ts(87,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(87,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(90,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. tests/cases/compiler/promisePermutations2.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(96,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(96,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(99,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations2.ts(100,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. tests/cases/compiler/promisePermutations2.ts(101,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(105,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(105,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(108,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(108,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(109,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(109,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(110,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(110,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'cb' and 'value' are incompatible. Type 'string' is not assignable to type '(a: T) => T'. -tests/cases/compiler/promisePermutations2.ts(116,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(116,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(119,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(120,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations2.ts(121,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(125,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(125,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(128,33): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(128,33): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. @@ -64,12 +64,12 @@ tests/cases/compiler/promisePermutations2.ts(132,19): error TS2345: Argument of tests/cases/compiler/promisePermutations2.ts(133,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(136,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations2.ts(143,35): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(143,35): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. tests/cases/compiler/promisePermutations2.ts(151,36): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -tests/cases/compiler/promisePermutations2.ts(155,21): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations2.ts(155,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. @@ -172,12 +172,12 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error @@ -200,10 +200,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error @@ -220,10 +220,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error @@ -240,36 +240,36 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2769: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type '(a: T) => T'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type '(a: T) => T'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -277,10 +277,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error @@ -297,20 +297,20 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. 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 TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2769: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error @@ -336,10 +336,10 @@ 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 TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. 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 @@ -357,12 +357,12 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2763: Type 'number' is not assignable to type 'string'. -!!! related TS2765 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2769: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 89a154c9c7f..d3574d2a4c3 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/promisePermutations3.ts(68,69): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'IPromise' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(73,70): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(73,70): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. @@ -9,39 +9,39 @@ tests/cases/compiler/promisePermutations3.ts(73,70): error TS2763: No overload m tests/cases/compiler/promisePermutations3.ts(78,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(81,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(81,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(82,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(82,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. Types of parameters 'x' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(83,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(83,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type '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' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(90,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(90,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(91,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(91,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations3.ts(92,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(92,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations3.ts(96,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(99,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(99,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(100,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(100,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -tests/cases/compiler/promisePermutations3.ts(101,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(101,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. tests/cases/compiler/promisePermutations3.ts(105,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. @@ -55,50 +55,50 @@ 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 '(a: T) => T'. tests/cases/compiler/promisePermutations3.ts(116,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(119,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(119,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(120,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(120,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -tests/cases/compiler/promisePermutations3.ts(121,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(121,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations3.ts(125,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations3.ts(128,33): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/promisePermutations3.ts(131,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(131,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(132,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(132,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -tests/cases/compiler/promisePermutations3.ts(133,19): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(133,19): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(136,33): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(136,33): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. tests/cases/compiler/promisePermutations3.ts(143,35): error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(151,36): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(151,36): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. tests/cases/compiler/promisePermutations3.ts(155,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations3.ts(157,21): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(157,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'IPromise' is not assignable to type 'IPromise'. -tests/cases/compiler/promisePermutations3.ts(158,21): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(158,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations3.ts(159,21): error TS2763: No overload matches this call. +tests/cases/compiler/promisePermutations3.ts(159,21): error TS2769: No overload matches this call. The last overload gave the following error. Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'Promise' is not assignable to type 'IPromise'. @@ -190,12 +190,12 @@ 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 TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'IPromise' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'IPromise' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var r4: IPromise; var sIPromise: (x: any) => IPromise; @@ -209,28 +209,28 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2763: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2763: Type 'string' is not assignable to type 'number'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2769: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; @@ -241,22 +241,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; @@ -267,22 +267,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; @@ -318,22 +318,22 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; @@ -351,31 +351,31 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. 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 TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. -!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => IPromise'. +!!! error TS2769: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var r10 = testFunction10(x => x); @@ -394,12 +394,12 @@ 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 TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. -!!! error TS2763: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. +!!! error TS2769: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. !!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; @@ -411,31 +411,31 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2763: Type 'IPromise' is not assignable to type 'IPromise'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2769: Type 'IPromise' is not assignable to type 'IPromise'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. -!!! error TS2763: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2763: Type 'number' is not assignable to type 'string'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. +!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: The last overload gave the following error. -!!! error TS2763: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2763: Type 'Promise' is not assignable to type 'IPromise'. -!!! error TS2763: Types of property 'then' are incompatible. -!!! error TS2763: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. -!!! error TS2763: Types of parameters 'onfulfilled' and 'success' are incompatible. -!!! error TS2763: Types of parameters 'value' and 'value' are incompatible. -!!! error TS2763: Type 'number' is not assignable to type 'string'. -!!! related TS2765 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2769: Type 'Promise' is not assignable to type 'IPromise'. +!!! error TS2769: Types of property 'then' are incompatible. +!!! error TS2769: Type '{ (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. +!!! error TS2769: Types of parameters 'onfulfilled' and 'success' are incompatible. +!!! error TS2769: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/underscoreTest1.errors.txt b/tests/baselines/reference/underscoreTest1.errors.txt index e51de99e216..7bc8e28cf08 100644 --- a/tests/baselines/reference/underscoreTest1.errors.txt +++ b/tests/baselines/reference/underscoreTest1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2763: No overload matches this call. +tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2769: No overload matches this call. Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. Type 'string | number | boolean' is not assignable to type 'boolean'. @@ -36,14 +36,14 @@ tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,1): error TS2763: No _.all([true, 1, null, 'yes'], _.identity); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. -!!! error TS2763: Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. -!!! error TS2763: Type 'string | number | boolean' is not assignable to type 'boolean'. -!!! error TS2763: Type 'string' is not assignable to type 'boolean'. -!!! error TS2763: Overload 2 of 2, '(list: Dictionary, iterator?: Iterator_, context?: any): boolean', gave the following error. -!!! error TS2763: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. -!!! error TS2763: Index signature is missing in type '(string | number | boolean)[]'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. +!!! error TS2769: Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. +!!! error TS2769: Type 'string | number | boolean' is not assignable to type 'boolean'. +!!! error TS2769: Type 'string' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 2, '(list: Dictionary, iterator?: Iterator_, context?: any): boolean', gave the following error. +!!! error TS2769: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. +!!! error TS2769: Index signature is missing in type '(string | number | boolean)[]'. _.any([null, 0, 'yes', false]); From 05a4e8f29edcae99a9ebe6f84267bd9cefd10bfe Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Mon, 8 Jul 2019 13:04:59 -0700 Subject: [PATCH 26/26] Update more baselines (?) --- .../checkJsxChildrenCanBeTupleType.errors.txt | 24 +++---- ...actDefaultPropsInferenceSuccess.errors.txt | 50 ++++++------- .../reference/strictBindCallApply1.errors.txt | 72 +++++++++---------- .../tsxNotUsingApparentTypeOfSFC.errors.txt | 12 ++-- 4 files changed, 79 insertions(+), 79 deletions(-) diff --git a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt index d66298c0368..b8ad32a5408 100644 --- a/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenCanBeTupleType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2763: No overload matches this call. +tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. Types of property 'children' are incompatible. @@ -30,17 +30,17 @@ tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,17): error TS2 const testErr = ~~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. -!!! error TS2763: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. -!!! error TS2763: Types of property 'children' are incompatible. -!!! error TS2763: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. -!!! error TS2763: Types of property 'length' are incompatible. -!!! error TS2763: Type '3' is not assignable to type '2'. -!!! error TS2763: Overload 2 of 2, '(props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error. -!!! error TS2763: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. -!!! error TS2763: Types of property 'children' are incompatible. -!!! error TS2763: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. +!!! error TS2769: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. +!!! error TS2769: Types of property 'children' are incompatible. +!!! error TS2769: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. +!!! error TS2769: Types of property 'length' are incompatible. +!!! error TS2769: Type '3' is not assignable to type '2'. +!!! error TS2769: Overload 2 of 2, '(props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error. +!!! error TS2769: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. +!!! error TS2769: Types of property 'children' are incompatible. +!!! error TS2769: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'.

diff --git a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt index b972a5bb7c5..ede187259de 100644 --- a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt +++ b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,21): error TS2763: No overload matches this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,21): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. @@ -6,7 +6,7 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,21): error TS2763: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,22): error TS2763: No overload matches this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,22): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. @@ -14,7 +14,7 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,22): error TS2763: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2763: No overload matches this call. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. Type 'void' is not assignable to type 'boolean'. @@ -51,14 +51,14 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2763: // Error: Void not assignable to boolean const Test2 = () => console.log(value)} />; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -!!! error TS2763: Type 'void' is not assignable to type 'boolean'. -!!! error TS2763: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2769: Type 'void' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. !!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' !!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' @@ -78,14 +78,14 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2763: // Error: Void not assignable to boolean const Test2a = () => console.log(value)} error>Hah; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -!!! error TS2763: Type 'void' is not assignable to type 'boolean'. -!!! error TS2763: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2769: Type 'void' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. !!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, "when" | "error">> & Partial>' !!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, "when" | "error">> & Partial>' @@ -110,12 +110,12 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,21): error TS2763: // Error: Void not assignable to boolean const Test4 = () => console.log(value)} />; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -!!! error TS2763: Type 'void' is not assignable to type 'boolean'. -!!! error TS2763: Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. -!!! error TS2763: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2769: Type 'void' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. !!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' !!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' diff --git a/tests/baselines/reference/strictBindCallApply1.errors.txt b/tests/baselines/reference/strictBindCallApply1.errors.txt index e14635b1075..cd30931bcfe 100644 --- a/tests/baselines/reference/strictBindCallApply1.errors.txt +++ b/tests/baselines/reference/strictBindCallApply1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2763: No overload matches this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2769: No overload matches this call. Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. Argument of type '20' is not assignable to parameter of type 'string'. Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. @@ -15,7 +15,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(23,37): error TS2322: tests/cases/conformance/functions/strictBindCallApply1.ts(24,32): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. -tests/cases/conformance/functions/strictBindCallApply1.ts(41,11): error TS2763: No overload matches this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(41,11): error TS2769: No overload matches this call. Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. Argument of type '20' is not assignable to parameter of type 'string'. Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. @@ -23,7 +23,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(41,11): error TS2763: Types of parameters 'b' and 'args' are incompatible. Type '10 | 20' is not assignable to type 'string'. Type '10' is not assignable to type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(42,11): error TS2763: No overload matches this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(42,11): error TS2769: No overload matches this call. Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. Argument of type 'undefined' is not assignable to parameter of type 'C'. Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. @@ -39,7 +39,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(54,26): error TS2345: tests/cases/conformance/functions/strictBindCallApply1.ts(55,31): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(56,26): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. tests/cases/conformance/functions/strictBindCallApply1.ts(57,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. -tests/cases/conformance/functions/strictBindCallApply1.ts(62,11): error TS2763: No overload matches this call. +tests/cases/conformance/functions/strictBindCallApply1.ts(62,11): error TS2769: No overload matches this call. Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. Argument of type '20' is not assignable to parameter of type 'string'. Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. @@ -68,14 +68,14 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f02 = foo.bind(undefined, 10, "hello"); let f03 = foo.bind(undefined, 10, 20); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. -!!! error TS2763: Argument of type '20' is not assignable to parameter of type 'string'. -!!! error TS2763: Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. -!!! error TS2763: The 'this' context of type '(a: number, b: string) => string' is not assignable to method's 'this' of type '(this: undefined, ...args: (10 | 20)[]) => string'. -!!! error TS2763: Types of parameters 'b' and 'args' are incompatible. -!!! error TS2763: Type '10 | 20' is not assignable to type 'string'. -!!! error TS2763: Type '10' is not assignable to type 'string'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. +!!! error TS2769: Argument of type '20' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. +!!! error TS2769: The 'this' context of type '(a: number, b: string) => string' is not assignable to method's 'this' of type '(this: undefined, ...args: (10 | 20)[]) => string'. +!!! error TS2769: Types of parameters 'b' and 'args' are incompatible. +!!! error TS2769: Type '10 | 20' is not assignable to type 'string'. +!!! error TS2769: Type '10' is not assignable to type 'string'. let f04 = overloaded.bind(undefined); // typeof overloaded let f05 = generic.bind(undefined); // typeof generic @@ -122,24 +122,24 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f12 = c.foo.bind(c, 10, "hello"); let f13 = c.foo.bind(c, 10, 20); // Error ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. -!!! error TS2763: Argument of type '20' is not assignable to parameter of type 'string'. -!!! error TS2763: Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. -!!! error TS2763: The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (10 | 20)[]) => string'. -!!! error TS2763: Types of parameters 'b' and 'args' are incompatible. -!!! error TS2763: Type '10 | 20' is not assignable to type 'string'. -!!! error TS2763: Type '10' is not assignable to type 'string'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. +!!! error TS2769: Argument of type '20' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. +!!! error TS2769: The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (10 | 20)[]) => string'. +!!! error TS2769: Types of parameters 'b' and 'args' are incompatible. +!!! error TS2769: Type '10 | 20' is not assignable to type 'string'. +!!! error TS2769: Type '10' is not assignable to type 'string'. let f14 = c.foo.bind(undefined); // Error ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. -!!! error TS2763: Argument of type 'undefined' is not assignable to parameter of type 'C'. -!!! error TS2763: Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. -!!! error TS2763: The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (string | number)[]) => string'. -!!! error TS2763: Types of parameters 'a' and 'args' are incompatible. -!!! error TS2763: Type 'string | number' is not assignable to type 'number'. -!!! error TS2763: Type 'string' is not assignable to type 'number'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type 'C'. +!!! error TS2769: Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. +!!! error TS2769: The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (string | number)[]) => string'. +!!! error TS2769: Types of parameters 'a' and 'args' are incompatible. +!!! error TS2769: Type 'string | number' is not assignable to type 'number'. +!!! error TS2769: Type 'string' is not assignable to type 'number'. let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded let f16 = c.generic.bind(c); // typeof C.prototype.generic @@ -177,14 +177,14 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let f22 = C.bind(undefined, 10, "hello"); let f23 = C.bind(undefined, 10, 20); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. -!!! error TS2763: Argument of type '20' is not assignable to parameter of type 'string'. -!!! error TS2763: Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. -!!! error TS2763: The 'this' context of type 'typeof C' is not assignable to method's 'this' of type 'new (...args: (10 | 20)[]) => C'. -!!! error TS2763: Types of parameters 'b' and 'args' are incompatible. -!!! error TS2763: Type '10 | 20' is not assignable to type 'string'. -!!! error TS2763: Type '10' is not assignable to type 'string'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. +!!! error TS2769: Argument of type '20' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. +!!! error TS2769: The 'this' context of type 'typeof C' is not assignable to method's 'this' of type 'new (...args: (10 | 20)[]) => C'. +!!! error TS2769: Types of parameters 'b' and 'args' are incompatible. +!!! error TS2769: Type '10 | 20' is not assignable to type 'string'. +!!! error TS2769: Type '10' is not assignable to type 'string'. C.call(c, 10, "hello"); C.call(c, 10); // Error diff --git a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt index 80230ec72b1..056bd0b0dd7 100644 --- a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt +++ b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt @@ -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,13): error TS2763: No overload matches this call. +tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. Type '{}' is not assignable to type 'Readonly

'. Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. @@ -27,11 +27,11 @@ tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,13): error TS2763: No o !!! error TS2322: '{}' is assignable to the constraint of type 'P', but 'P' could be instantiated with a different subtype of constraint '{}'. let y = ; // should error ~~~~~~~~~~~~~~~ -!!! error TS2763: No overload matches this call. -!!! error TS2763: Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. -!!! error TS2763: Type '{}' is not assignable to type 'Readonly

'. -!!! error TS2763: Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. -!!! error TS2763: Type '{}' is not assignable to type 'Readonly

'. +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. +!!! error TS2769: Type '{}' is not assignable to type 'Readonly

'. +!!! error TS2769: Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. +!!! error TS2769: Type '{}' is not assignable to type 'Readonly

'. let z = // should work let q = // should work