From 5d332ae2e24b7bf5126e243ace1f15570fe2d01a Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Tue, 8 Nov 2022 13:48:45 -0800 Subject: [PATCH 01/12] add diagnostic message for call signature length mismatch --- src/compiler/checker.ts | 3 +++ src/compiler/diagnosticMessages.json | 4 ++++ .../signatureLengthMismatchCall.errors.txt | 14 ++++++++++++++ .../reference/signatureLengthMismatchCall.js | 13 +++++++++++++ .../signatureLengthMismatchCall.symbols | 14 ++++++++++++++ .../reference/signatureLengthMismatchCall.types | 16 ++++++++++++++++ .../compiler/signatureLengthMismatchCall.ts | 5 +++++ 7 files changed, 69 insertions(+) create mode 100644 tests/baselines/reference/signatureLengthMismatchCall.errors.txt create mode 100644 tests/baselines/reference/signatureLengthMismatchCall.js create mode 100644 tests/baselines/reference/signatureLengthMismatchCall.symbols create mode 100644 tests/baselines/reference/signatureLengthMismatchCall.types create mode 100644 tests/cases/compiler/signatureLengthMismatchCall.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 310dbacba3aae..f28621b76c547 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -18480,6 +18480,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const sourceHasMoreParameters = !hasEffectiveRestParameter(target) && (checkMode & SignatureCheckMode.StrictArity ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount); if (sourceHasMoreParameters) { + if (reportErrors) { + errorReporter!(Diagnostics.Call_signature_0_expects_more_arguments_than_call_signature_1, signatureToString(source), signatureToString(target)); + } return Ternary.False; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index c0395bdfea0a4..fe844801d28a2 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3563,6 +3563,10 @@ "category": "Error", "code": 2845 }, + "Call signature '{0}' expects more arguments than call signature '{1}'.": { + "category": "Error", + "code": 2846 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/tests/baselines/reference/signatureLengthMismatchCall.errors.txt b/tests/baselines/reference/signatureLengthMismatchCall.errors.txt new file mode 100644 index 0000000000000..eea54fcff92c0 --- /dev/null +++ b/tests/baselines/reference/signatureLengthMismatchCall.errors.txt @@ -0,0 +1,14 @@ +tests/cases/compiler/signatureLengthMismatchCall.ts(5,15): error TS2345: Argument of type '(a: number, b: number) => void' is not assignable to parameter of type '(a: number) => void'. + Call signature '(a: number, b: number): void' expects more arguments than call signature '(a: number): void'. + + +==== tests/cases/compiler/signatureLengthMismatchCall.ts (1 errors) ==== + function takesCallback(fn: (a: number) => void) { + // ... + } + + takesCallback((a: number, b: number) => {}); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '(a: number, b: number) => void' is not assignable to parameter of type '(a: number) => void'. +!!! error TS2345: Call signature '(a: number, b: number): void' expects more arguments than call signature '(a: number): void'. + \ No newline at end of file diff --git a/tests/baselines/reference/signatureLengthMismatchCall.js b/tests/baselines/reference/signatureLengthMismatchCall.js new file mode 100644 index 0000000000000..5d6e3db9cd0ff --- /dev/null +++ b/tests/baselines/reference/signatureLengthMismatchCall.js @@ -0,0 +1,13 @@ +//// [signatureLengthMismatchCall.ts] +function takesCallback(fn: (a: number) => void) { + // ... +} + +takesCallback((a: number, b: number) => {}); + + +//// [signatureLengthMismatchCall.js] +function takesCallback(fn) { + // ... +} +takesCallback(function (a, b) { }); diff --git a/tests/baselines/reference/signatureLengthMismatchCall.symbols b/tests/baselines/reference/signatureLengthMismatchCall.symbols new file mode 100644 index 0000000000000..2dea6b1f4873f --- /dev/null +++ b/tests/baselines/reference/signatureLengthMismatchCall.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/signatureLengthMismatchCall.ts === +function takesCallback(fn: (a: number) => void) { +>takesCallback : Symbol(takesCallback, Decl(signatureLengthMismatchCall.ts, 0, 0)) +>fn : Symbol(fn, Decl(signatureLengthMismatchCall.ts, 0, 23)) +>a : Symbol(a, Decl(signatureLengthMismatchCall.ts, 0, 28)) + + // ... +} + +takesCallback((a: number, b: number) => {}); +>takesCallback : Symbol(takesCallback, Decl(signatureLengthMismatchCall.ts, 0, 0)) +>a : Symbol(a, Decl(signatureLengthMismatchCall.ts, 4, 15)) +>b : Symbol(b, Decl(signatureLengthMismatchCall.ts, 4, 25)) + diff --git a/tests/baselines/reference/signatureLengthMismatchCall.types b/tests/baselines/reference/signatureLengthMismatchCall.types new file mode 100644 index 0000000000000..40adf7ef828e9 --- /dev/null +++ b/tests/baselines/reference/signatureLengthMismatchCall.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/signatureLengthMismatchCall.ts === +function takesCallback(fn: (a: number) => void) { +>takesCallback : (fn: (a: number) => void) => void +>fn : (a: number) => void +>a : number + + // ... +} + +takesCallback((a: number, b: number) => {}); +>takesCallback((a: number, b: number) => {}) : void +>takesCallback : (fn: (a: number) => void) => void +>(a: number, b: number) => {} : (a: number, b: number) => void +>a : number +>b : number + diff --git a/tests/cases/compiler/signatureLengthMismatchCall.ts b/tests/cases/compiler/signatureLengthMismatchCall.ts new file mode 100644 index 0000000000000..0d39190a76fcc --- /dev/null +++ b/tests/cases/compiler/signatureLengthMismatchCall.ts @@ -0,0 +1,5 @@ +function takesCallback(fn: (a: number) => void) { + // ... +} + +takesCallback((a: number, b: number) => {}); From a75e9abbdeb5404466f92f047da4976ca8e023c1 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Tue, 8 Nov 2022 14:16:52 -0800 Subject: [PATCH 02/12] differentiate between call and construct --- src/compiler/checker.ts | 18 ++++++++------- src/compiler/diagnosticMessages.json | 4 ++++ ...ignatureLengthMismatchConstruct.errors.txt | 22 +++++++++++++++++++ .../signatureLengthMismatchConstruct.js | 22 +++++++++++++++++++ .../signatureLengthMismatchConstruct.symbols | 21 ++++++++++++++++++ .../signatureLengthMismatchConstruct.types | 22 +++++++++++++++++++ .../signatureLengthMismatchConstruct.ts | 9 ++++++++ 7 files changed, 110 insertions(+), 8 deletions(-) create mode 100644 tests/baselines/reference/signatureLengthMismatchConstruct.errors.txt create mode 100644 tests/baselines/reference/signatureLengthMismatchConstruct.js create mode 100644 tests/baselines/reference/signatureLengthMismatchConstruct.symbols create mode 100644 tests/baselines/reference/signatureLengthMismatchConstruct.types create mode 100644 tests/cases/compiler/signatureLengthMismatchConstruct.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f28621b76c547..78e27f32874f0 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -18442,7 +18442,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { target: Signature, ignoreReturnTypes: boolean): boolean { return compareSignaturesRelated(source, target, ignoreReturnTypes ? SignatureCheckMode.IgnoreReturnTypes : 0, /*reportErrors*/ false, - /*errorReporter*/ undefined, /*errorReporter*/ undefined, compareTypesAssignable, /*reportUnreliableMarkers*/ undefined) !== Ternary.False; + /*errorReporter*/ undefined, /*incompatibleErrorReporter*/ undefined, /*signatureKindForErrors*/ undefined, compareTypesAssignable, /*reportUnreliableMarkers*/ undefined) !== Ternary.False; } type ErrorReporter = (message: DiagnosticMessage, arg0?: string, arg1?: string) => void; @@ -18465,6 +18465,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { reportErrors: boolean, errorReporter: ErrorReporter | undefined, incompatibleErrorReporter: ((source: Type, target: Type) => void) | undefined, + signatureKindForErrors: SignatureKind | undefined, compareTypes: TypeComparer, reportUnreliableMarkers: TypeMapper | undefined): Ternary { // TODO (drosen): De-duplicate code between related functions. @@ -18481,7 +18482,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { (checkMode & SignatureCheckMode.StrictArity ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount); if (sourceHasMoreParameters) { if (reportErrors) { - errorReporter!(Diagnostics.Call_signature_0_expects_more_arguments_than_call_signature_1, signatureToString(source), signatureToString(target)); + const diagnostic = signatureKindForErrors! === SignatureKind.Call ? Diagnostics.Call_signature_0_expects_more_arguments_than_call_signature_1 : Diagnostics.Construct_signature_0_expects_more_arguments_than_construct_signature_1; + errorReporter!(diagnostic, signatureToString(source), signatureToString(target)); } return Ternary.False; } @@ -18540,7 +18542,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && (getTypeFacts(sourceType) & TypeFacts.IsUndefinedOrNull) === (getTypeFacts(targetType) & TypeFacts.IsUndefinedOrNull); let related = callbacks ? - compareSignaturesRelated(targetSig, sourceSig, (checkMode & SignatureCheckMode.StrictArity) | (strictVariance ? SignatureCheckMode.StrictCallback : SignatureCheckMode.BivariantCallback), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : + compareSignaturesRelated(targetSig, sourceSig, (checkMode & SignatureCheckMode.StrictArity) | (strictVariance ? SignatureCheckMode.StrictCallback : SignatureCheckMode.BivariantCallback), reportErrors, errorReporter, incompatibleErrorReporter, signatureKindForErrors, compareTypes, reportUnreliableMarkers) : !(checkMode & SignatureCheckMode.Callback) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors); // With strict arity, (x: number | undefined) => void is a subtype of (x?: number | undefined) => void if (related && checkMode & SignatureCheckMode.StrictArity && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes(sourceType, targetType, /*reportErrors*/ false)) { @@ -20914,7 +20916,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // of the much more expensive N * M comparison matrix we explore below. We erase type parameters // as they are known to always be the same. for (let i = 0; i < targetSignatures.length; i++) { - const related = signatureRelatedTo(sourceSignatures[i], targetSignatures[i], /*erase*/ true, reportErrors, incompatibleReporter(sourceSignatures[i], targetSignatures[i])); + const related = signatureRelatedTo(sourceSignatures[i], targetSignatures[i], /*erase*/ true, reportErrors, incompatibleReporter(sourceSignatures[i], targetSignatures[i]), kind); if (!related) { return Ternary.False; } @@ -20930,7 +20932,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const eraseGenerics = relation === comparableRelation || !!compilerOptions.noStrictGenericChecks; const sourceSignature = first(sourceSignatures); const targetSignature = first(targetSignatures); - result = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors, incompatibleReporter(sourceSignature, targetSignature)); + result = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors, incompatibleReporter(sourceSignature, targetSignature), kind); if (!result && reportErrors && kind === SignatureKind.Construct && (sourceObjectFlags & targetObjectFlags) && (targetSignature.declaration?.kind === SyntaxKind.Constructor || sourceSignature.declaration?.kind === SyntaxKind.Constructor)) { const constructSignatureToString = (signature: Signature) => @@ -20946,7 +20948,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // Only elaborate errors from the first failure let shouldElaborateErrors = reportErrors; for (const s of sourceSignatures) { - const related = signatureRelatedTo(s, t, /*erase*/ true, shouldElaborateErrors, incompatibleReporter(s, t)); + const related = signatureRelatedTo(s, t, /*erase*/ true, shouldElaborateErrors, incompatibleReporter(s, t), kind); if (related) { result &= related; resetErrorInfo(saveErrorInfo); @@ -20996,9 +20998,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { /** * See signatureAssignableTo, compareSignaturesIdentical */ - function signatureRelatedTo(source: Signature, target: Signature, erase: boolean, reportErrors: boolean, incompatibleReporter: (source: Type, target: Type) => void): Ternary { + function signatureRelatedTo(source: Signature, target: Signature, erase: boolean, reportErrors: boolean, incompatibleReporter: (source: Type, target: Type) => void, signatureKind: SignatureKind): Ternary { return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, - relation === strictSubtypeRelation ? SignatureCheckMode.StrictArity : 0, reportErrors, reportError, incompatibleReporter, isRelatedToWorker, reportUnreliableMapper); + relation === strictSubtypeRelation ? SignatureCheckMode.StrictArity : 0, reportErrors, reportError, incompatibleReporter, signatureKind, isRelatedToWorker, reportUnreliableMapper); } function signaturesIdenticalTo(source: Type, target: Type, kind: SignatureKind): Ternary { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index fe844801d28a2..2d7c5748cd8a5 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3567,6 +3567,10 @@ "category": "Error", "code": 2846 }, + "Construct signature '{0}' expects more arguments than construct signature '{1}'.": { + "category": "Error", + "code": 2847 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/tests/baselines/reference/signatureLengthMismatchConstruct.errors.txt b/tests/baselines/reference/signatureLengthMismatchConstruct.errors.txt new file mode 100644 index 0000000000000..6ce61dde789ba --- /dev/null +++ b/tests/baselines/reference/signatureLengthMismatchConstruct.errors.txt @@ -0,0 +1,22 @@ +tests/cases/compiler/signatureLengthMismatchConstruct.ts(9,15): error TS2345: Argument of type 'typeof OverlongCtor' is not assignable to parameter of type 'new (a: number) => void'. + Types of construct signatures are incompatible. + Type 'new (a: number, b: number) => OverlongCtor' is not assignable to type 'new (a: number) => void'. + Construct signature '(a: number, b: number): OverlongCtor' expects more arguments than construct signature '(a: number): void'. + + +==== tests/cases/compiler/signatureLengthMismatchConstruct.ts (1 errors) ==== + function takesCallback(fn: new (a: number) => void) { + // ... + } + + class OverlongCtor { + constructor(a: number, b: number) {} + } + + takesCallback(OverlongCtor); + ~~~~~~~~~~~~ +!!! error TS2345: Argument of type 'typeof OverlongCtor' is not assignable to parameter of type 'new (a: number) => void'. +!!! error TS2345: Types of construct signatures are incompatible. +!!! error TS2345: Type 'new (a: number, b: number) => OverlongCtor' is not assignable to type 'new (a: number) => void'. +!!! error TS2345: Construct signature '(a: number, b: number): OverlongCtor' expects more arguments than construct signature '(a: number): void'. + \ No newline at end of file diff --git a/tests/baselines/reference/signatureLengthMismatchConstruct.js b/tests/baselines/reference/signatureLengthMismatchConstruct.js new file mode 100644 index 0000000000000..ad05c7245feb6 --- /dev/null +++ b/tests/baselines/reference/signatureLengthMismatchConstruct.js @@ -0,0 +1,22 @@ +//// [signatureLengthMismatchConstruct.ts] +function takesCallback(fn: new (a: number) => void) { + // ... +} + +class OverlongCtor { + constructor(a: number, b: number) {} +} + +takesCallback(OverlongCtor); + + +//// [signatureLengthMismatchConstruct.js] +function takesCallback(fn) { + // ... +} +var OverlongCtor = /** @class */ (function () { + function OverlongCtor(a, b) { + } + return OverlongCtor; +}()); +takesCallback(OverlongCtor); diff --git a/tests/baselines/reference/signatureLengthMismatchConstruct.symbols b/tests/baselines/reference/signatureLengthMismatchConstruct.symbols new file mode 100644 index 0000000000000..277b8c4234510 --- /dev/null +++ b/tests/baselines/reference/signatureLengthMismatchConstruct.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/signatureLengthMismatchConstruct.ts === +function takesCallback(fn: new (a: number) => void) { +>takesCallback : Symbol(takesCallback, Decl(signatureLengthMismatchConstruct.ts, 0, 0)) +>fn : Symbol(fn, Decl(signatureLengthMismatchConstruct.ts, 0, 23)) +>a : Symbol(a, Decl(signatureLengthMismatchConstruct.ts, 0, 32)) + + // ... +} + +class OverlongCtor { +>OverlongCtor : Symbol(OverlongCtor, Decl(signatureLengthMismatchConstruct.ts, 2, 1)) + + constructor(a: number, b: number) {} +>a : Symbol(a, Decl(signatureLengthMismatchConstruct.ts, 5, 14)) +>b : Symbol(b, Decl(signatureLengthMismatchConstruct.ts, 5, 24)) +} + +takesCallback(OverlongCtor); +>takesCallback : Symbol(takesCallback, Decl(signatureLengthMismatchConstruct.ts, 0, 0)) +>OverlongCtor : Symbol(OverlongCtor, Decl(signatureLengthMismatchConstruct.ts, 2, 1)) + diff --git a/tests/baselines/reference/signatureLengthMismatchConstruct.types b/tests/baselines/reference/signatureLengthMismatchConstruct.types new file mode 100644 index 0000000000000..42021b98fe30c --- /dev/null +++ b/tests/baselines/reference/signatureLengthMismatchConstruct.types @@ -0,0 +1,22 @@ +=== tests/cases/compiler/signatureLengthMismatchConstruct.ts === +function takesCallback(fn: new (a: number) => void) { +>takesCallback : (fn: new (a: number) => void) => void +>fn : new (a: number) => void +>a : number + + // ... +} + +class OverlongCtor { +>OverlongCtor : OverlongCtor + + constructor(a: number, b: number) {} +>a : number +>b : number +} + +takesCallback(OverlongCtor); +>takesCallback(OverlongCtor) : void +>takesCallback : (fn: new (a: number) => void) => void +>OverlongCtor : typeof OverlongCtor + diff --git a/tests/cases/compiler/signatureLengthMismatchConstruct.ts b/tests/cases/compiler/signatureLengthMismatchConstruct.ts new file mode 100644 index 0000000000000..8ef950ea9cea6 --- /dev/null +++ b/tests/cases/compiler/signatureLengthMismatchConstruct.ts @@ -0,0 +1,9 @@ +function takesCallback(fn: new (a: number) => void) { + // ... +} + +class OverlongCtor { + constructor(a: number, b: number) {} +} + +takesCallback(OverlongCtor); From bd750fc719ad15564cd45fed38d4c38195e9cad9 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Tue, 8 Nov 2022 14:30:10 -0800 Subject: [PATCH 03/12] rebaseline --- ...addMoreOverloadsToBaseSignature.errors.txt | 2 ++ .../arrowFunctionErrorSpan.errors.txt | 4 +++ ...ignaturesWithOptionalParameters.errors.txt | 14 ++++++++ ...ignaturesWithOptionalParameters.errors.txt | 10 ++++++ ...ignaturesWithOptionalParameters.errors.txt | 12 +++++++ .../assignmentCompatability44.errors.txt | 2 ++ .../assignmentCompatability45.errors.txt | 2 ++ .../reference/checkJsdocTypeTag6.errors.txt | 6 ++++ ...assCanExtendConstructorFunction.errors.txt | 2 ++ .../classSideInheritance3.errors.txt | 4 +++ .../reference/covariantCallbacks.errors.txt | 2 ++ .../derivedInterfaceCallSignature.errors.txt | 2 ++ ...functionConstraintSatisfaction2.errors.txt | 2 ++ ...lWithConstructorTypedArguments5.errors.txt | 4 +++ ...CallWithFunctionTypedArguments5.errors.txt | 4 +++ ...oadedConstructorTypedArguments2.errors.txt | 2 ++ ...erloadedFunctionTypedArguments2.errors.txt | 2 ++ .../reference/incompatibleTypes.errors.txt | 2 ++ .../reference/inferTypes1.errors.txt | 2 ++ .../reference/inheritance.errors.txt | 2 ++ .../reference/lambdaArgCrash.errors.txt | 2 ++ .../reference/multipleInheritance.errors.txt | 2 ++ ...ralFunctionArgContextualTyping2.errors.txt | 8 ++++- .../baselines/reference/parseTypes.errors.txt | 4 +++ ...AnnotatedFunctionInferenceError.errors.txt | 6 ++++ .../reference/promisePermutations.errors.txt | 32 +++++++++++++++++++ .../reference/promisePermutations2.errors.txt | 32 +++++++++++++++++++ .../reference/promisePermutations3.errors.txt | 32 +++++++++++++++++++ .../requiredInitializedParameter2.errors.txt | 2 ++ ...edTypeContextualTypeNotCircular.errors.txt | 2 ++ ...ignaturesWithOptionalParameters.errors.txt | 4 +++ ...ignaturesWithOptionalParameters.errors.txt | 4 +++ ...ignaturesWithOptionalParameters.errors.txt | 12 +++++++ ...ignaturesWithOptionalParameters.errors.txt | 12 +++++++ ...ionComponentsWithTypeArguments2.errors.txt | 2 ++ .../typeGuardFunctionErrors.errors.txt | 2 ++ 36 files changed, 239 insertions(+), 1 deletion(-) diff --git a/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt b/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt index 4b6255688f8e8..8ef15e9710f56 100644 --- a/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt +++ b/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/addMoreOverloadsToBaseSignature.ts(5,11): error TS2430: Interface 'Bar' incorrectly extends interface 'Foo'. Types of property 'f' are incompatible. Type '(key: string) => string' is not assignable to type '() => string'. + Call signature '(key: string): string' expects more arguments than call signature '(): string'. ==== tests/cases/compiler/addMoreOverloadsToBaseSignature.ts (1 errors) ==== @@ -13,6 +14,7 @@ tests/cases/compiler/addMoreOverloadsToBaseSignature.ts(5,11): error TS2430: Int !!! error TS2430: Interface 'Bar' incorrectly extends interface 'Foo'. !!! error TS2430: Types of property 'f' are incompatible. !!! error TS2430: Type '(key: string) => string' is not assignable to type '() => string'. +!!! error TS2430: Call signature '(key: string): string' expects more arguments than call signature '(): string'. f(key: string): string; } \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionErrorSpan.errors.txt b/tests/baselines/reference/arrowFunctionErrorSpan.errors.txt index e258f56d5ed03..3c7e344fd8a7c 100644 --- a/tests/baselines/reference/arrowFunctionErrorSpan.errors.txt +++ b/tests/baselines/reference/arrowFunctionErrorSpan.errors.txt @@ -8,6 +8,7 @@ tests/cases/compiler/arrowFunctionErrorSpan.ts(17,3): error TS2345: Argument of Type 'void' is not assignable to type 'number'. tests/cases/compiler/arrowFunctionErrorSpan.ts(18,5): error TS1200: Line terminator not permitted before arrow. tests/cases/compiler/arrowFunctionErrorSpan.ts(21,3): error TS2345: Argument of type '(a: any, b: any, c: any, d: any) => void' is not assignable to parameter of type '() => number'. + Call signature '(a: any, b: any, c: any, d: any): void' expects more arguments than call signature '(): number'. tests/cases/compiler/arrowFunctionErrorSpan.ts(28,7): error TS2345: Argument of type '() => void' is not assignable to parameter of type '() => number'. Type 'void' is not assignable to type 'number'. tests/cases/compiler/arrowFunctionErrorSpan.ts(32,7): error TS2345: Argument of type '() => void' is not assignable to parameter of type '() => number'. @@ -17,6 +18,7 @@ tests/cases/compiler/arrowFunctionErrorSpan.ts(36,7): error TS2345: Argument of tests/cases/compiler/arrowFunctionErrorSpan.ts(43,5): error TS2345: Argument of type '() => void' is not assignable to parameter of type '() => number'. Type 'void' is not assignable to type 'number'. tests/cases/compiler/arrowFunctionErrorSpan.ts(52,3): error TS2345: Argument of type '(_: any) => number' is not assignable to parameter of type '() => number'. + Call signature '(_: any): number' expects more arguments than call signature '(): number'. ==== tests/cases/compiler/arrowFunctionErrorSpan.ts (11 errors) ==== @@ -64,6 +66,7 @@ tests/cases/compiler/arrowFunctionErrorSpan.ts(52,3): error TS2345: Argument of d) => { }); ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(a: any, b: any, c: any, d: any) => void' is not assignable to parameter of type '() => number'. +!!! error TS2345: Call signature '(a: any, b: any, c: any, d: any): void' expects more arguments than call signature '(): number'. // single line with a comment f(/* @@ -108,4 +111,5 @@ tests/cases/compiler/arrowFunctionErrorSpan.ts(52,3): error TS2345: Argument of 2); ~~~~~ !!! error TS2345: Argument of type '(_: any) => number' is not assignable to parameter of type '() => number'. +!!! error TS2345: Call signature '(_: any): number' expects more arguments than call signature '(): number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt index f89bbfa5798f7..a2ee02545eb4a 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt @@ -1,10 +1,17 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(16,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. + Call signature '(x: number): number' expects more arguments than call signature '(): number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. + Call signature '(x: number): number' expects more arguments than call signature '(): number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(20,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. + Call signature '(x: number, y?: number): number' expects more arguments than call signature '(): number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(22,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '() => number'. + Call signature '(x: number, y: number): number' expects more arguments than call signature '(): number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(33,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. + Call signature '(x: number, y: number): number' expects more arguments than call signature '(x?: number): number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(39,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. + Call signature '(x: number, y: number): number' expects more arguments than call signature '(x: number): number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(45,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. + Call signature '(x: number, y: number): number' expects more arguments than call signature '(x: number): number'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts (7 errors) ==== @@ -26,18 +33,22 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = (x: number) => 1; // error, too many required params ~ !!! error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. +!!! error TS2322: Call signature '(x: number): number' expects more arguments than call signature '(): number'. a = b.a; // ok a = b.a2; // ok a = b.a3; // error ~ !!! error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. +!!! error TS2322: Call signature '(x: number): number' expects more arguments than call signature '(): number'. a = b.a4; // error ~ !!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. +!!! error TS2322: Call signature '(x: number, y?: number): number' expects more arguments than call signature '(): number'. a = b.a5; // ok a = b.a6; // error ~ !!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '() => number'. +!!! error TS2322: Call signature '(x: number, y: number): number' expects more arguments than call signature '(): number'. var a2: (x?: number) => number; a2 = () => 1; // ok, same number of required params @@ -51,6 +62,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = b.a6; // error ~~ !!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. +!!! error TS2322: Call signature '(x: number, y: number): number' expects more arguments than call signature '(x?: number): number'. var a3: (x: number) => number; a3 = () => 1; // ok, fewer required params @@ -59,6 +71,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = (x: number, y: number) => 1; // error, too many required params ~~ !!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. +!!! error TS2322: Call signature '(x: number, y: number): number' expects more arguments than call signature '(x: number): number'. a3 = b.a; // ok a3 = b.a2; // ok a3 = b.a3; // ok @@ -67,6 +80,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = b.a6; // error ~~ !!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. +!!! error TS2322: Call signature '(x: number, y: number): number' expects more arguments than call signature '(x: number): number'. var a4: (x: number, y?: number) => number; a4 = () => 1; // ok, fewer required params diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt index df56af3ee98ed..d7af95a7a7a27 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt @@ -1,8 +1,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(16,5): error TS2322: Type 'new (x: number) => number' is not assignable to type 'new () => number'. + Construct signature '(x: number): number' expects more arguments than construct signature '(): number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(17,5): error TS2322: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. + Construct signature '(x: number, y?: number): number' expects more arguments than construct signature '(): number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. + Construct signature '(x: number, y: number): number' expects more arguments than construct signature '(): number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(27,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. + Construct signature '(x: number, y: number): number' expects more arguments than construct signature '(x?: number): number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(35,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. + Construct signature '(x: number, y: number): number' expects more arguments than construct signature '(x: number): number'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts (5 errors) ==== @@ -24,13 +29,16 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b.a3; // error ~ !!! error TS2322: Type 'new (x: number) => number' is not assignable to type 'new () => number'. +!!! error TS2322: Construct signature '(x: number): number' expects more arguments than construct signature '(): number'. a = b.a4; // error ~ !!! error TS2322: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. +!!! error TS2322: Construct signature '(x: number, y?: number): number' expects more arguments than construct signature '(): number'. a = b.a5; // ok a = b.a6; // error ~ !!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. +!!! error TS2322: Construct signature '(x: number, y: number): number' expects more arguments than construct signature '(): number'. var a2: new (x?: number) => number; a2 = b.a; // ok @@ -41,6 +49,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = b.a6; // error ~~ !!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. +!!! error TS2322: Construct signature '(x: number, y: number): number' expects more arguments than construct signature '(x?: number): number'. var a3: new (x: number) => number; a3 = b.a; // ok @@ -51,6 +60,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = b.a6; // error ~~ !!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. +!!! error TS2322: Construct signature '(x: number, y: number): number' expects more arguments than construct signature '(x: number): number'. var a4: new (x: number, y?: number) => number; a4 = b.a; // ok diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt index e6abee1ecff81..edffa5ba82478 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt @@ -1,5 +1,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(14,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. + Call signature '(x: T): any' expects more arguments than call signature '(): T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(23,13): error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. + Call signature '(x: T, y: T): any' expects more arguments than call signature '(x: T): T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(63,9): error TS2322: Type '() => T' is not assignable to type '() => T'. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'. @@ -7,7 +9,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(65,9): error TS2322: Type '(x: T) => T' is not assignable to type '() => T'. + Call signature '(x: T): T' expects more arguments than call signature '(): T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(66,9): error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '() => T'. + Call signature '(x: T, y?: T): T' expects more arguments than call signature '(): T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(67,9): error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '() => T'. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'. @@ -88,7 +92,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(107,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. + Call signature '(x: T): any' expects more arguments than call signature '(): T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(116,13): error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. + Call signature '(x: T, y: T): any' expects more arguments than call signature '(x: T): T'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts (29 errors) ==== @@ -108,6 +114,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a = (x: T) => null; // error, too many required params ~~~~~~ !!! error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. +!!! error TS2322: Call signature '(x: T): any' expects more arguments than call signature '(): T'. this.a2 = () => null; // ok, same T of required params this.a2 = (x?: T) => null; // ok, same T of required params @@ -119,6 +126,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a3 = (x: T, y: T) => null; // error, too many required params ~~~~~~~ !!! error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. +!!! error TS2322: Call signature '(x: T, y: T): any' expects more arguments than call signature '(x: T): T'. this.a4 = () => null; // ok, fewer required params this.a4 = (x?: T, y?: T) => null; // ok, fewer required params @@ -173,9 +181,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme b.a = t.a3; ~~~ !!! error TS2322: Type '(x: T) => T' is not assignable to type '() => T'. +!!! error TS2322: Call signature '(x: T): T' expects more arguments than call signature '(): T'. b.a = t.a4; ~~~ !!! error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '() => T'. +!!! error TS2322: Call signature '(x: T, y?: T): T' expects more arguments than call signature '(): T'. b.a = t.a5; ~~~ !!! error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '() => T'. @@ -340,6 +350,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a = (x: T) => null; // error, too many required params ~~~~~~ !!! error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. +!!! error TS2322: Call signature '(x: T): any' expects more arguments than call signature '(): T'. this.a2 = () => null; // ok, same T of required params this.a2 = (x?: T) => null; // ok, same T of required params @@ -351,6 +362,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a3 = (x: T, y: T) => null; // error, too many required params ~~~~~~~ !!! error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. +!!! error TS2322: Call signature '(x: T, y: T): any' expects more arguments than call signature '(x: T): T'. this.a4 = () => null; // ok, fewer required params this.a4 = (x?: T, y?: T) => null; // ok, fewer required params diff --git a/tests/baselines/reference/assignmentCompatability44.errors.txt b/tests/baselines/reference/assignmentCompatability44.errors.txt index 65cd1826acc23..4b23865c8eccf 100644 --- a/tests/baselines/reference/assignmentCompatability44.errors.txt +++ b/tests/baselines/reference/assignmentCompatability44.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/assignmentCompatability44.ts(5,7): error TS2322: Type 'typeof Foo' is not assignable to type 'new () => Foo'. Types of construct signatures are incompatible. Type 'new (x: number) => Foo' is not assignable to type 'new () => Foo'. + Construct signature '(x: number): Foo' expects more arguments than construct signature '(): Foo'. ==== tests/cases/compiler/assignmentCompatability44.ts (1 errors) ==== @@ -13,4 +14,5 @@ tests/cases/compiler/assignmentCompatability44.ts(5,7): error TS2322: Type 'type !!! error TS2322: Type 'typeof Foo' is not assignable to type 'new () => Foo'. !!! error TS2322: Types of construct signatures are incompatible. !!! error TS2322: Type 'new (x: number) => Foo' is not assignable to type 'new () => Foo'. +!!! error TS2322: Construct signature '(x: number): Foo' expects more arguments than construct signature '(): Foo'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability45.errors.txt b/tests/baselines/reference/assignmentCompatability45.errors.txt index af0170320bd1d..f7e39c534f3f8 100644 --- a/tests/baselines/reference/assignmentCompatability45.errors.txt +++ b/tests/baselines/reference/assignmentCompatability45.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/assignmentCompatability45.ts(7,7): error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. Types of construct signatures are incompatible. Type 'new (x: number) => B' is not assignable to type 'abstract new () => A'. + Construct signature '(x: number): B' expects more arguments than construct signature '(): A'. ==== tests/cases/compiler/assignmentCompatability45.ts (1 errors) ==== @@ -15,4 +16,5 @@ tests/cases/compiler/assignmentCompatability45.ts(7,7): error TS2322: Type 'type !!! error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. !!! error TS2322: Types of construct signatures are incompatible. !!! error TS2322: Type 'new (x: number) => B' is not assignable to type 'abstract new () => A'. +!!! error TS2322: Construct signature '(x: number): B' expects more arguments than construct signature '(): A'. \ No newline at end of file diff --git a/tests/baselines/reference/checkJsdocTypeTag6.errors.txt b/tests/baselines/reference/checkJsdocTypeTag6.errors.txt index 605ddad823a4f..f91054ae81e04 100644 --- a/tests/baselines/reference/checkJsdocTypeTag6.errors.txt +++ b/tests/baselines/reference/checkJsdocTypeTag6.errors.txt @@ -3,8 +3,11 @@ tests/cases/conformance/jsdoc/test.js(7,5): error TS2322: Type '(prop: any) => v tests/cases/conformance/jsdoc/test.js(10,12): error TS8030: The type of a function declaration must match the function's signature. tests/cases/conformance/jsdoc/test.js(23,12): error TS8030: The type of a function declaration must match the function's signature. tests/cases/conformance/jsdoc/test.js(27,7): error TS2322: Type '(more: any) => void' is not assignable to type '() => void'. + Call signature '(more: any): void' expects more arguments than call signature '(): void'. tests/cases/conformance/jsdoc/test.js(30,7): error TS2322: Type '(more: any) => void' is not assignable to type '() => void'. + Call signature '(more: any): void' expects more arguments than call signature '(): void'. tests/cases/conformance/jsdoc/test.js(34,3): error TS2322: Type '(more: any) => void' is not assignable to type '() => void'. + Call signature '(more: any): void' expects more arguments than call signature '(): void'. ==== tests/cases/conformance/jsdoc/test.js (7 errors) ==== @@ -45,16 +48,19 @@ tests/cases/conformance/jsdoc/test.js(34,3): error TS2322: Type '(more: any) => const variableWithMoreParameters = function (more) {}; // error ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type '(more: any) => void' is not assignable to type '() => void'. +!!! error TS2322: Call signature '(more: any): void' expects more arguments than call signature '(): void'. /** @type {() => void} */ const arrowWithMoreParameters = (more) => {}; // error ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type '(more: any) => void' is not assignable to type '() => void'. +!!! error TS2322: Call signature '(more: any): void' expects more arguments than call signature '(): void'. ({ /** @type {() => void} */ methodWithMoreParameters(more) {}, // error ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type '(more: any) => void' is not assignable to type '() => void'. +!!! error TS2322: Call signature '(more: any): void' expects more arguments than call signature '(): void'. }); \ No newline at end of file diff --git a/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt b/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt index 1fd6c25a714e4..69482a75252f9 100644 --- a/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt +++ b/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt @@ -1,6 +1,7 @@ tests/cases/conformance/salsa/first.js(23,9): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/salsa/first.js(31,5): error TS2416: Property 'load' in type 'Sql' is not assignable to the same property in base type 'Wagon'. Type '(files: string[], format: "csv" | "json" | "xmlolololol") => void' is not assignable to type '(supplies?: any[]) => void'. + Call signature '(files: string[], format: "csv" | "json" | "xmlolololol"): void' expects more arguments than call signature '(supplies?: any[]): void'. tests/cases/conformance/salsa/first.js(47,24): error TS2507: Type '(numberEaten: number) => void' is not a constructor function type. tests/cases/conformance/salsa/generic.js(19,19): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/salsa/generic.js(20,32): error TS2345: Argument of type 'number' is not assignable to parameter of type '{ claim: "ignorant" | "malicious"; }'. @@ -52,6 +53,7 @@ tests/cases/conformance/salsa/second.ts(17,15): error TS2345: Argument of type ' ~~~~ !!! error TS2416: Property 'load' in type 'Sql' is not assignable to the same property in base type 'Wagon'. !!! error TS2416: Type '(files: string[], format: "csv" | "json" | "xmlolololol") => void' is not assignable to type '(supplies?: any[]) => void'. +!!! error TS2416: Call signature '(files: string[], format: "csv" | "json" | "xmlolololol"): void' expects more arguments than call signature '(supplies?: any[]): void'. if (format === "xmlolololol") { throw new Error("please do not use XML. It was a joke."); } diff --git a/tests/baselines/reference/classSideInheritance3.errors.txt b/tests/baselines/reference/classSideInheritance3.errors.txt index cdad659971592..475db9daa440d 100644 --- a/tests/baselines/reference/classSideInheritance3.errors.txt +++ b/tests/baselines/reference/classSideInheritance3.errors.txt @@ -1,9 +1,11 @@ tests/cases/compiler/classSideInheritance3.ts(16,5): error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. Types of construct signatures are incompatible. Type 'new (x: string, data: string) => B' is not assignable to type 'new (x: string) => A'. + Construct signature '(x: string, data: string): B' expects more arguments than construct signature '(x: string): A'. tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2322: Type 'typeof B' is not assignable to type 'new (x: string) => A'. Types of construct signatures are incompatible. Type 'new (x: string, data: string) => B' is not assignable to type 'new (x: string) => A'. + Construct signature '(x: string, data: string): B' expects more arguments than construct signature '(x: string): A'. ==== tests/cases/compiler/classSideInheritance3.ts (2 errors) ==== @@ -27,9 +29,11 @@ tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2322: Type 'typeof !!! error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. !!! error TS2322: Types of construct signatures are incompatible. !!! error TS2322: Type 'new (x: string, data: string) => B' is not assignable to type 'new (x: string) => A'. +!!! error TS2322: Construct signature '(x: string, data: string): B' expects more arguments than construct signature '(x: string): A'. var r2: new (x: string) => A = B; // error ~~ !!! error TS2322: Type 'typeof B' is not assignable to type 'new (x: string) => A'. !!! error TS2322: Types of construct signatures are incompatible. !!! error TS2322: Type 'new (x: string, data: string) => B' is not assignable to type 'new (x: string) => A'. +!!! error TS2322: Construct signature '(x: string, data: string): B' expects more arguments than construct signature '(x: string): A'. var r3: typeof A = C; // ok \ No newline at end of file diff --git a/tests/baselines/reference/covariantCallbacks.errors.txt b/tests/baselines/reference/covariantCallbacks.errors.txt index 401bf454baa19..aba2724123975 100644 --- a/tests/baselines/reference/covariantCallbacks.errors.txt +++ b/tests/baselines/reference/covariantCallbacks.errors.txt @@ -16,6 +16,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covarian Types of property 'forEach' are incompatible. Type '(cb: (item: A) => void) => void' is not assignable to type '(cb: (item: A, context: any) => void) => void'. Types of parameters 'cb' and 'cb' are incompatible. + Call signature '(item: A, context: any): void' expects more arguments than call signature '(item: A): void'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covariantCallbacks.ts(69,5): error TS2322: Type 'AList4' is not assignable to type 'BList4'. Types of property 'forEach' are incompatible. Type '(cb: (item: A) => A) => void' is not assignable to type '(cb: (item: B) => B) => void'. @@ -105,6 +106,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covarian !!! error TS2322: Types of property 'forEach' are incompatible. !!! error TS2322: Type '(cb: (item: A) => void) => void' is not assignable to type '(cb: (item: A, context: any) => void) => void'. !!! error TS2322: Types of parameters 'cb' and 'cb' are incompatible. +!!! error TS2322: Call signature '(item: A, context: any): void' expects more arguments than call signature '(item: A): void'. } interface AList4 { diff --git a/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt b/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt index ae8fbe2ff5d6c..00b51f5327a93 100644 --- a/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt +++ b/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/derivedInterfaceCallSignature.ts(11,11): error TS2430: Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath'. Types of property 'x' are incompatible. Type '(x: (data: any, index?: number) => number) => D3SvgArea' is not assignable to type '() => (data: any, index?: number) => number'. + Call signature '(x: (data: any, index?: number) => number): D3SvgArea' expects more arguments than call signature '(): (data: any, index?: number) => number'. ==== tests/cases/compiler/derivedInterfaceCallSignature.ts (1 errors) ==== @@ -19,6 +20,7 @@ tests/cases/compiler/derivedInterfaceCallSignature.ts(11,11): error TS2430: Inte !!! error TS2430: Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath'. !!! error TS2430: Types of property 'x' are incompatible. !!! error TS2430: Type '(x: (data: any, index?: number) => number) => D3SvgArea' is not assignable to type '() => (data: any, index?: number) => number'. +!!! error TS2430: Call signature '(x: (data: any, index?: number) => number): D3SvgArea' expects more arguments than call signature '(): (data: any, index?: number) => number'. x(x: (data: any, index?: number) => number): D3SvgArea; y(y: (data: any, index?: number) => number): D3SvgArea; y0(): (data: any, index?: number) => number; diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt index 3914831c26b84..11b4d7f07d185 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt +++ b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt @@ -11,6 +11,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(26,15): error TS2345: Argument of type 'new (x: string) => string' is not assignable to parameter of type '(x: string) => string'. Type 'new (x: string) => string' provides no match for the signature '(x: string): string'. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(28,16): error TS2345: Argument of type '(x: U, y: V) => U' is not assignable to parameter of type '(x: string) => string'. + Call signature '(x: U, y: V): U' expects more arguments than call signature '(x: string): string'. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(29,16): error TS2345: Argument of type 'typeof C2' is not assignable to parameter of type '(x: string) => string'. Type 'typeof C2' provides no match for the signature '(x: string): string'. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(30,16): error TS2345: Argument of type 'new (x: T) => T' is not assignable to parameter of type '(x: string) => string'. @@ -74,6 +75,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain var r11 = foo2((x: U, y: V) => x); ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: U, y: V) => U' is not assignable to parameter of type '(x: string) => string'. +!!! error TS2345: Call signature '(x: U, y: V): U' expects more arguments than call signature '(x: string): string'. var r13 = foo2(C2); ~~ !!! error TS2345: Argument of type 'typeof C2' is not assignable to parameter of type '(x: string) => string'. diff --git a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt index fe2d76b23de89..a7801d2b5d00a 100644 --- a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt +++ b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt @@ -1,9 +1,11 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts(11,14): error TS2345: Argument of type '{ cb: new (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: unknown) => string; }'. Types of property 'cb' are incompatible. Type 'new (x: T, y: T) => string' is not assignable to type 'new (t: unknown) => string'. + Construct signature '(x: T, y: T): string' expects more arguments than construct signature '(t: unknown): string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts(13,14): error TS2345: Argument of type '{ cb: new (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: new (t: string) => string; }'. Types of property 'cb' are incompatible. Type 'new (x: string, y: number) => string' is not assignable to type 'new (t: string) => string'. + Construct signature '(x: string, y: number): string' expects more arguments than construct signature '(t: string): string'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts (2 errors) ==== @@ -22,12 +24,14 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithCon !!! error TS2345: Argument of type '{ cb: new (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: unknown) => string; }'. !!! error TS2345: Types of property 'cb' are incompatible. !!! error TS2345: Type 'new (x: T, y: T) => string' is not assignable to type 'new (t: unknown) => string'. +!!! error TS2345: Construct signature '(x: T, y: T): string' expects more arguments than construct signature '(t: unknown): string'. var arg3: { cb: new (x: string, y: number) => string }; var r3 = foo(arg3); // error ~~~~ !!! error TS2345: Argument of type '{ cb: new (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: new (t: string) => string; }'. !!! error TS2345: Types of property 'cb' are incompatible. !!! error TS2345: Type 'new (x: string, y: number) => string' is not assignable to type 'new (t: string) => string'. +!!! error TS2345: Construct signature '(x: string, y: number): string' expects more arguments than construct signature '(t: string): string'. function foo2(arg: { cb: new(t: T, t2: T) => U }) { return new arg.cb(null, null); diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt index 9af10d79a7d3d..fa2f831a0df59 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt @@ -1,5 +1,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(10,16): error TS2322: Type '(x: T, y: T) => string' is not assignable to type '(t: unknown) => string'. + Call signature '(x: T, y: T): string' expects more arguments than call signature '(t: unknown): string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(11,16): error TS2322: Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'. + Call signature '(x: string, y: number): string' expects more arguments than call signature '(t: string): string'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts (2 errors) ==== @@ -15,10 +17,12 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun var r2 = foo({ cb: (x: T, y: T) => '' }); // error ~~ !!! error TS2322: Type '(x: T, y: T) => string' is not assignable to type '(t: unknown) => string'. +!!! error TS2322: Call signature '(x: T, y: T): string' expects more arguments than call signature '(t: unknown): string'. !!! related TS6500 tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts:3:27: The expected type comes from property 'cb' which is declared here on type '{ cb: (t: unknown) => string; }' var r3 = foo({ cb: (x: string, y: number) => '' }); // error ~~ !!! error TS2322: Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'. +!!! error TS2322: Call signature '(x: string, y: number): string' expects more arguments than call signature '(t: string): string'. !!! related TS6500 tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts:3:27: The expected type comes from property 'cb' which is declared here on type '{ cb: (t: string) => string; }' function foo2(arg: { cb: (t: T, t2: T) => U }) { diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt index 2e52a9d482c69..b11c57409991a 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt @@ -1,4 +1,5 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments2.ts(31,20): error TS2345: Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: unknown): string; new (x: unknown, y?: unknown): string; }'. + Construct signature '(x: any, y: any): string' expects more arguments than construct signature '(x: unknown): string'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments2.ts (1 errors) ==== @@ -35,6 +36,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOve var r10 = foo6(b); // error ~ !!! error TS2345: Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: unknown): string; new (x: unknown, y?: unknown): string; }'. +!!! error TS2345: Construct signature '(x: any, y: any): string' expects more arguments than construct signature '(x: unknown): string'. function foo7(x:T, cb: { new(x: T): string; new(x: T, y?: T): string }) { return cb; diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt index 2e5b19bcf1b50..45b142e5948d2 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt @@ -1,4 +1,5 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments2.ts(28,20): error TS2345: Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: unknown): string; (x: unknown, y?: unknown): string; }'. + Call signature '(x: any, y: any): string' expects more arguments than call signature '(x: unknown): string'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments2.ts (1 errors) ==== @@ -32,6 +33,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOve var r10 = foo6((x: T, y: T) => ''); // error ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: unknown): string; (x: unknown, y?: unknown): string; }'. +!!! error TS2345: Call signature '(x: any, y: any): string' expects more arguments than call signature '(x: unknown): string'. function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { return cb; diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index b49853c5f261c..5b6c2b450ee17 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -29,6 +29,7 @@ tests/cases/compiler/incompatibleTypes.ts(66,47): error TS2322: Type '{ e: numbe 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 'number' is not assignable to type '() => string'. tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. + Call signature '(a: any): number' expects more arguments than call signature '(): any'. ==== tests/cases/compiler/incompatibleTypes.ts (9 errors) ==== @@ -148,4 +149,5 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => var fp1: () =>any = a => 0; ~~~ !!! error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. +!!! error TS2322: Call signature '(a: any): number' expects more arguments than call signature '(): any'. \ No newline at end of file diff --git a/tests/baselines/reference/inferTypes1.errors.txt b/tests/baselines/reference/inferTypes1.errors.txt index 5e7c4bfebb5a4..f2832ff73e312 100644 --- a/tests/baselines/reference/inferTypes1.errors.txt +++ b/tests/baselines/reference/inferTypes1.errors.txt @@ -5,6 +5,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(43,25): error TS2344: T tests/cases/conformance/types/conditional/inferTypes1.ts(44,25): error TS2344: Type 'Function' does not satisfy the constraint 'abstract new (...args: any) => any'. Type 'Function' provides no match for the signature 'new (...args: any): any'. tests/cases/conformance/types/conditional/inferTypes1.ts(55,25): error TS2344: Type '(x: string, y: string) => number' does not satisfy the constraint '(x: any) => any'. + Call signature '(x: string, y: string): number' expects more arguments than call signature '(x: any): any'. tests/cases/conformance/types/conditional/inferTypes1.ts(56,25): error TS2344: Type 'Function' does not satisfy the constraint '(x: any) => any'. Type 'Function' provides no match for the signature '(x: any): any'. tests/cases/conformance/types/conditional/inferTypes1.ts(82,12): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type. @@ -88,6 +89,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(153,40): error TS2322: type T24 = ArgumentType<(x: string, y: string) => number>; // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2344: Type '(x: string, y: string) => number' does not satisfy the constraint '(x: any) => any'. +!!! error TS2344: Call signature '(x: string, y: string): number' expects more arguments than call signature '(x: any): any'. type T25 = ArgumentType; // Error ~~~~~~~~ !!! error TS2344: Type 'Function' does not satisfy the constraint '(x: any) => any'. diff --git a/tests/baselines/reference/inheritance.errors.txt b/tests/baselines/reference/inheritance.errors.txt index b476f1399b445..d3ee3903541d8 100644 --- a/tests/baselines/reference/inheritance.errors.txt +++ b/tests/baselines/reference/inheritance.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/inheritance.ts(31,12): error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. tests/cases/compiler/inheritance.ts(32,12): error TS2416: Property 'g' in type 'Baad' is not assignable to the same property in base type 'Good'. Type '(n: number) => number' is not assignable to type '() => number'. + Call signature '(n: number): number' expects more arguments than call signature '(): number'. ==== tests/cases/compiler/inheritance.ts (2 errors) ==== @@ -41,5 +42,6 @@ tests/cases/compiler/inheritance.ts(32,12): error TS2416: Property 'g' in type ' ~ !!! error TS2416: Property 'g' in type 'Baad' is not assignable to the same property in base type 'Good'. !!! error TS2416: Type '(n: number) => number' is not assignable to type '() => number'. +!!! error TS2416: Call signature '(n: number): number' expects more arguments than call signature '(): number'. } \ No newline at end of file diff --git a/tests/baselines/reference/lambdaArgCrash.errors.txt b/tests/baselines/reference/lambdaArgCrash.errors.txt index 1ca180c793728..fe1a5cb0d0f5e 100644 --- a/tests/baselines/reference/lambdaArgCrash.errors.txt +++ b/tests/baselines/reference/lambdaArgCrash.errors.txt @@ -1,5 +1,6 @@ tests/cases/compiler/lambdaArgCrash.ts(27,25): error TS2304: Cannot find name 'ItemSet'. tests/cases/compiler/lambdaArgCrash.ts(29,14): error TS2345: Argument of type '(items: ItemSet) => void' is not assignable to parameter of type '() => any'. + Call signature '(items: ItemSet): void' expects more arguments than call signature '(): any'. ==== tests/cases/compiler/lambdaArgCrash.ts (2 errors) ==== @@ -36,6 +37,7 @@ tests/cases/compiler/lambdaArgCrash.ts(29,14): error TS2345: Argument of type '( super.add(listener); ~~~~~~~~ !!! error TS2345: Argument of type '(items: ItemSet) => void' is not assignable to parameter of type '() => any'. +!!! error TS2345: Call signature '(items: ItemSet): void' expects more arguments than call signature '(): any'. } diff --git a/tests/baselines/reference/multipleInheritance.errors.txt b/tests/baselines/reference/multipleInheritance.errors.txt index c4a440d9a0ea5..1437566446b72 100644 --- a/tests/baselines/reference/multipleInheritance.errors.txt +++ b/tests/baselines/reference/multipleInheritance.errors.txt @@ -3,6 +3,7 @@ tests/cases/compiler/multipleInheritance.ts(18,21): error TS1174: Classes can on tests/cases/compiler/multipleInheritance.ts(35,12): error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. tests/cases/compiler/multipleInheritance.ts(36,12): error TS2416: Property 'g' in type 'Baad' is not assignable to the same property in base type 'Good'. Type '(n: number) => number' is not assignable to type '() => number'. + Call signature '(n: number): number' expects more arguments than call signature '(): number'. ==== tests/cases/compiler/multipleInheritance.ts (4 errors) ==== @@ -51,5 +52,6 @@ tests/cases/compiler/multipleInheritance.ts(36,12): error TS2416: Property 'g' i ~ !!! error TS2416: Property 'g' in type 'Baad' is not assignable to the same property in base type 'Good'. !!! error TS2416: Type '(n: number) => number' is not assignable to type '() => number'. +!!! error TS2416: Call signature '(n: number): number' expects more arguments than call signature '(): number'. } \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt index 41157c363eb59..f19466d8200ae 100644 --- a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt +++ b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt @@ -5,8 +5,11 @@ tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(9,4): error TS tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(10,17): error TS2345: Argument of type '{ value: string; what: number; }' is not assignable to parameter of type 'I2'. Object literal may only specify known properties, and 'what' does not exist in type 'I2'. tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(11,6): error TS2322: Type '(s: any) => any' is not assignable to type '() => string'. + Call signature '(s: any): any' expects more arguments than call signature '(): string'. tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(12,6): error TS2322: Type '(s: string) => string' is not assignable to type '() => string'. + Call signature '(s: string): string' expects more arguments than call signature '(): string'. tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(13,17): error TS2322: Type '(s: any) => any' is not assignable to type '() => string'. + Call signature '(s: any): any' expects more arguments than call signature '(): string'. ==== tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts (6 errors) ==== @@ -33,9 +36,12 @@ tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(13,17): error f2({ toString: (s) => s }) ~~~~~~~~ !!! error TS2322: Type '(s: any) => any' is not assignable to type '() => string'. +!!! error TS2322: Call signature '(s: any): any' expects more arguments than call signature '(): string'. f2({ toString: (s: string) => s }) ~~~~~~~~ !!! error TS2322: Type '(s: string) => string' is not assignable to type '() => string'. +!!! error TS2322: Call signature '(s: string): string' expects more arguments than call signature '(): string'. f2({ value: '', toString: (s) => s.uhhh }) ~~~~~~~~ -!!! error TS2322: Type '(s: any) => any' is not assignable to type '() => string'. \ No newline at end of file +!!! error TS2322: Type '(s: any) => any' is not assignable to type '() => string'. +!!! error TS2322: Call signature '(s: any): any' expects more arguments than call signature '(): string'. \ No newline at end of file diff --git a/tests/baselines/reference/parseTypes.errors.txt b/tests/baselines/reference/parseTypes.errors.txt index 8548cedc373d4..092fe2754af22 100644 --- a/tests/baselines/reference/parseTypes.errors.txt +++ b/tests/baselines/reference/parseTypes.errors.txt @@ -1,5 +1,7 @@ tests/cases/compiler/parseTypes.ts(8,1): error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. + Call signature '(s: string): void' expects more arguments than call signature '(): number'. tests/cases/compiler/parseTypes.ts(9,1): error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. + Call signature '(s: string): void' expects more arguments than call signature '(): number'. tests/cases/compiler/parseTypes.ts(10,1): error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'. Index signature for type 'number' is missing in type '(s: string) => void'. tests/cases/compiler/parseTypes.ts(11,1): error TS2322: Type '(s: string) => void' is not assignable to type 'new () => number'. @@ -17,9 +19,11 @@ tests/cases/compiler/parseTypes.ts(11,1): error TS2322: Type '(s: string) => voi y=g; ~ !!! error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. +!!! error TS2322: Call signature '(s: string): void' expects more arguments than call signature '(): number'. x=g; ~ !!! error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. +!!! error TS2322: Call signature '(s: string): void' expects more arguments than call signature '(): number'. w=g; ~ !!! error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'. diff --git a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.errors.txt b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.errors.txt index a6a4524592993..06299adec0e15 100644 --- a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.errors.txt +++ b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.errors.txt @@ -1,6 +1,9 @@ tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partiallyAnnotatedFunctionInferenceError.ts(12,11): error TS2345: Argument of type '(t1: D, t2: any, t3: any) => void' is not assignable to parameter of type '(t: any, t1: any) => void'. + Call signature '(t1: D, t2: any, t3: any): void' expects more arguments than call signature '(t: any, t1: any): void'. tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partiallyAnnotatedFunctionInferenceError.ts(13,11): error TS2345: Argument of type '(t1: any, t2: D, t3: any) => void' is not assignable to parameter of type '(t: any, t1: any) => void'. + Call signature '(t1: any, t2: D, t3: any): void' expects more arguments than call signature '(t: any, t1: any): void'. tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partiallyAnnotatedFunctionInferenceError.ts(14,11): error TS2345: Argument of type '(t1: any, t2: any, t3: D) => void' is not assignable to parameter of type '(t: any, t1: any) => void'. + Call signature '(t1: any, t2: any, t3: D): void' expects more arguments than call signature '(t: any, t1: any): void'. ==== tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partiallyAnnotatedFunctionInferenceError.ts (3 errors) ==== @@ -18,10 +21,13 @@ tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partial testError((t1: D, t2, t3) => {}) ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(t1: D, t2: any, t3: any) => void' is not assignable to parameter of type '(t: any, t1: any) => void'. +!!! error TS2345: Call signature '(t1: D, t2: any, t3: any): void' expects more arguments than call signature '(t: any, t1: any): void'. testError((t1, t2: D, t3) => {}) ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(t1: any, t2: D, t3: any) => void' is not assignable to parameter of type '(t: any, t1: any) => void'. +!!! error TS2345: Call signature '(t1: any, t2: D, t3: any): void' expects more arguments than call signature '(t: any, t1: any): void'. testError((t1, t2, t3: D) => {}) ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(t1: any, t2: any, t3: D) => void' is not assignable to parameter of type '(t: any, t1: any) => void'. +!!! error TS2345: Call signature '(t1: any, t2: any, t3: D): void' expects more arguments than call signature '(t: any, t1: any): void'. \ No newline at end of file diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index 7bc65540d1aa4..76fe0ea44c7b1 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -26,27 +26,35 @@ tests/cases/compiler/promisePermutations.ts(84,19): error TS2769: No overload ma 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'. + Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(value: string): IPromise'. 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'. + Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(value: string): IPromise'. 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'. + Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(value: string): Promise'. 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'. + Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(value: string): IPromise'. 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'. + Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: string): IPromise'. 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'. + Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: string): IPromise'. 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'. + Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: string): Promise'. 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'. + Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: string): IPromise'. 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'. @@ -68,18 +76,23 @@ tests/cases/compiler/promisePermutations.ts(111,19): error TS2769: No overload m 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'. + Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: number): IPromise'. 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'. + Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: number): IPromise'. 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'. + Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: number): Promise'. 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'. + Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: number): IPromise'. 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'. + Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(value: number): IPromise'. 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'. @@ -88,12 +101,15 @@ tests/cases/compiler/promisePermutations.ts(129,33): error TS2769: No overload m 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'. + Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(value: number): IPromise'. 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'. + Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(value: number): Promise'. 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'. + Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(value: number): IPromise'. 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'. @@ -258,6 +274,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. +!!! error TS2769: Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(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; @@ -266,18 +283,21 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. +!!! error TS2769: Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(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 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'. +!!! error TS2769: Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(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 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'. +!!! error TS2769: Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(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 @@ -287,6 +307,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. +!!! error TS2769: Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(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; @@ -295,18 +316,21 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. +!!! error TS2769: Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(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 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'. +!!! error TS2769: Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(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 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'. +!!! error TS2769: Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(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 @@ -353,6 +377,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. +!!! error TS2769: Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(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; @@ -361,18 +386,21 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. +!!! error TS2769: Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(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 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'. +!!! error TS2769: Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(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 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'. +!!! error TS2769: Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(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 @@ -382,6 +410,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. +!!! error TS2769: Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(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 @@ -400,18 +429,21 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. +!!! error TS2769: Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(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 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'. +!!! error TS2769: Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(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 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'. +!!! error TS2769: Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(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 diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index 000994163afbb..a9a486f6240f9 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -18,15 +18,23 @@ tests/cases/compiler/promisePermutations2.ts(83,19): error TS2345: Argument of t 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'. + Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(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'. + Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(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'. + Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(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'. + Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(value: string): IPromise'. 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'. + Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(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'. + Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(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'. + Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(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'. + Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: string): IPromise'. 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'. @@ -48,20 +56,28 @@ tests/cases/compiler/promisePermutations2.ts(110,19): error TS2769: No overload 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'. + Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(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'. + Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(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'. + Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(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'. + Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: number): IPromise'. 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'. + Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(value: number): IPromise'. 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'. 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'. + Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(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'. + Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(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'. + Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(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 TS2769: No overload matches this call. @@ -203,18 +219,22 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of !!! 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'. +!!! error TS2769: Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(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 ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2345: Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(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 TS2345: Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(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 TS2345: Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(value: string): IPromise'. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; @@ -223,18 +243,22 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of !!! 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'. +!!! error TS2769: Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(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 ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2345: Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(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 TS2345: Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(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 TS2345: Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: string): IPromise'. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; @@ -280,18 +304,22 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of !!! 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'. +!!! error TS2769: Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(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 ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2345: Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(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 TS2345: Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(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 TS2345: Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: number): IPromise'. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; @@ -300,6 +328,7 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of !!! 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'. +!!! error TS2769: Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(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 @@ -316,12 +345,15 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of 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 TS2345: Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(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 TS2345: Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(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 TS2345: Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(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 diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index e0c7a897ed481..45661e44dddf9 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -25,25 +25,33 @@ tests/cases/compiler/promisePermutations3.ts(83,19): error TS2769: No overload m 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'. + Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(value: string): IPromise'. 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'. + Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(value: string): IPromise'. 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'. + Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(value: string): Promise'. 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'. + Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(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'. + Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: string): IPromise'. 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'. + Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: string): IPromise'. 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'. + Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: string): Promise'. 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'. + Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(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'. @@ -55,28 +63,36 @@ 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'. + Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: number): IPromise'. 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'. + Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: number): IPromise'. 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'. + Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: number): Promise'. 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'. + Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(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'. + Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(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 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'. + Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(value: number): IPromise'. 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'. + Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(value: number): Promise'. 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'. + Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(value: number): IPromise'. 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'. @@ -237,6 +253,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of 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 TS2345: Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(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 @@ -244,18 +261,21 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! 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'. +!!! error TS2769: Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(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 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'. +!!! error TS2769: Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(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 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'. +!!! error TS2769: Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(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 @@ -263,6 +283,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of 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 TS2345: Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(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 @@ -270,18 +291,21 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! 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'. +!!! error TS2769: Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(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 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'. +!!! error TS2769: Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(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 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'. +!!! error TS2769: Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(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 @@ -314,6 +338,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of 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 TS2345: Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(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 @@ -321,18 +346,21 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! 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'. +!!! error TS2769: Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(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 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'. +!!! error TS2769: Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(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 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'. +!!! error TS2769: Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(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 @@ -340,6 +368,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of 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 TS2345: Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(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 @@ -354,18 +383,21 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! 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'. +!!! error TS2769: Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(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 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'. +!!! error TS2769: Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(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 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'. +!!! error TS2769: Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(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 diff --git a/tests/baselines/reference/requiredInitializedParameter2.errors.txt b/tests/baselines/reference/requiredInitializedParameter2.errors.txt index 278d5c0f35944..1d878cbf14df1 100644 --- a/tests/baselines/reference/requiredInitializedParameter2.errors.txt +++ b/tests/baselines/reference/requiredInitializedParameter2.errors.txt @@ -1,5 +1,6 @@ tests/cases/compiler/requiredInitializedParameter2.ts(6,5): error TS2416: Property 'method' in type 'C1' is not assignable to the same property in base type 'I1'. Type '(a: number, b: any) => void' is not assignable to type '() => any'. + Call signature '(a: number, b: any): void' expects more arguments than call signature '(): any'. ==== tests/cases/compiler/requiredInitializedParameter2.ts (1 errors) ==== @@ -12,4 +13,5 @@ tests/cases/compiler/requiredInitializedParameter2.ts(6,5): error TS2416: Proper ~~~~~~ !!! error TS2416: Property 'method' in type 'C1' is not assignable to the same property in base type 'I1'. !!! error TS2416: Type '(a: number, b: any) => void' is not assignable to type '() => any'. +!!! error TS2416: Call signature '(a: number, b: any): void' expects more arguments than call signature '(): any'. } \ No newline at end of file diff --git a/tests/baselines/reference/reverseMappedTypeContextualTypeNotCircular.errors.txt b/tests/baselines/reference/reverseMappedTypeContextualTypeNotCircular.errors.txt index d5462d0d0b7dc..1c2b6d0dd3e5b 100644 --- a/tests/baselines/reference/reverseMappedTypeContextualTypeNotCircular.errors.txt +++ b/tests/baselines/reference/reverseMappedTypeContextualTypeNotCircular.errors.txt @@ -1,4 +1,5 @@ tests/cases/compiler/reverseMappedTypeContextualTypeNotCircular.ts(10,3): error TS2322: Type '(state: any, props: any) => {}' is not assignable to type 'Selector'. + Call signature '(state: any, props: any): {}' expects more arguments than call signature '(state: unknown): {}'. ==== tests/cases/compiler/reverseMappedTypeContextualTypeNotCircular.ts (1 errors) ==== @@ -14,5 +15,6 @@ tests/cases/compiler/reverseMappedTypeContextualTypeNotCircular.ts(10,3): error editable: (state: any, props: any) => editable(), // expect "Type '(state: any, props: any) => {}' is not assignable to type 'Selector'", _not_ a circularity error ~~~~~~~~ !!! error TS2322: Type '(state: any, props: any) => {}' is not assignable to type 'Selector'. +!!! error TS2322: Call signature '(state: any, props: any): {}' expects more arguments than call signature '(state: unknown): {}'. !!! related TS6500 tests/cases/compiler/reverseMappedTypeContextualTypeNotCircular.ts:10:3: The expected type comes from property 'editable' which is declared here on type '{ editable: Selector; }' }); \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt index b5d23da2241eb..51ce8fd589c2e 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt @@ -1,9 +1,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts(19,11): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. Types of property 'a' are incompatible. Type '(x: number) => number' is not assignable to type '() => number'. + Call signature '(x: number): number' expects more arguments than call signature '(): number'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts(49,11): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. Types of property 'a3' are incompatible. Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. + Call signature '(x: number, y: number): number' expects more arguments than call signature '(x: number): number'. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts (2 errors) ==== @@ -30,6 +32,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type '(x: number) => number' is not assignable to type '() => number'. +!!! error TS2430: Call signature '(x: number): number' expects more arguments than call signature '(): number'. a: (x: number) => number; // error, too many required params } @@ -64,6 +67,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. +!!! error TS2430: Call signature '(x: number, y: number): number' expects more arguments than call signature '(x: number): number'. a3: (x: number, y: number) => number; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt index e041b1cdce0e4..95a723898ee6a 100644 --- a/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt @@ -1,9 +1,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts(19,11): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. Types of property 'a' are incompatible. Type 'new (x: number) => number' is not assignable to type 'new () => number'. + Construct signature '(x: number): number' expects more arguments than construct signature '(): number'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts(49,11): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. Types of property 'a3' are incompatible. Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. + Construct signature '(x: number, y: number): number' expects more arguments than construct signature '(x: number): number'. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts (2 errors) ==== @@ -30,6 +32,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type 'new (x: number) => number' is not assignable to type 'new () => number'. +!!! error TS2430: Construct signature '(x: number): number' expects more arguments than construct signature '(): number'. a: new (x: number) => number; // error, too many required params } @@ -64,6 +67,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. +!!! error TS2430: Construct signature '(x: number, y: number): number' expects more arguments than construct signature '(x: number): number'. a3: new (x: number, y: number) => number; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt index b9d5dc7ae8b1e..988a432423cc3 100644 --- a/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt @@ -1,9 +1,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(20,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. Types of property 'a' are incompatible. Type '(x: T) => T' is not assignable to type '() => T'. + Call signature '(x: T): T' expects more arguments than call signature '(): T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(50,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. Types of property 'a3' are incompatible. Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. + Call signature '(x: T, y: T): T' expects more arguments than call signature '(x: T): T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(100,15): error TS2430: Interface 'I1' incorrectly extends interface 'Base2'. The types returned by 'a()' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -15,6 +17,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(108,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. Type '(x: T) => T' is not assignable to type '() => T'. + Call signature '(x: T): T' expects more arguments than call signature '(): T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(113,15): error TS2430: Interface 'I4' incorrectly extends interface 'Base2'. The types returned by 'a2(...)' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -50,6 +53,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(138,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. Types of property 'a3' are incompatible. Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. + Call signature '(x: T, y: T): T' expects more arguments than call signature '(x: T): T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(143,15): error TS2430: Interface 'I11' incorrectly extends interface 'Base2'. The types returned by 'a4(...)' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -97,9 +101,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(196,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. Type '(x: T) => T' is not assignable to type '() => T'. + Call signature '(x: T): T' expects more arguments than call signature '(): T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(226,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. Types of property 'a3' are incompatible. Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. + Call signature '(x: T, y: T): T' expects more arguments than call signature '(x: T): T'. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts (22 errors) ==== @@ -127,6 +133,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type '(x: T) => T' is not assignable to type '() => T'. +!!! error TS2430: Call signature '(x: T): T' expects more arguments than call signature '(): T'. a: (x: T) => T; // error, too many required params } @@ -161,6 +168,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. +!!! error TS2430: Call signature '(x: T, y: T): T' expects more arguments than call signature '(x: T): T'. a3: (x: T, y: T) => T; // error, too many required params } @@ -235,6 +243,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type '(x: T) => T' is not assignable to type '() => T'. +!!! error TS2430: Call signature '(x: T): T' expects more arguments than call signature '(): T'. a: (x: T) => T; } @@ -313,6 +322,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. +!!! error TS2430: Call signature '(x: T, y: T): T' expects more arguments than call signature '(x: T): T'. a3: (x: T, y: T) => T; } @@ -435,6 +445,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type '(x: T) => T' is not assignable to type '() => T'. +!!! error TS2430: Call signature '(x: T): T' expects more arguments than call signature '(): T'. a: (x: T) => T; // error, not identical and contextual signature instatiation can't make inference from T to T } @@ -469,6 +480,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. +!!! error TS2430: Call signature '(x: T, y: T): T' expects more arguments than call signature '(x: T): T'. a3: (x: T, y: T) => T; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt index 3324928c05c00..db9d0754ae8fc 100644 --- a/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt @@ -1,9 +1,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(20,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. Types of property 'a' are incompatible. Type 'new (x: T) => T' is not assignable to type 'new () => T'. + Construct signature '(x: T): T' expects more arguments than construct signature '(): T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(50,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. Types of property 'a3' are incompatible. Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. + Construct signature '(x: T, y: T): T' expects more arguments than construct signature '(x: T): T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(100,15): error TS2430: Interface 'I1' incorrectly extends interface 'Base2'. The types returned by 'new a()' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -15,6 +17,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(108,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. Type 'new (x: T) => T' is not assignable to type 'new () => T'. + Construct signature '(x: T): T' expects more arguments than construct signature '(): T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(113,15): error TS2430: Interface 'I4' incorrectly extends interface 'Base2'. The types returned by 'new a2(...)' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -50,6 +53,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(138,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. Types of property 'a3' are incompatible. Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. + Construct signature '(x: T, y: T): T' expects more arguments than construct signature '(x: T): T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(143,15): error TS2430: Interface 'I11' incorrectly extends interface 'Base2'. The types returned by 'new a4(...)' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -97,9 +101,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(196,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. Type 'new (x: T) => T' is not assignable to type 'new () => T'. + Construct signature '(x: T): T' expects more arguments than construct signature '(): T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(226,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. Types of property 'a3' are incompatible. Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. + Construct signature '(x: T, y: T): T' expects more arguments than construct signature '(x: T): T'. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts (22 errors) ==== @@ -127,6 +133,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new () => T'. +!!! error TS2430: Construct signature '(x: T): T' expects more arguments than construct signature '(): T'. a: new (x: T) => T; // error, too many required params } @@ -161,6 +168,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. +!!! error TS2430: Construct signature '(x: T, y: T): T' expects more arguments than construct signature '(x: T): T'. a3: new (x: T, y: T) => T; // error, too many required params } @@ -235,6 +243,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new () => T'. +!!! error TS2430: Construct signature '(x: T): T' expects more arguments than construct signature '(): T'. a: new (x: T) => T; } @@ -313,6 +322,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. +!!! error TS2430: Construct signature '(x: T, y: T): T' expects more arguments than construct signature '(x: T): T'. a3: new (x: T, y: T) => T; } @@ -435,6 +445,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new () => T'. +!!! error TS2430: Construct signature '(x: T): T' expects more arguments than construct signature '(): T'. a: new (x: T) => T; // error, not identical and contextual signature instatiation can't make inference from T to T } @@ -469,6 +480,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. +!!! error TS2430: Construct signature '(x: T, y: T): T' expects more arguments than construct signature '(x: T): T'. a3: new (x: T, y: T) => T; // error, too many required params } diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt index f3ce91abd95ea..90a56dab7b3d6 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt @@ -5,6 +5,7 @@ tests/cases/conformance/jsx/file.tsx(8,15): error TS2322: Type 'T & { "ignore-pr tests/cases/conformance/jsx/file.tsx(13,15): error TS2322: Type 'T' is not assignable to type 'IntrinsicAttributes & { prop: unknown; "ignore-prop": string; }'. Type 'T' is not assignable to type '{ prop: unknown; "ignore-prop": string; }'. tests/cases/conformance/jsx/file.tsx(20,19): error TS2322: Type '(a: number, b: string) => void' is not assignable to type '(arg: number) => void'. + Call signature '(a: number, b: string): void' expects more arguments than call signature '(arg: number): void'. tests/cases/conformance/jsx/file.tsx(31,52): error TS2322: Type '(val: string) => void' is not assignable to type '(selectedVal: number) => void'. Types of parameters 'val' and 'selectedVal' are incompatible. Type 'number' is not assignable to type 'string'. @@ -43,6 +44,7 @@ tests/cases/conformance/jsx/file.tsx(31,52): error TS2322: Type '(val: string) = let o = ~~~~ !!! error TS2322: Type '(a: number, b: string) => void' is not assignable to type '(arg: number) => void'. +!!! error TS2322: Call signature '(a: number, b: string): void' expects more arguments than call signature '(arg: number): void'. !!! related TS6500 tests/cases/conformance/jsx/file.tsx:16:30: The expected type comes from property 'func' which is declared here on type 'IntrinsicAttributes & { func: (arg: number) => void; }' } diff --git a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt index df739464ffea5..d0fbe472215e0 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt +++ b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt @@ -27,6 +27,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(84,1): Type predicate 'p2 is A' is not assignable to 'p1 is A'. Parameter 'p2' is not in the same position as parameter 'p1'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(90,1): error TS2322: Type '(p1: any, p2: any, p3: any) => p1 is A' is not assignable to type '(p1: any, p2: any) => p1 is A'. + Call signature '(p1: any, p2: any, p3: any): p1 is A' expects more arguments than call signature '(p1: any, p2: any): p1 is A'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(95,9): error TS2749: 'b' refers to a value, but is being used as a type here. Did you mean 'typeof b'? tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(95,11): error TS1005: ',' expected. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(95,14): error TS1005: ',' expected. @@ -211,6 +212,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(166,54 assign3 = function(p1, p2, p3): p1 is A { ~~~~~~~ !!! error TS2322: Type '(p1: any, p2: any, p3: any) => p1 is A' is not assignable to type '(p1: any, p2: any) => p1 is A'. +!!! error TS2322: Call signature '(p1: any, p2: any, p3: any): p1 is A' expects more arguments than call signature '(p1: any, p2: any): p1 is A'. return true; }; From eedd56dde15174b2daf147e74c568d66ee2c7cf8 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Thu, 10 Nov 2022 11:16:03 -0800 Subject: [PATCH 04/12] Revert "differentiate between call and construct" This reverts commit a75e9abbdeb5404466f92f047da4976ca8e023c1. --- src/compiler/checker.ts | 18 +++++++-------- src/compiler/diagnosticMessages.json | 4 ---- ...ignatureLengthMismatchConstruct.errors.txt | 22 ------------------- .../signatureLengthMismatchConstruct.js | 22 ------------------- .../signatureLengthMismatchConstruct.symbols | 21 ------------------ .../signatureLengthMismatchConstruct.types | 22 ------------------- .../signatureLengthMismatchConstruct.ts | 9 -------- 7 files changed, 8 insertions(+), 110 deletions(-) delete mode 100644 tests/baselines/reference/signatureLengthMismatchConstruct.errors.txt delete mode 100644 tests/baselines/reference/signatureLengthMismatchConstruct.js delete mode 100644 tests/baselines/reference/signatureLengthMismatchConstruct.symbols delete mode 100644 tests/baselines/reference/signatureLengthMismatchConstruct.types delete mode 100644 tests/cases/compiler/signatureLengthMismatchConstruct.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 78e27f32874f0..f28621b76c547 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -18442,7 +18442,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { target: Signature, ignoreReturnTypes: boolean): boolean { return compareSignaturesRelated(source, target, ignoreReturnTypes ? SignatureCheckMode.IgnoreReturnTypes : 0, /*reportErrors*/ false, - /*errorReporter*/ undefined, /*incompatibleErrorReporter*/ undefined, /*signatureKindForErrors*/ undefined, compareTypesAssignable, /*reportUnreliableMarkers*/ undefined) !== Ternary.False; + /*errorReporter*/ undefined, /*errorReporter*/ undefined, compareTypesAssignable, /*reportUnreliableMarkers*/ undefined) !== Ternary.False; } type ErrorReporter = (message: DiagnosticMessage, arg0?: string, arg1?: string) => void; @@ -18465,7 +18465,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { reportErrors: boolean, errorReporter: ErrorReporter | undefined, incompatibleErrorReporter: ((source: Type, target: Type) => void) | undefined, - signatureKindForErrors: SignatureKind | undefined, compareTypes: TypeComparer, reportUnreliableMarkers: TypeMapper | undefined): Ternary { // TODO (drosen): De-duplicate code between related functions. @@ -18482,8 +18481,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { (checkMode & SignatureCheckMode.StrictArity ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount); if (sourceHasMoreParameters) { if (reportErrors) { - const diagnostic = signatureKindForErrors! === SignatureKind.Call ? Diagnostics.Call_signature_0_expects_more_arguments_than_call_signature_1 : Diagnostics.Construct_signature_0_expects_more_arguments_than_construct_signature_1; - errorReporter!(diagnostic, signatureToString(source), signatureToString(target)); + errorReporter!(Diagnostics.Call_signature_0_expects_more_arguments_than_call_signature_1, signatureToString(source), signatureToString(target)); } return Ternary.False; } @@ -18542,7 +18540,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && (getTypeFacts(sourceType) & TypeFacts.IsUndefinedOrNull) === (getTypeFacts(targetType) & TypeFacts.IsUndefinedOrNull); let related = callbacks ? - compareSignaturesRelated(targetSig, sourceSig, (checkMode & SignatureCheckMode.StrictArity) | (strictVariance ? SignatureCheckMode.StrictCallback : SignatureCheckMode.BivariantCallback), reportErrors, errorReporter, incompatibleErrorReporter, signatureKindForErrors, compareTypes, reportUnreliableMarkers) : + compareSignaturesRelated(targetSig, sourceSig, (checkMode & SignatureCheckMode.StrictArity) | (strictVariance ? SignatureCheckMode.StrictCallback : SignatureCheckMode.BivariantCallback), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : !(checkMode & SignatureCheckMode.Callback) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors); // With strict arity, (x: number | undefined) => void is a subtype of (x?: number | undefined) => void if (related && checkMode & SignatureCheckMode.StrictArity && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes(sourceType, targetType, /*reportErrors*/ false)) { @@ -20916,7 +20914,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // of the much more expensive N * M comparison matrix we explore below. We erase type parameters // as they are known to always be the same. for (let i = 0; i < targetSignatures.length; i++) { - const related = signatureRelatedTo(sourceSignatures[i], targetSignatures[i], /*erase*/ true, reportErrors, incompatibleReporter(sourceSignatures[i], targetSignatures[i]), kind); + const related = signatureRelatedTo(sourceSignatures[i], targetSignatures[i], /*erase*/ true, reportErrors, incompatibleReporter(sourceSignatures[i], targetSignatures[i])); if (!related) { return Ternary.False; } @@ -20932,7 +20930,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const eraseGenerics = relation === comparableRelation || !!compilerOptions.noStrictGenericChecks; const sourceSignature = first(sourceSignatures); const targetSignature = first(targetSignatures); - result = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors, incompatibleReporter(sourceSignature, targetSignature), kind); + result = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors, incompatibleReporter(sourceSignature, targetSignature)); if (!result && reportErrors && kind === SignatureKind.Construct && (sourceObjectFlags & targetObjectFlags) && (targetSignature.declaration?.kind === SyntaxKind.Constructor || sourceSignature.declaration?.kind === SyntaxKind.Constructor)) { const constructSignatureToString = (signature: Signature) => @@ -20948,7 +20946,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // Only elaborate errors from the first failure let shouldElaborateErrors = reportErrors; for (const s of sourceSignatures) { - const related = signatureRelatedTo(s, t, /*erase*/ true, shouldElaborateErrors, incompatibleReporter(s, t), kind); + const related = signatureRelatedTo(s, t, /*erase*/ true, shouldElaborateErrors, incompatibleReporter(s, t)); if (related) { result &= related; resetErrorInfo(saveErrorInfo); @@ -20998,9 +20996,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { /** * See signatureAssignableTo, compareSignaturesIdentical */ - function signatureRelatedTo(source: Signature, target: Signature, erase: boolean, reportErrors: boolean, incompatibleReporter: (source: Type, target: Type) => void, signatureKind: SignatureKind): Ternary { + function signatureRelatedTo(source: Signature, target: Signature, erase: boolean, reportErrors: boolean, incompatibleReporter: (source: Type, target: Type) => void): Ternary { return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, - relation === strictSubtypeRelation ? SignatureCheckMode.StrictArity : 0, reportErrors, reportError, incompatibleReporter, signatureKind, isRelatedToWorker, reportUnreliableMapper); + relation === strictSubtypeRelation ? SignatureCheckMode.StrictArity : 0, reportErrors, reportError, incompatibleReporter, isRelatedToWorker, reportUnreliableMapper); } function signaturesIdenticalTo(source: Type, target: Type, kind: SignatureKind): Ternary { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 2d7c5748cd8a5..fe844801d28a2 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3567,10 +3567,6 @@ "category": "Error", "code": 2846 }, - "Construct signature '{0}' expects more arguments than construct signature '{1}'.": { - "category": "Error", - "code": 2847 - }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/tests/baselines/reference/signatureLengthMismatchConstruct.errors.txt b/tests/baselines/reference/signatureLengthMismatchConstruct.errors.txt deleted file mode 100644 index 6ce61dde789ba..0000000000000 --- a/tests/baselines/reference/signatureLengthMismatchConstruct.errors.txt +++ /dev/null @@ -1,22 +0,0 @@ -tests/cases/compiler/signatureLengthMismatchConstruct.ts(9,15): error TS2345: Argument of type 'typeof OverlongCtor' is not assignable to parameter of type 'new (a: number) => void'. - Types of construct signatures are incompatible. - Type 'new (a: number, b: number) => OverlongCtor' is not assignable to type 'new (a: number) => void'. - Construct signature '(a: number, b: number): OverlongCtor' expects more arguments than construct signature '(a: number): void'. - - -==== tests/cases/compiler/signatureLengthMismatchConstruct.ts (1 errors) ==== - function takesCallback(fn: new (a: number) => void) { - // ... - } - - class OverlongCtor { - constructor(a: number, b: number) {} - } - - takesCallback(OverlongCtor); - ~~~~~~~~~~~~ -!!! error TS2345: Argument of type 'typeof OverlongCtor' is not assignable to parameter of type 'new (a: number) => void'. -!!! error TS2345: Types of construct signatures are incompatible. -!!! error TS2345: Type 'new (a: number, b: number) => OverlongCtor' is not assignable to type 'new (a: number) => void'. -!!! error TS2345: Construct signature '(a: number, b: number): OverlongCtor' expects more arguments than construct signature '(a: number): void'. - \ No newline at end of file diff --git a/tests/baselines/reference/signatureLengthMismatchConstruct.js b/tests/baselines/reference/signatureLengthMismatchConstruct.js deleted file mode 100644 index ad05c7245feb6..0000000000000 --- a/tests/baselines/reference/signatureLengthMismatchConstruct.js +++ /dev/null @@ -1,22 +0,0 @@ -//// [signatureLengthMismatchConstruct.ts] -function takesCallback(fn: new (a: number) => void) { - // ... -} - -class OverlongCtor { - constructor(a: number, b: number) {} -} - -takesCallback(OverlongCtor); - - -//// [signatureLengthMismatchConstruct.js] -function takesCallback(fn) { - // ... -} -var OverlongCtor = /** @class */ (function () { - function OverlongCtor(a, b) { - } - return OverlongCtor; -}()); -takesCallback(OverlongCtor); diff --git a/tests/baselines/reference/signatureLengthMismatchConstruct.symbols b/tests/baselines/reference/signatureLengthMismatchConstruct.symbols deleted file mode 100644 index 277b8c4234510..0000000000000 --- a/tests/baselines/reference/signatureLengthMismatchConstruct.symbols +++ /dev/null @@ -1,21 +0,0 @@ -=== tests/cases/compiler/signatureLengthMismatchConstruct.ts === -function takesCallback(fn: new (a: number) => void) { ->takesCallback : Symbol(takesCallback, Decl(signatureLengthMismatchConstruct.ts, 0, 0)) ->fn : Symbol(fn, Decl(signatureLengthMismatchConstruct.ts, 0, 23)) ->a : Symbol(a, Decl(signatureLengthMismatchConstruct.ts, 0, 32)) - - // ... -} - -class OverlongCtor { ->OverlongCtor : Symbol(OverlongCtor, Decl(signatureLengthMismatchConstruct.ts, 2, 1)) - - constructor(a: number, b: number) {} ->a : Symbol(a, Decl(signatureLengthMismatchConstruct.ts, 5, 14)) ->b : Symbol(b, Decl(signatureLengthMismatchConstruct.ts, 5, 24)) -} - -takesCallback(OverlongCtor); ->takesCallback : Symbol(takesCallback, Decl(signatureLengthMismatchConstruct.ts, 0, 0)) ->OverlongCtor : Symbol(OverlongCtor, Decl(signatureLengthMismatchConstruct.ts, 2, 1)) - diff --git a/tests/baselines/reference/signatureLengthMismatchConstruct.types b/tests/baselines/reference/signatureLengthMismatchConstruct.types deleted file mode 100644 index 42021b98fe30c..0000000000000 --- a/tests/baselines/reference/signatureLengthMismatchConstruct.types +++ /dev/null @@ -1,22 +0,0 @@ -=== tests/cases/compiler/signatureLengthMismatchConstruct.ts === -function takesCallback(fn: new (a: number) => void) { ->takesCallback : (fn: new (a: number) => void) => void ->fn : new (a: number) => void ->a : number - - // ... -} - -class OverlongCtor { ->OverlongCtor : OverlongCtor - - constructor(a: number, b: number) {} ->a : number ->b : number -} - -takesCallback(OverlongCtor); ->takesCallback(OverlongCtor) : void ->takesCallback : (fn: new (a: number) => void) => void ->OverlongCtor : typeof OverlongCtor - diff --git a/tests/cases/compiler/signatureLengthMismatchConstruct.ts b/tests/cases/compiler/signatureLengthMismatchConstruct.ts deleted file mode 100644 index 8ef950ea9cea6..0000000000000 --- a/tests/cases/compiler/signatureLengthMismatchConstruct.ts +++ /dev/null @@ -1,9 +0,0 @@ -function takesCallback(fn: new (a: number) => void) { - // ... -} - -class OverlongCtor { - constructor(a: number, b: number) {} -} - -takesCallback(OverlongCtor); From 926c44a333f418e4b30f41c0e10521e6ac6ebd76 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Thu, 10 Nov 2022 11:46:38 -0800 Subject: [PATCH 05/12] update error message per feedback --- src/compiler/checker.ts | 5 +++-- src/compiler/diagnosticMessages.json | 2 +- .../reference/signatureLengthMismatchCall.errors.txt | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f28621b76c547..2e58b779eb451 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -18445,7 +18445,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { /*errorReporter*/ undefined, /*errorReporter*/ undefined, compareTypesAssignable, /*reportUnreliableMarkers*/ undefined) !== Ternary.False; } - type ErrorReporter = (message: DiagnosticMessage, arg0?: string, arg1?: string) => void; + type ErrorReporter = (message: DiagnosticMessage, arg0?: string | number, arg1?: string | number) => void; /** * Returns true if `s` is `(...args: any[]) => any` or `(this: any, ...args: any[]) => any` @@ -18481,7 +18481,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { (checkMode & SignatureCheckMode.StrictArity ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount); if (sourceHasMoreParameters) { if (reportErrors) { - errorReporter!(Diagnostics.Call_signature_0_expects_more_arguments_than_call_signature_1, signatureToString(source), signatureToString(target)); + Debug.assert(!(checkMode & SignatureCheckMode.StrictArity), "no error reporting when comparing signatures by strict arity, which is only done for subtype reduction"); + errorReporter!(Diagnostics.The_source_signature_requires_more_arguments_0_than_are_provided_by_the_target_1, getMinArgumentCount(source), targetCount.toString()); } return Ternary.False; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index fe844801d28a2..5a618d6bb9f0f 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3563,7 +3563,7 @@ "category": "Error", "code": 2845 }, - "Call signature '{0}' expects more arguments than call signature '{1}'.": { + "The source signature requires more arguments ({0}) than are provided by the target ({1}).": { "category": "Error", "code": 2846 }, diff --git a/tests/baselines/reference/signatureLengthMismatchCall.errors.txt b/tests/baselines/reference/signatureLengthMismatchCall.errors.txt index eea54fcff92c0..c37fb27d744ff 100644 --- a/tests/baselines/reference/signatureLengthMismatchCall.errors.txt +++ b/tests/baselines/reference/signatureLengthMismatchCall.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/signatureLengthMismatchCall.ts(5,15): error TS2345: Argument of type '(a: number, b: number) => void' is not assignable to parameter of type '(a: number) => void'. - Call signature '(a: number, b: number): void' expects more arguments than call signature '(a: number): void'. + The source signature requires more arguments (2) than are provided by the target (1). ==== tests/cases/compiler/signatureLengthMismatchCall.ts (1 errors) ==== @@ -10,5 +10,5 @@ tests/cases/compiler/signatureLengthMismatchCall.ts(5,15): error TS2345: Argumen takesCallback((a: number, b: number) => {}); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(a: number, b: number) => void' is not assignable to parameter of type '(a: number) => void'. -!!! error TS2345: Call signature '(a: number, b: number): void' expects more arguments than call signature '(a: number): void'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). \ No newline at end of file From 0de6f19daaadd318cefc5ce183122cb65e589231 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Thu, 10 Nov 2022 11:51:50 -0800 Subject: [PATCH 06/12] add more tests --- ...gnatureLengthMismatchInOverload.errors.txt | 27 +++++++++++++++++++ .../signatureLengthMismatchInOverload.js | 11 ++++++++ .../signatureLengthMismatchInOverload.symbols | 21 +++++++++++++++ .../signatureLengthMismatchInOverload.types | 23 ++++++++++++++++ ...hMismatchWithOptionalParameters.errors.txt | 14 ++++++++++ ...ureLengthMismatchWithOptionalParameters.js | 12 +++++++++ ...ngthMismatchWithOptionalParameters.symbols | 15 +++++++++++ ...LengthMismatchWithOptionalParameters.types | 16 +++++++++++ .../signatureLengthMismatchInOverload.ts | 5 ++++ ...ureLengthMismatchWithOptionalParameters.ts | 5 ++++ 10 files changed, 149 insertions(+) create mode 100644 tests/baselines/reference/signatureLengthMismatchInOverload.errors.txt create mode 100644 tests/baselines/reference/signatureLengthMismatchInOverload.js create mode 100644 tests/baselines/reference/signatureLengthMismatchInOverload.symbols create mode 100644 tests/baselines/reference/signatureLengthMismatchInOverload.types create mode 100644 tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.errors.txt create mode 100644 tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.js create mode 100644 tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.symbols create mode 100644 tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.types create mode 100644 tests/cases/compiler/signatureLengthMismatchInOverload.ts create mode 100644 tests/cases/compiler/signatureLengthMismatchWithOptionalParameters.ts diff --git a/tests/baselines/reference/signatureLengthMismatchInOverload.errors.txt b/tests/baselines/reference/signatureLengthMismatchInOverload.errors.txt new file mode 100644 index 0000000000000..56830e6d63153 --- /dev/null +++ b/tests/baselines/reference/signatureLengthMismatchInOverload.errors.txt @@ -0,0 +1,27 @@ +tests/cases/compiler/signatureLengthMismatchInOverload.ts(5,3): error TS2769: No overload matches this call. + Overload 1 of 2, '(callback: (arg: string, arg2: string) => void): void', gave the following error. + Argument of type '(arg: number, arg2: number) => void' is not assignable to parameter of type '(arg: string, arg2: string) => void'. + Types of parameters 'arg' and 'arg' are incompatible. + Type 'string' is not assignable to type 'number'. + Overload 2 of 2, '(callback: (arg: number) => void): void', gave the following error. + Argument of type '(arg: number, arg2: number) => void' is not assignable to parameter of type '(arg: number) => void'. + The source signature requires more arguments (2) than are provided by the target (1). + + +==== tests/cases/compiler/signatureLengthMismatchInOverload.ts (1 errors) ==== + function f(callback: (arg: string, arg2: string) => void): void; + function f(callback: (arg: number) => void): void; + function f(callback: unknown) { } + + f((arg: number, arg2: number) => {}); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(callback: (arg: string, arg2: string) => void): void', gave the following error. +!!! error TS2769: Argument of type '(arg: number, arg2: number) => void' is not assignable to parameter of type '(arg: string, arg2: string) => void'. +!!! error TS2769: Types of parameters 'arg' and 'arg' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! error TS2769: Overload 2 of 2, '(callback: (arg: number) => void): void', gave the following error. +!!! error TS2769: Argument of type '(arg: number, arg2: number) => void' is not assignable to parameter of type '(arg: number) => void'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! related TS2793 tests/cases/compiler/signatureLengthMismatchInOverload.ts:3:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + \ No newline at end of file diff --git a/tests/baselines/reference/signatureLengthMismatchInOverload.js b/tests/baselines/reference/signatureLengthMismatchInOverload.js new file mode 100644 index 0000000000000..ab074b66fb21d --- /dev/null +++ b/tests/baselines/reference/signatureLengthMismatchInOverload.js @@ -0,0 +1,11 @@ +//// [signatureLengthMismatchInOverload.ts] +function f(callback: (arg: string, arg2: string) => void): void; +function f(callback: (arg: number) => void): void; +function f(callback: unknown) { } + +f((arg: number, arg2: number) => {}); + + +//// [signatureLengthMismatchInOverload.js] +function f(callback) { } +f(function (arg, arg2) { }); diff --git a/tests/baselines/reference/signatureLengthMismatchInOverload.symbols b/tests/baselines/reference/signatureLengthMismatchInOverload.symbols new file mode 100644 index 0000000000000..1b69b24450f2b --- /dev/null +++ b/tests/baselines/reference/signatureLengthMismatchInOverload.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/signatureLengthMismatchInOverload.ts === +function f(callback: (arg: string, arg2: string) => void): void; +>f : Symbol(f, Decl(signatureLengthMismatchInOverload.ts, 0, 0), Decl(signatureLengthMismatchInOverload.ts, 0, 64), Decl(signatureLengthMismatchInOverload.ts, 1, 50)) +>callback : Symbol(callback, Decl(signatureLengthMismatchInOverload.ts, 0, 11)) +>arg : Symbol(arg, Decl(signatureLengthMismatchInOverload.ts, 0, 22)) +>arg2 : Symbol(arg2, Decl(signatureLengthMismatchInOverload.ts, 0, 34)) + +function f(callback: (arg: number) => void): void; +>f : Symbol(f, Decl(signatureLengthMismatchInOverload.ts, 0, 0), Decl(signatureLengthMismatchInOverload.ts, 0, 64), Decl(signatureLengthMismatchInOverload.ts, 1, 50)) +>callback : Symbol(callback, Decl(signatureLengthMismatchInOverload.ts, 1, 11)) +>arg : Symbol(arg, Decl(signatureLengthMismatchInOverload.ts, 1, 22)) + +function f(callback: unknown) { } +>f : Symbol(f, Decl(signatureLengthMismatchInOverload.ts, 0, 0), Decl(signatureLengthMismatchInOverload.ts, 0, 64), Decl(signatureLengthMismatchInOverload.ts, 1, 50)) +>callback : Symbol(callback, Decl(signatureLengthMismatchInOverload.ts, 2, 11)) + +f((arg: number, arg2: number) => {}); +>f : Symbol(f, Decl(signatureLengthMismatchInOverload.ts, 0, 0), Decl(signatureLengthMismatchInOverload.ts, 0, 64), Decl(signatureLengthMismatchInOverload.ts, 1, 50)) +>arg : Symbol(arg, Decl(signatureLengthMismatchInOverload.ts, 4, 3)) +>arg2 : Symbol(arg2, Decl(signatureLengthMismatchInOverload.ts, 4, 15)) + diff --git a/tests/baselines/reference/signatureLengthMismatchInOverload.types b/tests/baselines/reference/signatureLengthMismatchInOverload.types new file mode 100644 index 0000000000000..5d02681f32857 --- /dev/null +++ b/tests/baselines/reference/signatureLengthMismatchInOverload.types @@ -0,0 +1,23 @@ +=== tests/cases/compiler/signatureLengthMismatchInOverload.ts === +function f(callback: (arg: string, arg2: string) => void): void; +>f : { (callback: (arg: string, arg2: string) => void): void; (callback: (arg: number) => void): void; } +>callback : (arg: string, arg2: string) => void +>arg : string +>arg2 : string + +function f(callback: (arg: number) => void): void; +>f : { (callback: (arg: string, arg2: string) => void): void; (callback: (arg: number) => void): void; } +>callback : (arg: number) => void +>arg : number + +function f(callback: unknown) { } +>f : { (callback: (arg: string, arg2: string) => void): void; (callback: (arg: number) => void): void; } +>callback : unknown + +f((arg: number, arg2: number) => {}); +>f((arg: number, arg2: number) => {}) : void +>f : { (callback: (arg: string, arg2: string) => void): void; (callback: (arg: number) => void): void; } +>(arg: number, arg2: number) => {} : (arg: number, arg2: number) => void +>arg : number +>arg2 : number + diff --git a/tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.errors.txt b/tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.errors.txt new file mode 100644 index 0000000000000..da2640380cf44 --- /dev/null +++ b/tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.errors.txt @@ -0,0 +1,14 @@ +tests/cases/compiler/signatureLengthMismatchWithOptionalParameters.ts(5,8): error TS2345: Argument of type '(n: number, m: string) => void' is not assignable to parameter of type '(n?: number) => void'. + The source signature requires more arguments (2) than are provided by the target (1). + + +==== tests/cases/compiler/signatureLengthMismatchWithOptionalParameters.ts (1 errors) ==== + function callee(n: number | undefined, m: string) { } + + function caller(arg: (n?: number) => void) { } + + caller(callee); + ~~~~~~ +!!! error TS2345: Argument of type '(n: number, m: string) => void' is not assignable to parameter of type '(n?: number) => void'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). + \ No newline at end of file diff --git a/tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.js b/tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.js new file mode 100644 index 0000000000000..a23f65e25643b --- /dev/null +++ b/tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.js @@ -0,0 +1,12 @@ +//// [signatureLengthMismatchWithOptionalParameters.ts] +function callee(n: number | undefined, m: string) { } + +function caller(arg: (n?: number) => void) { } + +caller(callee); + + +//// [signatureLengthMismatchWithOptionalParameters.js] +function callee(n, m) { } +function caller(arg) { } +caller(callee); diff --git a/tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.symbols b/tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.symbols new file mode 100644 index 0000000000000..c26c1a7c17158 --- /dev/null +++ b/tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/signatureLengthMismatchWithOptionalParameters.ts === +function callee(n: number | undefined, m: string) { } +>callee : Symbol(callee, Decl(signatureLengthMismatchWithOptionalParameters.ts, 0, 0)) +>n : Symbol(n, Decl(signatureLengthMismatchWithOptionalParameters.ts, 0, 16)) +>m : Symbol(m, Decl(signatureLengthMismatchWithOptionalParameters.ts, 0, 38)) + +function caller(arg: (n?: number) => void) { } +>caller : Symbol(caller, Decl(signatureLengthMismatchWithOptionalParameters.ts, 0, 53)) +>arg : Symbol(arg, Decl(signatureLengthMismatchWithOptionalParameters.ts, 2, 16)) +>n : Symbol(n, Decl(signatureLengthMismatchWithOptionalParameters.ts, 2, 22)) + +caller(callee); +>caller : Symbol(caller, Decl(signatureLengthMismatchWithOptionalParameters.ts, 0, 53)) +>callee : Symbol(callee, Decl(signatureLengthMismatchWithOptionalParameters.ts, 0, 0)) + diff --git a/tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.types b/tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.types new file mode 100644 index 0000000000000..47cbcc1cc4d17 --- /dev/null +++ b/tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/signatureLengthMismatchWithOptionalParameters.ts === +function callee(n: number | undefined, m: string) { } +>callee : (n: number | undefined, m: string) => void +>n : number +>m : string + +function caller(arg: (n?: number) => void) { } +>caller : (arg: (n?: number) => void) => void +>arg : (n?: number) => void +>n : number + +caller(callee); +>caller(callee) : void +>caller : (arg: (n?: number) => void) => void +>callee : (n: number, m: string) => void + diff --git a/tests/cases/compiler/signatureLengthMismatchInOverload.ts b/tests/cases/compiler/signatureLengthMismatchInOverload.ts new file mode 100644 index 0000000000000..cd63db64b39b4 --- /dev/null +++ b/tests/cases/compiler/signatureLengthMismatchInOverload.ts @@ -0,0 +1,5 @@ +function f(callback: (arg: string, arg2: string) => void): void; +function f(callback: (arg: number) => void): void; +function f(callback: unknown) { } + +f((arg: number, arg2: number) => {}); diff --git a/tests/cases/compiler/signatureLengthMismatchWithOptionalParameters.ts b/tests/cases/compiler/signatureLengthMismatchWithOptionalParameters.ts new file mode 100644 index 0000000000000..be021449abd5b --- /dev/null +++ b/tests/cases/compiler/signatureLengthMismatchWithOptionalParameters.ts @@ -0,0 +1,5 @@ +function callee(n: number | undefined, m: string) { } + +function caller(arg: (n?: number) => void) { } + +caller(callee); From 761c8217e3364101a8796b07935d33fd371a7a54 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Thu, 10 Nov 2022 12:04:16 -0800 Subject: [PATCH 07/12] rebaseline --- ...addMoreOverloadsToBaseSignature.errors.txt | 4 +- .../arrowFunctionErrorSpan.errors.txt | 8 +-- ...ignaturesWithOptionalParameters.errors.txt | 28 ++++---- ...ignaturesWithOptionalParameters.errors.txt | 20 +++--- ...ignaturesWithOptionalParameters.errors.txt | 24 +++---- .../assignmentCompatability44.errors.txt | 4 +- .../assignmentCompatability45.errors.txt | 4 +- .../reference/checkJsdocTypeTag6.errors.txt | 12 ++-- ...assCanExtendConstructorFunction.errors.txt | 4 +- .../classSideInheritance3.errors.txt | 8 +-- .../reference/covariantCallbacks.errors.txt | 4 +- .../derivedInterfaceCallSignature.errors.txt | 4 +- ...functionConstraintSatisfaction2.errors.txt | 4 +- ...lWithConstructorTypedArguments5.errors.txt | 8 +-- ...CallWithFunctionTypedArguments5.errors.txt | 8 +-- ...oadedConstructorTypedArguments2.errors.txt | 4 +- ...erloadedFunctionTypedArguments2.errors.txt | 4 +- .../reference/incompatibleTypes.errors.txt | 4 +- .../reference/inferTypes1.errors.txt | 4 +- .../reference/inheritance.errors.txt | 4 +- .../reference/lambdaArgCrash.errors.txt | 4 +- .../reference/multipleInheritance.errors.txt | 4 +- ...ralFunctionArgContextualTyping2.errors.txt | 12 ++-- .../baselines/reference/parseTypes.errors.txt | 8 +-- ...AnnotatedFunctionInferenceError.errors.txt | 12 ++-- .../reference/promisePermutations.errors.txt | 64 +++++++++---------- .../reference/promisePermutations2.errors.txt | 64 +++++++++---------- .../reference/promisePermutations3.errors.txt | 64 +++++++++---------- .../requiredInitializedParameter2.errors.txt | 4 +- ...edTypeContextualTypeNotCircular.errors.txt | 4 +- ...ignaturesWithOptionalParameters.errors.txt | 8 +-- ...ignaturesWithOptionalParameters.errors.txt | 8 +-- ...ignaturesWithOptionalParameters.errors.txt | 24 +++---- ...ignaturesWithOptionalParameters.errors.txt | 24 +++---- ...ionComponentsWithTypeArguments2.errors.txt | 4 +- .../typeGuardFunctionErrors.errors.txt | 4 +- 36 files changed, 238 insertions(+), 238 deletions(-) diff --git a/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt b/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt index 8ef15e9710f56..725fc9f22f638 100644 --- a/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt +++ b/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/addMoreOverloadsToBaseSignature.ts(5,11): error TS2430: Interface 'Bar' incorrectly extends interface 'Foo'. Types of property 'f' are incompatible. Type '(key: string) => string' is not assignable to type '() => string'. - Call signature '(key: string): string' expects more arguments than call signature '(): string'. + The source signature requires more arguments (1) than are provided by the target (0). ==== tests/cases/compiler/addMoreOverloadsToBaseSignature.ts (1 errors) ==== @@ -14,7 +14,7 @@ tests/cases/compiler/addMoreOverloadsToBaseSignature.ts(5,11): error TS2430: Int !!! error TS2430: Interface 'Bar' incorrectly extends interface 'Foo'. !!! error TS2430: Types of property 'f' are incompatible. !!! error TS2430: Type '(key: string) => string' is not assignable to type '() => string'. -!!! error TS2430: Call signature '(key: string): string' expects more arguments than call signature '(): string'. +!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). f(key: string): string; } \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionErrorSpan.errors.txt b/tests/baselines/reference/arrowFunctionErrorSpan.errors.txt index 3c7e344fd8a7c..37e02b506766f 100644 --- a/tests/baselines/reference/arrowFunctionErrorSpan.errors.txt +++ b/tests/baselines/reference/arrowFunctionErrorSpan.errors.txt @@ -8,7 +8,7 @@ tests/cases/compiler/arrowFunctionErrorSpan.ts(17,3): error TS2345: Argument of Type 'void' is not assignable to type 'number'. tests/cases/compiler/arrowFunctionErrorSpan.ts(18,5): error TS1200: Line terminator not permitted before arrow. tests/cases/compiler/arrowFunctionErrorSpan.ts(21,3): error TS2345: Argument of type '(a: any, b: any, c: any, d: any) => void' is not assignable to parameter of type '() => number'. - Call signature '(a: any, b: any, c: any, d: any): void' expects more arguments than call signature '(): number'. + The source signature requires more arguments (4) than are provided by the target (0). tests/cases/compiler/arrowFunctionErrorSpan.ts(28,7): error TS2345: Argument of type '() => void' is not assignable to parameter of type '() => number'. Type 'void' is not assignable to type 'number'. tests/cases/compiler/arrowFunctionErrorSpan.ts(32,7): error TS2345: Argument of type '() => void' is not assignable to parameter of type '() => number'. @@ -18,7 +18,7 @@ tests/cases/compiler/arrowFunctionErrorSpan.ts(36,7): error TS2345: Argument of tests/cases/compiler/arrowFunctionErrorSpan.ts(43,5): error TS2345: Argument of type '() => void' is not assignable to parameter of type '() => number'. Type 'void' is not assignable to type 'number'. tests/cases/compiler/arrowFunctionErrorSpan.ts(52,3): error TS2345: Argument of type '(_: any) => number' is not assignable to parameter of type '() => number'. - Call signature '(_: any): number' expects more arguments than call signature '(): number'. + The source signature requires more arguments (1) than are provided by the target (0). ==== tests/cases/compiler/arrowFunctionErrorSpan.ts (11 errors) ==== @@ -66,7 +66,7 @@ tests/cases/compiler/arrowFunctionErrorSpan.ts(52,3): error TS2345: Argument of d) => { }); ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(a: any, b: any, c: any, d: any) => void' is not assignable to parameter of type '() => number'. -!!! error TS2345: Call signature '(a: any, b: any, c: any, d: any): void' expects more arguments than call signature '(): number'. +!!! error TS2345: The source signature requires more arguments (4) than are provided by the target (0). // single line with a comment f(/* @@ -111,5 +111,5 @@ tests/cases/compiler/arrowFunctionErrorSpan.ts(52,3): error TS2345: Argument of 2); ~~~~~ !!! error TS2345: Argument of type '(_: any) => number' is not assignable to parameter of type '() => number'. -!!! error TS2345: Call signature '(_: any): number' expects more arguments than call signature '(): number'. +!!! error TS2345: The source signature requires more arguments (1) than are provided by the target (0). \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt index a2ee02545eb4a..f56de5c04f9d2 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt @@ -1,17 +1,17 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(16,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. - Call signature '(x: number): number' expects more arguments than call signature '(): number'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. - Call signature '(x: number): number' expects more arguments than call signature '(): number'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(20,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. - Call signature '(x: number, y?: number): number' expects more arguments than call signature '(): number'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(22,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '() => number'. - Call signature '(x: number, y: number): number' expects more arguments than call signature '(): number'. + The source signature requires more arguments (2) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(33,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. - Call signature '(x: number, y: number): number' expects more arguments than call signature '(x?: number): number'. + The source signature requires more arguments (2) than are provided by the target (1). tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(39,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. - Call signature '(x: number, y: number): number' expects more arguments than call signature '(x: number): number'. + The source signature requires more arguments (2) than are provided by the target (1). tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(45,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. - Call signature '(x: number, y: number): number' expects more arguments than call signature '(x: number): number'. + The source signature requires more arguments (2) than are provided by the target (1). ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts (7 errors) ==== @@ -33,22 +33,22 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = (x: number) => 1; // error, too many required params ~ !!! error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. -!!! error TS2322: Call signature '(x: number): number' expects more arguments than call signature '(): number'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). a = b.a; // ok a = b.a2; // ok a = b.a3; // error ~ !!! error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. -!!! error TS2322: Call signature '(x: number): number' expects more arguments than call signature '(): number'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). a = b.a4; // error ~ !!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. -!!! error TS2322: Call signature '(x: number, y?: number): number' expects more arguments than call signature '(): number'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). a = b.a5; // ok a = b.a6; // error ~ !!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '() => number'. -!!! error TS2322: Call signature '(x: number, y: number): number' expects more arguments than call signature '(): number'. +!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (0). var a2: (x?: number) => number; a2 = () => 1; // ok, same number of required params @@ -62,7 +62,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = b.a6; // error ~~ !!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. -!!! error TS2322: Call signature '(x: number, y: number): number' expects more arguments than call signature '(x?: number): number'. +!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). var a3: (x: number) => number; a3 = () => 1; // ok, fewer required params @@ -71,7 +71,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = (x: number, y: number) => 1; // error, too many required params ~~ !!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. -!!! error TS2322: Call signature '(x: number, y: number): number' expects more arguments than call signature '(x: number): number'. +!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). a3 = b.a; // ok a3 = b.a2; // ok a3 = b.a3; // ok @@ -80,7 +80,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = b.a6; // error ~~ !!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. -!!! error TS2322: Call signature '(x: number, y: number): number' expects more arguments than call signature '(x: number): number'. +!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). var a4: (x: number, y?: number) => number; a4 = () => 1; // ok, fewer required params diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt index d7af95a7a7a27..84e0f1773e8af 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt @@ -1,13 +1,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(16,5): error TS2322: Type 'new (x: number) => number' is not assignable to type 'new () => number'. - Construct signature '(x: number): number' expects more arguments than construct signature '(): number'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(17,5): error TS2322: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. - Construct signature '(x: number, y?: number): number' expects more arguments than construct signature '(): number'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. - Construct signature '(x: number, y: number): number' expects more arguments than construct signature '(): number'. + The source signature requires more arguments (2) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(27,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. - Construct signature '(x: number, y: number): number' expects more arguments than construct signature '(x?: number): number'. + The source signature requires more arguments (2) than are provided by the target (1). tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(35,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. - Construct signature '(x: number, y: number): number' expects more arguments than construct signature '(x: number): number'. + The source signature requires more arguments (2) than are provided by the target (1). ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts (5 errors) ==== @@ -29,16 +29,16 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b.a3; // error ~ !!! error TS2322: Type 'new (x: number) => number' is not assignable to type 'new () => number'. -!!! error TS2322: Construct signature '(x: number): number' expects more arguments than construct signature '(): number'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). a = b.a4; // error ~ !!! error TS2322: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. -!!! error TS2322: Construct signature '(x: number, y?: number): number' expects more arguments than construct signature '(): number'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). a = b.a5; // ok a = b.a6; // error ~ !!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. -!!! error TS2322: Construct signature '(x: number, y: number): number' expects more arguments than construct signature '(): number'. +!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (0). var a2: new (x?: number) => number; a2 = b.a; // ok @@ -49,7 +49,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = b.a6; // error ~~ !!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. -!!! error TS2322: Construct signature '(x: number, y: number): number' expects more arguments than construct signature '(x?: number): number'. +!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). var a3: new (x: number) => number; a3 = b.a; // ok @@ -60,7 +60,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = b.a6; // error ~~ !!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. -!!! error TS2322: Construct signature '(x: number, y: number): number' expects more arguments than construct signature '(x: number): number'. +!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). var a4: new (x: number, y?: number) => number; a4 = b.a; // ok diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt index edffa5ba82478..d4119b5ae412a 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(14,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. - Call signature '(x: T): any' expects more arguments than call signature '(): T'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(23,13): error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. - Call signature '(x: T, y: T): any' expects more arguments than call signature '(x: T): T'. + The source signature requires more arguments (2) than are provided by the target (1). tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(63,9): error TS2322: Type '() => T' is not assignable to type '() => T'. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'. @@ -9,9 +9,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(65,9): error TS2322: Type '(x: T) => T' is not assignable to type '() => T'. - Call signature '(x: T): T' expects more arguments than call signature '(): T'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(66,9): error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '() => T'. - Call signature '(x: T, y?: T): T' expects more arguments than call signature '(): T'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(67,9): error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '() => T'. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'. @@ -92,9 +92,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(107,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. - Call signature '(x: T): any' expects more arguments than call signature '(): T'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(116,13): error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. - Call signature '(x: T, y: T): any' expects more arguments than call signature '(x: T): T'. + The source signature requires more arguments (2) than are provided by the target (1). ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts (29 errors) ==== @@ -114,7 +114,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a = (x: T) => null; // error, too many required params ~~~~~~ !!! error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. -!!! error TS2322: Call signature '(x: T): any' expects more arguments than call signature '(): T'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). this.a2 = () => null; // ok, same T of required params this.a2 = (x?: T) => null; // ok, same T of required params @@ -126,7 +126,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a3 = (x: T, y: T) => null; // error, too many required params ~~~~~~~ !!! error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. -!!! error TS2322: Call signature '(x: T, y: T): any' expects more arguments than call signature '(x: T): T'. +!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). this.a4 = () => null; // ok, fewer required params this.a4 = (x?: T, y?: T) => null; // ok, fewer required params @@ -181,11 +181,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme b.a = t.a3; ~~~ !!! error TS2322: Type '(x: T) => T' is not assignable to type '() => T'. -!!! error TS2322: Call signature '(x: T): T' expects more arguments than call signature '(): T'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). b.a = t.a4; ~~~ !!! error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '() => T'. -!!! error TS2322: Call signature '(x: T, y?: T): T' expects more arguments than call signature '(): T'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). b.a = t.a5; ~~~ !!! error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '() => T'. @@ -350,7 +350,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a = (x: T) => null; // error, too many required params ~~~~~~ !!! error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. -!!! error TS2322: Call signature '(x: T): any' expects more arguments than call signature '(): T'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). this.a2 = () => null; // ok, same T of required params this.a2 = (x?: T) => null; // ok, same T of required params @@ -362,7 +362,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a3 = (x: T, y: T) => null; // error, too many required params ~~~~~~~ !!! error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. -!!! error TS2322: Call signature '(x: T, y: T): any' expects more arguments than call signature '(x: T): T'. +!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). this.a4 = () => null; // ok, fewer required params this.a4 = (x?: T, y?: T) => null; // ok, fewer required params diff --git a/tests/baselines/reference/assignmentCompatability44.errors.txt b/tests/baselines/reference/assignmentCompatability44.errors.txt index 4b23865c8eccf..20ff5e077cf7e 100644 --- a/tests/baselines/reference/assignmentCompatability44.errors.txt +++ b/tests/baselines/reference/assignmentCompatability44.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/assignmentCompatability44.ts(5,7): error TS2322: Type 'typeof Foo' is not assignable to type 'new () => Foo'. Types of construct signatures are incompatible. Type 'new (x: number) => Foo' is not assignable to type 'new () => Foo'. - Construct signature '(x: number): Foo' expects more arguments than construct signature '(): Foo'. + The source signature requires more arguments (1) than are provided by the target (0). ==== tests/cases/compiler/assignmentCompatability44.ts (1 errors) ==== @@ -14,5 +14,5 @@ tests/cases/compiler/assignmentCompatability44.ts(5,7): error TS2322: Type 'type !!! error TS2322: Type 'typeof Foo' is not assignable to type 'new () => Foo'. !!! error TS2322: Types of construct signatures are incompatible. !!! error TS2322: Type 'new (x: number) => Foo' is not assignable to type 'new () => Foo'. -!!! error TS2322: Construct signature '(x: number): Foo' expects more arguments than construct signature '(): Foo'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability45.errors.txt b/tests/baselines/reference/assignmentCompatability45.errors.txt index f7e39c534f3f8..0fce9541c8488 100644 --- a/tests/baselines/reference/assignmentCompatability45.errors.txt +++ b/tests/baselines/reference/assignmentCompatability45.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/assignmentCompatability45.ts(7,7): error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. Types of construct signatures are incompatible. Type 'new (x: number) => B' is not assignable to type 'abstract new () => A'. - Construct signature '(x: number): B' expects more arguments than construct signature '(): A'. + The source signature requires more arguments (1) than are provided by the target (0). ==== tests/cases/compiler/assignmentCompatability45.ts (1 errors) ==== @@ -16,5 +16,5 @@ tests/cases/compiler/assignmentCompatability45.ts(7,7): error TS2322: Type 'type !!! error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. !!! error TS2322: Types of construct signatures are incompatible. !!! error TS2322: Type 'new (x: number) => B' is not assignable to type 'abstract new () => A'. -!!! error TS2322: Construct signature '(x: number): B' expects more arguments than construct signature '(): A'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). \ No newline at end of file diff --git a/tests/baselines/reference/checkJsdocTypeTag6.errors.txt b/tests/baselines/reference/checkJsdocTypeTag6.errors.txt index f91054ae81e04..bf19f1afc1ca2 100644 --- a/tests/baselines/reference/checkJsdocTypeTag6.errors.txt +++ b/tests/baselines/reference/checkJsdocTypeTag6.errors.txt @@ -3,11 +3,11 @@ tests/cases/conformance/jsdoc/test.js(7,5): error TS2322: Type '(prop: any) => v tests/cases/conformance/jsdoc/test.js(10,12): error TS8030: The type of a function declaration must match the function's signature. tests/cases/conformance/jsdoc/test.js(23,12): error TS8030: The type of a function declaration must match the function's signature. tests/cases/conformance/jsdoc/test.js(27,7): error TS2322: Type '(more: any) => void' is not assignable to type '() => void'. - Call signature '(more: any): void' expects more arguments than call signature '(): void'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/jsdoc/test.js(30,7): error TS2322: Type '(more: any) => void' is not assignable to type '() => void'. - Call signature '(more: any): void' expects more arguments than call signature '(): void'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/jsdoc/test.js(34,3): error TS2322: Type '(more: any) => void' is not assignable to type '() => void'. - Call signature '(more: any): void' expects more arguments than call signature '(): void'. + The source signature requires more arguments (1) than are provided by the target (0). ==== tests/cases/conformance/jsdoc/test.js (7 errors) ==== @@ -48,19 +48,19 @@ tests/cases/conformance/jsdoc/test.js(34,3): error TS2322: Type '(more: any) => const variableWithMoreParameters = function (more) {}; // error ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type '(more: any) => void' is not assignable to type '() => void'. -!!! error TS2322: Call signature '(more: any): void' expects more arguments than call signature '(): void'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). /** @type {() => void} */ const arrowWithMoreParameters = (more) => {}; // error ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type '(more: any) => void' is not assignable to type '() => void'. -!!! error TS2322: Call signature '(more: any): void' expects more arguments than call signature '(): void'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). ({ /** @type {() => void} */ methodWithMoreParameters(more) {}, // error ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type '(more: any) => void' is not assignable to type '() => void'. -!!! error TS2322: Call signature '(more: any): void' expects more arguments than call signature '(): void'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). }); \ No newline at end of file diff --git a/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt b/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt index 69482a75252f9..6249d18c86b6c 100644 --- a/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt +++ b/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/salsa/first.js(23,9): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/salsa/first.js(31,5): error TS2416: Property 'load' in type 'Sql' is not assignable to the same property in base type 'Wagon'. Type '(files: string[], format: "csv" | "json" | "xmlolololol") => void' is not assignable to type '(supplies?: any[]) => void'. - Call signature '(files: string[], format: "csv" | "json" | "xmlolololol"): void' expects more arguments than call signature '(supplies?: any[]): void'. + The source signature requires more arguments (2) than are provided by the target (1). tests/cases/conformance/salsa/first.js(47,24): error TS2507: Type '(numberEaten: number) => void' is not a constructor function type. tests/cases/conformance/salsa/generic.js(19,19): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/salsa/generic.js(20,32): error TS2345: Argument of type 'number' is not assignable to parameter of type '{ claim: "ignorant" | "malicious"; }'. @@ -53,7 +53,7 @@ tests/cases/conformance/salsa/second.ts(17,15): error TS2345: Argument of type ' ~~~~ !!! error TS2416: Property 'load' in type 'Sql' is not assignable to the same property in base type 'Wagon'. !!! error TS2416: Type '(files: string[], format: "csv" | "json" | "xmlolololol") => void' is not assignable to type '(supplies?: any[]) => void'. -!!! error TS2416: Call signature '(files: string[], format: "csv" | "json" | "xmlolololol"): void' expects more arguments than call signature '(supplies?: any[]): void'. +!!! error TS2416: The source signature requires more arguments (2) than are provided by the target (1). if (format === "xmlolololol") { throw new Error("please do not use XML. It was a joke."); } diff --git a/tests/baselines/reference/classSideInheritance3.errors.txt b/tests/baselines/reference/classSideInheritance3.errors.txt index 475db9daa440d..82a7fbaab6e23 100644 --- a/tests/baselines/reference/classSideInheritance3.errors.txt +++ b/tests/baselines/reference/classSideInheritance3.errors.txt @@ -1,11 +1,11 @@ tests/cases/compiler/classSideInheritance3.ts(16,5): error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. Types of construct signatures are incompatible. Type 'new (x: string, data: string) => B' is not assignable to type 'new (x: string) => A'. - Construct signature '(x: string, data: string): B' expects more arguments than construct signature '(x: string): A'. + The source signature requires more arguments (2) than are provided by the target (1). tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2322: Type 'typeof B' is not assignable to type 'new (x: string) => A'. Types of construct signatures are incompatible. Type 'new (x: string, data: string) => B' is not assignable to type 'new (x: string) => A'. - Construct signature '(x: string, data: string): B' expects more arguments than construct signature '(x: string): A'. + The source signature requires more arguments (2) than are provided by the target (1). ==== tests/cases/compiler/classSideInheritance3.ts (2 errors) ==== @@ -29,11 +29,11 @@ tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2322: Type 'typeof !!! error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. !!! error TS2322: Types of construct signatures are incompatible. !!! error TS2322: Type 'new (x: string, data: string) => B' is not assignable to type 'new (x: string) => A'. -!!! error TS2322: Construct signature '(x: string, data: string): B' expects more arguments than construct signature '(x: string): A'. +!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). var r2: new (x: string) => A = B; // error ~~ !!! error TS2322: Type 'typeof B' is not assignable to type 'new (x: string) => A'. !!! error TS2322: Types of construct signatures are incompatible. !!! error TS2322: Type 'new (x: string, data: string) => B' is not assignable to type 'new (x: string) => A'. -!!! error TS2322: Construct signature '(x: string, data: string): B' expects more arguments than construct signature '(x: string): A'. +!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). var r3: typeof A = C; // ok \ No newline at end of file diff --git a/tests/baselines/reference/covariantCallbacks.errors.txt b/tests/baselines/reference/covariantCallbacks.errors.txt index aba2724123975..428d79cc720af 100644 --- a/tests/baselines/reference/covariantCallbacks.errors.txt +++ b/tests/baselines/reference/covariantCallbacks.errors.txt @@ -16,7 +16,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covarian Types of property 'forEach' are incompatible. Type '(cb: (item: A) => void) => void' is not assignable to type '(cb: (item: A, context: any) => void) => void'. Types of parameters 'cb' and 'cb' are incompatible. - Call signature '(item: A, context: any): void' expects more arguments than call signature '(item: A): void'. + The source signature requires more arguments (2) than are provided by the target (1). tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covariantCallbacks.ts(69,5): error TS2322: Type 'AList4' is not assignable to type 'BList4'. Types of property 'forEach' are incompatible. Type '(cb: (item: A) => A) => void' is not assignable to type '(cb: (item: B) => B) => void'. @@ -106,7 +106,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covarian !!! error TS2322: Types of property 'forEach' are incompatible. !!! error TS2322: Type '(cb: (item: A) => void) => void' is not assignable to type '(cb: (item: A, context: any) => void) => void'. !!! error TS2322: Types of parameters 'cb' and 'cb' are incompatible. -!!! error TS2322: Call signature '(item: A, context: any): void' expects more arguments than call signature '(item: A): void'. +!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). } interface AList4 { diff --git a/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt b/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt index 00b51f5327a93..355fc4315e3c5 100644 --- a/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt +++ b/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/derivedInterfaceCallSignature.ts(11,11): error TS2430: Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath'. Types of property 'x' are incompatible. Type '(x: (data: any, index?: number) => number) => D3SvgArea' is not assignable to type '() => (data: any, index?: number) => number'. - Call signature '(x: (data: any, index?: number) => number): D3SvgArea' expects more arguments than call signature '(): (data: any, index?: number) => number'. + The source signature requires more arguments (1) than are provided by the target (0). ==== tests/cases/compiler/derivedInterfaceCallSignature.ts (1 errors) ==== @@ -20,7 +20,7 @@ tests/cases/compiler/derivedInterfaceCallSignature.ts(11,11): error TS2430: Inte !!! error TS2430: Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath'. !!! error TS2430: Types of property 'x' are incompatible. !!! error TS2430: Type '(x: (data: any, index?: number) => number) => D3SvgArea' is not assignable to type '() => (data: any, index?: number) => number'. -!!! error TS2430: Call signature '(x: (data: any, index?: number) => number): D3SvgArea' expects more arguments than call signature '(): (data: any, index?: number) => number'. +!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). x(x: (data: any, index?: number) => number): D3SvgArea; y(y: (data: any, index?: number) => number): D3SvgArea; y0(): (data: any, index?: number) => number; diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt index 11b4d7f07d185..650e3691a1818 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt +++ b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt @@ -11,7 +11,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(26,15): error TS2345: Argument of type 'new (x: string) => string' is not assignable to parameter of type '(x: string) => string'. Type 'new (x: string) => string' provides no match for the signature '(x: string): string'. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(28,16): error TS2345: Argument of type '(x: U, y: V) => U' is not assignable to parameter of type '(x: string) => string'. - Call signature '(x: U, y: V): U' expects more arguments than call signature '(x: string): string'. + The source signature requires more arguments (2) than are provided by the target (1). tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(29,16): error TS2345: Argument of type 'typeof C2' is not assignable to parameter of type '(x: string) => string'. Type 'typeof C2' provides no match for the signature '(x: string): string'. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(30,16): error TS2345: Argument of type 'new (x: T) => T' is not assignable to parameter of type '(x: string) => string'. @@ -75,7 +75,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain var r11 = foo2((x: U, y: V) => x); ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: U, y: V) => U' is not assignable to parameter of type '(x: string) => string'. -!!! error TS2345: Call signature '(x: U, y: V): U' expects more arguments than call signature '(x: string): string'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). var r13 = foo2(C2); ~~ !!! error TS2345: Argument of type 'typeof C2' is not assignable to parameter of type '(x: string) => string'. diff --git a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt index a7801d2b5d00a..8ff3a77dd505c 100644 --- a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt +++ b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts(11,14): error TS2345: Argument of type '{ cb: new (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: unknown) => string; }'. Types of property 'cb' are incompatible. Type 'new (x: T, y: T) => string' is not assignable to type 'new (t: unknown) => string'. - Construct signature '(x: T, y: T): string' expects more arguments than construct signature '(t: unknown): string'. + The source signature requires more arguments (2) than are provided by the target (1). tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts(13,14): error TS2345: Argument of type '{ cb: new (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: new (t: string) => string; }'. Types of property 'cb' are incompatible. Type 'new (x: string, y: number) => string' is not assignable to type 'new (t: string) => string'. - Construct signature '(x: string, y: number): string' expects more arguments than construct signature '(t: string): string'. + The source signature requires more arguments (2) than are provided by the target (1). ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts (2 errors) ==== @@ -24,14 +24,14 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithCon !!! error TS2345: Argument of type '{ cb: new (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: unknown) => string; }'. !!! error TS2345: Types of property 'cb' are incompatible. !!! error TS2345: Type 'new (x: T, y: T) => string' is not assignable to type 'new (t: unknown) => string'. -!!! error TS2345: Construct signature '(x: T, y: T): string' expects more arguments than construct signature '(t: unknown): string'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). var arg3: { cb: new (x: string, y: number) => string }; var r3 = foo(arg3); // error ~~~~ !!! error TS2345: Argument of type '{ cb: new (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: new (t: string) => string; }'. !!! error TS2345: Types of property 'cb' are incompatible. !!! error TS2345: Type 'new (x: string, y: number) => string' is not assignable to type 'new (t: string) => string'. -!!! error TS2345: Construct signature '(x: string, y: number): string' expects more arguments than construct signature '(t: string): string'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). function foo2(arg: { cb: new(t: T, t2: T) => U }) { return new arg.cb(null, null); diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt index fa2f831a0df59..58ec2ae672f1b 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(10,16): error TS2322: Type '(x: T, y: T) => string' is not assignable to type '(t: unknown) => string'. - Call signature '(x: T, y: T): string' expects more arguments than call signature '(t: unknown): string'. + The source signature requires more arguments (2) than are provided by the target (1). tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(11,16): error TS2322: Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'. - Call signature '(x: string, y: number): string' expects more arguments than call signature '(t: string): string'. + The source signature requires more arguments (2) than are provided by the target (1). ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts (2 errors) ==== @@ -17,12 +17,12 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun var r2 = foo({ cb: (x: T, y: T) => '' }); // error ~~ !!! error TS2322: Type '(x: T, y: T) => string' is not assignable to type '(t: unknown) => string'. -!!! error TS2322: Call signature '(x: T, y: T): string' expects more arguments than call signature '(t: unknown): string'. +!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS6500 tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts:3:27: The expected type comes from property 'cb' which is declared here on type '{ cb: (t: unknown) => string; }' var r3 = foo({ cb: (x: string, y: number) => '' }); // error ~~ !!! error TS2322: Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'. -!!! error TS2322: Call signature '(x: string, y: number): string' expects more arguments than call signature '(t: string): string'. +!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS6500 tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts:3:27: The expected type comes from property 'cb' which is declared here on type '{ cb: (t: string) => string; }' function foo2(arg: { cb: (t: T, t2: T) => U }) { diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt index b11c57409991a..c0db9b1819efc 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments2.ts(31,20): error TS2345: Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: unknown): string; new (x: unknown, y?: unknown): string; }'. - Construct signature '(x: any, y: any): string' expects more arguments than construct signature '(x: unknown): string'. + The source signature requires more arguments (2) than are provided by the target (1). ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments2.ts (1 errors) ==== @@ -36,7 +36,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOve var r10 = foo6(b); // error ~ !!! error TS2345: Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: unknown): string; new (x: unknown, y?: unknown): string; }'. -!!! error TS2345: Construct signature '(x: any, y: any): string' expects more arguments than construct signature '(x: unknown): string'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). function foo7(x:T, cb: { new(x: T): string; new(x: T, y?: T): string }) { return cb; diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt index 45b142e5948d2..1507c70004e10 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments2.ts(28,20): error TS2345: Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: unknown): string; (x: unknown, y?: unknown): string; }'. - Call signature '(x: any, y: any): string' expects more arguments than call signature '(x: unknown): string'. + The source signature requires more arguments (2) than are provided by the target (1). ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments2.ts (1 errors) ==== @@ -33,7 +33,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOve var r10 = foo6((x: T, y: T) => ''); // error ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: unknown): string; (x: unknown, y?: unknown): string; }'. -!!! error TS2345: Call signature '(x: any, y: any): string' expects more arguments than call signature '(x: unknown): string'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { return cb; diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index 5b6c2b450ee17..e63c241a19bef 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -29,7 +29,7 @@ tests/cases/compiler/incompatibleTypes.ts(66,47): error TS2322: Type '{ e: numbe 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 'number' is not assignable to type '() => string'. tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. - Call signature '(a: any): number' expects more arguments than call signature '(): any'. + The source signature requires more arguments (1) than are provided by the target (0). ==== tests/cases/compiler/incompatibleTypes.ts (9 errors) ==== @@ -149,5 +149,5 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => var fp1: () =>any = a => 0; ~~~ !!! error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. -!!! error TS2322: Call signature '(a: any): number' expects more arguments than call signature '(): any'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). \ No newline at end of file diff --git a/tests/baselines/reference/inferTypes1.errors.txt b/tests/baselines/reference/inferTypes1.errors.txt index f2832ff73e312..22bdb4b8ef48c 100644 --- a/tests/baselines/reference/inferTypes1.errors.txt +++ b/tests/baselines/reference/inferTypes1.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(43,25): error TS2344: T tests/cases/conformance/types/conditional/inferTypes1.ts(44,25): error TS2344: Type 'Function' does not satisfy the constraint 'abstract new (...args: any) => any'. Type 'Function' provides no match for the signature 'new (...args: any): any'. tests/cases/conformance/types/conditional/inferTypes1.ts(55,25): error TS2344: Type '(x: string, y: string) => number' does not satisfy the constraint '(x: any) => any'. - Call signature '(x: string, y: string): number' expects more arguments than call signature '(x: any): any'. + The source signature requires more arguments (2) than are provided by the target (1). tests/cases/conformance/types/conditional/inferTypes1.ts(56,25): error TS2344: Type 'Function' does not satisfy the constraint '(x: any) => any'. Type 'Function' provides no match for the signature '(x: any): any'. tests/cases/conformance/types/conditional/inferTypes1.ts(82,12): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type. @@ -89,7 +89,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(153,40): error TS2322: type T24 = ArgumentType<(x: string, y: string) => number>; // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2344: Type '(x: string, y: string) => number' does not satisfy the constraint '(x: any) => any'. -!!! error TS2344: Call signature '(x: string, y: string): number' expects more arguments than call signature '(x: any): any'. +!!! error TS2344: The source signature requires more arguments (2) than are provided by the target (1). type T25 = ArgumentType; // Error ~~~~~~~~ !!! error TS2344: Type 'Function' does not satisfy the constraint '(x: any) => any'. diff --git a/tests/baselines/reference/inheritance.errors.txt b/tests/baselines/reference/inheritance.errors.txt index d3ee3903541d8..7e328ac2b9724 100644 --- a/tests/baselines/reference/inheritance.errors.txt +++ b/tests/baselines/reference/inheritance.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/inheritance.ts(31,12): error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. tests/cases/compiler/inheritance.ts(32,12): error TS2416: Property 'g' in type 'Baad' is not assignable to the same property in base type 'Good'. Type '(n: number) => number' is not assignable to type '() => number'. - Call signature '(n: number): number' expects more arguments than call signature '(): number'. + The source signature requires more arguments (1) than are provided by the target (0). ==== tests/cases/compiler/inheritance.ts (2 errors) ==== @@ -42,6 +42,6 @@ tests/cases/compiler/inheritance.ts(32,12): error TS2416: Property 'g' in type ' ~ !!! error TS2416: Property 'g' in type 'Baad' is not assignable to the same property in base type 'Good'. !!! error TS2416: Type '(n: number) => number' is not assignable to type '() => number'. -!!! error TS2416: Call signature '(n: number): number' expects more arguments than call signature '(): number'. +!!! error TS2416: The source signature requires more arguments (1) than are provided by the target (0). } \ No newline at end of file diff --git a/tests/baselines/reference/lambdaArgCrash.errors.txt b/tests/baselines/reference/lambdaArgCrash.errors.txt index fe1a5cb0d0f5e..5bdda79452c07 100644 --- a/tests/baselines/reference/lambdaArgCrash.errors.txt +++ b/tests/baselines/reference/lambdaArgCrash.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/lambdaArgCrash.ts(27,25): error TS2304: Cannot find name 'ItemSet'. tests/cases/compiler/lambdaArgCrash.ts(29,14): error TS2345: Argument of type '(items: ItemSet) => void' is not assignable to parameter of type '() => any'. - Call signature '(items: ItemSet): void' expects more arguments than call signature '(): any'. + The source signature requires more arguments (1) than are provided by the target (0). ==== tests/cases/compiler/lambdaArgCrash.ts (2 errors) ==== @@ -37,7 +37,7 @@ tests/cases/compiler/lambdaArgCrash.ts(29,14): error TS2345: Argument of type '( super.add(listener); ~~~~~~~~ !!! error TS2345: Argument of type '(items: ItemSet) => void' is not assignable to parameter of type '() => any'. -!!! error TS2345: Call signature '(items: ItemSet): void' expects more arguments than call signature '(): any'. +!!! error TS2345: The source signature requires more arguments (1) than are provided by the target (0). } diff --git a/tests/baselines/reference/multipleInheritance.errors.txt b/tests/baselines/reference/multipleInheritance.errors.txt index 1437566446b72..e105c70c23086 100644 --- a/tests/baselines/reference/multipleInheritance.errors.txt +++ b/tests/baselines/reference/multipleInheritance.errors.txt @@ -3,7 +3,7 @@ tests/cases/compiler/multipleInheritance.ts(18,21): error TS1174: Classes can on tests/cases/compiler/multipleInheritance.ts(35,12): error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. tests/cases/compiler/multipleInheritance.ts(36,12): error TS2416: Property 'g' in type 'Baad' is not assignable to the same property in base type 'Good'. Type '(n: number) => number' is not assignable to type '() => number'. - Call signature '(n: number): number' expects more arguments than call signature '(): number'. + The source signature requires more arguments (1) than are provided by the target (0). ==== tests/cases/compiler/multipleInheritance.ts (4 errors) ==== @@ -52,6 +52,6 @@ tests/cases/compiler/multipleInheritance.ts(36,12): error TS2416: Property 'g' i ~ !!! error TS2416: Property 'g' in type 'Baad' is not assignable to the same property in base type 'Good'. !!! error TS2416: Type '(n: number) => number' is not assignable to type '() => number'. -!!! error TS2416: Call signature '(n: number): number' expects more arguments than call signature '(): number'. +!!! error TS2416: The source signature requires more arguments (1) than are provided by the target (0). } \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt index f19466d8200ae..77a77a8c7e61a 100644 --- a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt +++ b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt @@ -5,11 +5,11 @@ tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(9,4): error TS tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(10,17): error TS2345: Argument of type '{ value: string; what: number; }' is not assignable to parameter of type 'I2'. Object literal may only specify known properties, and 'what' does not exist in type 'I2'. tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(11,6): error TS2322: Type '(s: any) => any' is not assignable to type '() => string'. - Call signature '(s: any): any' expects more arguments than call signature '(): string'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(12,6): error TS2322: Type '(s: string) => string' is not assignable to type '() => string'. - Call signature '(s: string): string' expects more arguments than call signature '(): string'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(13,17): error TS2322: Type '(s: any) => any' is not assignable to type '() => string'. - Call signature '(s: any): any' expects more arguments than call signature '(): string'. + The source signature requires more arguments (1) than are provided by the target (0). ==== tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts (6 errors) ==== @@ -36,12 +36,12 @@ tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(13,17): error f2({ toString: (s) => s }) ~~~~~~~~ !!! error TS2322: Type '(s: any) => any' is not assignable to type '() => string'. -!!! error TS2322: Call signature '(s: any): any' expects more arguments than call signature '(): string'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). f2({ toString: (s: string) => s }) ~~~~~~~~ !!! error TS2322: Type '(s: string) => string' is not assignable to type '() => string'. -!!! error TS2322: Call signature '(s: string): string' expects more arguments than call signature '(): string'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). f2({ value: '', toString: (s) => s.uhhh }) ~~~~~~~~ !!! error TS2322: Type '(s: any) => any' is not assignable to type '() => string'. -!!! error TS2322: Call signature '(s: any): any' expects more arguments than call signature '(): string'. \ No newline at end of file +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). \ No newline at end of file diff --git a/tests/baselines/reference/parseTypes.errors.txt b/tests/baselines/reference/parseTypes.errors.txt index 092fe2754af22..dea60fe20c310 100644 --- a/tests/baselines/reference/parseTypes.errors.txt +++ b/tests/baselines/reference/parseTypes.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/parseTypes.ts(8,1): error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. - Call signature '(s: string): void' expects more arguments than call signature '(): number'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/compiler/parseTypes.ts(9,1): error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. - Call signature '(s: string): void' expects more arguments than call signature '(): number'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/compiler/parseTypes.ts(10,1): error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'. Index signature for type 'number' is missing in type '(s: string) => void'. tests/cases/compiler/parseTypes.ts(11,1): error TS2322: Type '(s: string) => void' is not assignable to type 'new () => number'. @@ -19,11 +19,11 @@ tests/cases/compiler/parseTypes.ts(11,1): error TS2322: Type '(s: string) => voi y=g; ~ !!! error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. -!!! error TS2322: Call signature '(s: string): void' expects more arguments than call signature '(): number'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). x=g; ~ !!! error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. -!!! error TS2322: Call signature '(s: string): void' expects more arguments than call signature '(): number'. +!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). w=g; ~ !!! error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'. diff --git a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.errors.txt b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.errors.txt index 06299adec0e15..5c7049a9afabd 100644 --- a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.errors.txt +++ b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partiallyAnnotatedFunctionInferenceError.ts(12,11): error TS2345: Argument of type '(t1: D, t2: any, t3: any) => void' is not assignable to parameter of type '(t: any, t1: any) => void'. - Call signature '(t1: D, t2: any, t3: any): void' expects more arguments than call signature '(t: any, t1: any): void'. + The source signature requires more arguments (3) than are provided by the target (2). tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partiallyAnnotatedFunctionInferenceError.ts(13,11): error TS2345: Argument of type '(t1: any, t2: D, t3: any) => void' is not assignable to parameter of type '(t: any, t1: any) => void'. - Call signature '(t1: any, t2: D, t3: any): void' expects more arguments than call signature '(t: any, t1: any): void'. + The source signature requires more arguments (3) than are provided by the target (2). tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partiallyAnnotatedFunctionInferenceError.ts(14,11): error TS2345: Argument of type '(t1: any, t2: any, t3: D) => void' is not assignable to parameter of type '(t: any, t1: any) => void'. - Call signature '(t1: any, t2: any, t3: D): void' expects more arguments than call signature '(t: any, t1: any): void'. + The source signature requires more arguments (3) than are provided by the target (2). ==== tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partiallyAnnotatedFunctionInferenceError.ts (3 errors) ==== @@ -21,13 +21,13 @@ tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partial testError((t1: D, t2, t3) => {}) ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(t1: D, t2: any, t3: any) => void' is not assignable to parameter of type '(t: any, t1: any) => void'. -!!! error TS2345: Call signature '(t1: D, t2: any, t3: any): void' expects more arguments than call signature '(t: any, t1: any): void'. +!!! error TS2345: The source signature requires more arguments (3) than are provided by the target (2). testError((t1, t2: D, t3) => {}) ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(t1: any, t2: D, t3: any) => void' is not assignable to parameter of type '(t: any, t1: any) => void'. -!!! error TS2345: Call signature '(t1: any, t2: D, t3: any): void' expects more arguments than call signature '(t: any, t1: any): void'. +!!! error TS2345: The source signature requires more arguments (3) than are provided by the target (2). testError((t1, t2, t3: D) => {}) ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(t1: any, t2: any, t3: D) => void' is not assignable to parameter of type '(t: any, t1: any) => void'. -!!! error TS2345: Call signature '(t1: any, t2: any, t3: D): void' expects more arguments than call signature '(t: any, t1: any): void'. +!!! error TS2345: The source signature requires more arguments (3) than are provided by the target (2). \ No newline at end of file diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index 76fe0ea44c7b1..b6dd5fbf033d7 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -26,35 +26,35 @@ tests/cases/compiler/promisePermutations.ts(84,19): error TS2769: No overload ma 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'. - Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(value: string): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(value: string): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(value: string): Promise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(value: string): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: string): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: string): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: string): Promise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: string): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. @@ -76,23 +76,23 @@ tests/cases/compiler/promisePermutations.ts(111,19): error TS2769: No overload m 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'. - Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: number): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: number): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: number): Promise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: number): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(value: number): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. @@ -101,15 +101,15 @@ tests/cases/compiler/promisePermutations.ts(129,33): error TS2769: No overload m 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'. - Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(value: number): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(value: number): Promise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(value: number): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. @@ -274,7 +274,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. -!!! error TS2769: Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(value: string): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! 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; @@ -283,21 +283,21 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. -!!! error TS2769: Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(value: string): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(value: string): Promise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(value: string): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! 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 @@ -307,7 +307,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. -!!! error TS2769: Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: string): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! 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; @@ -316,21 +316,21 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. -!!! error TS2769: Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: string): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: string): Promise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: string): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! 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 @@ -377,7 +377,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. -!!! error TS2769: Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: number): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! 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; @@ -386,21 +386,21 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. -!!! error TS2769: Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: number): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: number): Promise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: number): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! 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 @@ -410,7 +410,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. -!!! error TS2769: Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(value: number): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! 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 @@ -429,21 +429,21 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. -!!! error TS2769: Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(value: number): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(value: number): Promise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(value: number): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! 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 diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index a9a486f6240f9..2e511317b23e1 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -18,23 +18,23 @@ tests/cases/compiler/promisePermutations2.ts(83,19): error TS2345: Argument of t 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'. - Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(value: string): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(value: string): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(value: string): Promise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(value: string): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: string): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: string): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: string): Promise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: string): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. @@ -56,28 +56,28 @@ tests/cases/compiler/promisePermutations2.ts(110,19): error TS2769: No overload 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'. - Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: number): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: number): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: number): Promise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: number): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(value: number): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. 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'. - Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(value: number): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(value: number): Promise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(value: number): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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 TS2769: No overload matches this call. @@ -219,22 +219,22 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of !!! 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'. -!!! error TS2769: Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(value: string): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! 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 ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(value: string): IPromise'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). 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 TS2345: Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(value: string): Promise'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). 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 TS2345: Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(value: string): IPromise'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; @@ -243,22 +243,22 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of !!! 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'. -!!! error TS2769: Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: string): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! 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 ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: string): IPromise'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). 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 TS2345: Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: string): Promise'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). 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 TS2345: Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: string): IPromise'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; @@ -304,22 +304,22 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of !!! 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'. -!!! error TS2769: Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: number): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! 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 ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: number): IPromise'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). 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 TS2345: Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: number): Promise'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). 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 TS2345: Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: number): IPromise'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; @@ -328,7 +328,7 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of !!! 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'. -!!! error TS2769: Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(value: number): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! 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 @@ -345,15 +345,15 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of 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 TS2345: Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(value: number): IPromise'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). 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 TS2345: Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(value: number): Promise'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). 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 TS2345: Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(value: number): IPromise'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 45661e44dddf9..e23a6615f8eef 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -25,33 +25,33 @@ tests/cases/compiler/promisePermutations3.ts(83,19): error TS2769: No overload m 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'. - Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(value: string): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(value: string): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(value: string): Promise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(value: string): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: string): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: string): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: string): Promise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: string): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. @@ -63,36 +63,36 @@ 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'. - Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: number): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: number): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: number): Promise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: number): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(value: number): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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 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'. - Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(value: number): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(value: number): Promise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. - Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(value: number): IPromise'. + The source signature requires more arguments (2) than are provided by the target (1). 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'. @@ -253,7 +253,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of 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 TS2345: Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(value: string): IPromise'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error @@ -261,21 +261,21 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! 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'. -!!! error TS2769: Call signature '(x: number, cb: (a: string) => string): IPromise' expects more arguments than call signature '(value: string): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(value: string): Promise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: Call signature '(x: number, cb: (a: string) => string): Promise' expects more arguments than call signature '(value: string): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! 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 @@ -283,7 +283,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of 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 TS2345: Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: string): IPromise'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error @@ -291,21 +291,21 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! 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'. -!!! error TS2769: Call signature '(x: number, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: string): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: string): Promise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: Call signature '(x: number, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: string): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! 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 @@ -338,7 +338,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of 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 TS2345: Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: number): IPromise'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error @@ -346,21 +346,21 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! 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'. -!!! error TS2769: Call signature '(x: T, cb: (a: T) => T): IPromise' expects more arguments than call signature '(value: number): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: number): Promise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: Call signature '(x: T, cb: (a: T) => T): Promise' expects more arguments than call signature '(value: number): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! 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 @@ -368,7 +368,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of 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 TS2345: Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(value: number): IPromise'. +!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // error @@ -383,21 +383,21 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! 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'. -!!! error TS2769: Call signature '(x: T, cb: (a: U) => U): IPromise' expects more arguments than call signature '(value: number): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(value: number): Promise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: Call signature '(x: T, cb: (a: U) => U): Promise' expects more arguments than call signature '(value: number): IPromise'. +!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). !!! 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 diff --git a/tests/baselines/reference/requiredInitializedParameter2.errors.txt b/tests/baselines/reference/requiredInitializedParameter2.errors.txt index 1d878cbf14df1..570d328e65b3c 100644 --- a/tests/baselines/reference/requiredInitializedParameter2.errors.txt +++ b/tests/baselines/reference/requiredInitializedParameter2.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/requiredInitializedParameter2.ts(6,5): error TS2416: Property 'method' in type 'C1' is not assignable to the same property in base type 'I1'. Type '(a: number, b: any) => void' is not assignable to type '() => any'. - Call signature '(a: number, b: any): void' expects more arguments than call signature '(): any'. + The source signature requires more arguments (2) than are provided by the target (0). ==== tests/cases/compiler/requiredInitializedParameter2.ts (1 errors) ==== @@ -13,5 +13,5 @@ tests/cases/compiler/requiredInitializedParameter2.ts(6,5): error TS2416: Proper ~~~~~~ !!! error TS2416: Property 'method' in type 'C1' is not assignable to the same property in base type 'I1'. !!! error TS2416: Type '(a: number, b: any) => void' is not assignable to type '() => any'. -!!! error TS2416: Call signature '(a: number, b: any): void' expects more arguments than call signature '(): any'. +!!! error TS2416: The source signature requires more arguments (2) than are provided by the target (0). } \ No newline at end of file diff --git a/tests/baselines/reference/reverseMappedTypeContextualTypeNotCircular.errors.txt b/tests/baselines/reference/reverseMappedTypeContextualTypeNotCircular.errors.txt index 1c2b6d0dd3e5b..6ccefb972541c 100644 --- a/tests/baselines/reference/reverseMappedTypeContextualTypeNotCircular.errors.txt +++ b/tests/baselines/reference/reverseMappedTypeContextualTypeNotCircular.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/reverseMappedTypeContextualTypeNotCircular.ts(10,3): error TS2322: Type '(state: any, props: any) => {}' is not assignable to type 'Selector'. - Call signature '(state: any, props: any): {}' expects more arguments than call signature '(state: unknown): {}'. + The source signature requires more arguments (2) than are provided by the target (1). ==== tests/cases/compiler/reverseMappedTypeContextualTypeNotCircular.ts (1 errors) ==== @@ -15,6 +15,6 @@ tests/cases/compiler/reverseMappedTypeContextualTypeNotCircular.ts(10,3): error editable: (state: any, props: any) => editable(), // expect "Type '(state: any, props: any) => {}' is not assignable to type 'Selector'", _not_ a circularity error ~~~~~~~~ !!! error TS2322: Type '(state: any, props: any) => {}' is not assignable to type 'Selector'. -!!! error TS2322: Call signature '(state: any, props: any): {}' expects more arguments than call signature '(state: unknown): {}'. +!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS6500 tests/cases/compiler/reverseMappedTypeContextualTypeNotCircular.ts:10:3: The expected type comes from property 'editable' which is declared here on type '{ editable: Selector; }' }); \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt index 51ce8fd589c2e..ec913f9c832f8 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts(19,11): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. Types of property 'a' are incompatible. Type '(x: number) => number' is not assignable to type '() => number'. - Call signature '(x: number): number' expects more arguments than call signature '(): number'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts(49,11): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. Types of property 'a3' are incompatible. Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. - Call signature '(x: number, y: number): number' expects more arguments than call signature '(x: number): number'. + The source signature requires more arguments (2) than are provided by the target (1). ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts (2 errors) ==== @@ -32,7 +32,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type '(x: number) => number' is not assignable to type '() => number'. -!!! error TS2430: Call signature '(x: number): number' expects more arguments than call signature '(): number'. +!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). a: (x: number) => number; // error, too many required params } @@ -67,7 +67,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. -!!! error TS2430: Call signature '(x: number, y: number): number' expects more arguments than call signature '(x: number): number'. +!!! error TS2430: The source signature requires more arguments (2) than are provided by the target (1). a3: (x: number, y: number) => number; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt index 95a723898ee6a..17c947fd1c511 100644 --- a/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts(19,11): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. Types of property 'a' are incompatible. Type 'new (x: number) => number' is not assignable to type 'new () => number'. - Construct signature '(x: number): number' expects more arguments than construct signature '(): number'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts(49,11): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. Types of property 'a3' are incompatible. Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. - Construct signature '(x: number, y: number): number' expects more arguments than construct signature '(x: number): number'. + The source signature requires more arguments (2) than are provided by the target (1). ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts (2 errors) ==== @@ -32,7 +32,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type 'new (x: number) => number' is not assignable to type 'new () => number'. -!!! error TS2430: Construct signature '(x: number): number' expects more arguments than construct signature '(): number'. +!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). a: new (x: number) => number; // error, too many required params } @@ -67,7 +67,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. -!!! error TS2430: Construct signature '(x: number, y: number): number' expects more arguments than construct signature '(x: number): number'. +!!! error TS2430: The source signature requires more arguments (2) than are provided by the target (1). a3: new (x: number, y: number) => number; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt index 988a432423cc3..6fa794c4bf7b5 100644 --- a/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(20,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. Types of property 'a' are incompatible. Type '(x: T) => T' is not assignable to type '() => T'. - Call signature '(x: T): T' expects more arguments than call signature '(): T'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(50,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. Types of property 'a3' are incompatible. Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. - Call signature '(x: T, y: T): T' expects more arguments than call signature '(x: T): T'. + The source signature requires more arguments (2) than are provided by the target (1). tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(100,15): error TS2430: Interface 'I1' incorrectly extends interface 'Base2'. The types returned by 'a()' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -17,7 +17,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(108,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. Type '(x: T) => T' is not assignable to type '() => T'. - Call signature '(x: T): T' expects more arguments than call signature '(): T'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(113,15): error TS2430: Interface 'I4' incorrectly extends interface 'Base2'. The types returned by 'a2(...)' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -53,7 +53,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(138,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. Types of property 'a3' are incompatible. Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. - Call signature '(x: T, y: T): T' expects more arguments than call signature '(x: T): T'. + The source signature requires more arguments (2) than are provided by the target (1). tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(143,15): error TS2430: Interface 'I11' incorrectly extends interface 'Base2'. The types returned by 'a4(...)' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -101,11 +101,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(196,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. Type '(x: T) => T' is not assignable to type '() => T'. - Call signature '(x: T): T' expects more arguments than call signature '(): T'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(226,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. Types of property 'a3' are incompatible. Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. - Call signature '(x: T, y: T): T' expects more arguments than call signature '(x: T): T'. + The source signature requires more arguments (2) than are provided by the target (1). ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts (22 errors) ==== @@ -133,7 +133,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type '(x: T) => T' is not assignable to type '() => T'. -!!! error TS2430: Call signature '(x: T): T' expects more arguments than call signature '(): T'. +!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). a: (x: T) => T; // error, too many required params } @@ -168,7 +168,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. -!!! error TS2430: Call signature '(x: T, y: T): T' expects more arguments than call signature '(x: T): T'. +!!! error TS2430: The source signature requires more arguments (2) than are provided by the target (1). a3: (x: T, y: T) => T; // error, too many required params } @@ -243,7 +243,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type '(x: T) => T' is not assignable to type '() => T'. -!!! error TS2430: Call signature '(x: T): T' expects more arguments than call signature '(): T'. +!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). a: (x: T) => T; } @@ -322,7 +322,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. -!!! error TS2430: Call signature '(x: T, y: T): T' expects more arguments than call signature '(x: T): T'. +!!! error TS2430: The source signature requires more arguments (2) than are provided by the target (1). a3: (x: T, y: T) => T; } @@ -445,7 +445,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type '(x: T) => T' is not assignable to type '() => T'. -!!! error TS2430: Call signature '(x: T): T' expects more arguments than call signature '(): T'. +!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). a: (x: T) => T; // error, not identical and contextual signature instatiation can't make inference from T to T } @@ -480,7 +480,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. -!!! error TS2430: Call signature '(x: T, y: T): T' expects more arguments than call signature '(x: T): T'. +!!! error TS2430: The source signature requires more arguments (2) than are provided by the target (1). a3: (x: T, y: T) => T; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt index db9d0754ae8fc..10f842893cb83 100644 --- a/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(20,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. Types of property 'a' are incompatible. Type 'new (x: T) => T' is not assignable to type 'new () => T'. - Construct signature '(x: T): T' expects more arguments than construct signature '(): T'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(50,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. Types of property 'a3' are incompatible. Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. - Construct signature '(x: T, y: T): T' expects more arguments than construct signature '(x: T): T'. + The source signature requires more arguments (2) than are provided by the target (1). tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(100,15): error TS2430: Interface 'I1' incorrectly extends interface 'Base2'. The types returned by 'new a()' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -17,7 +17,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(108,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. Type 'new (x: T) => T' is not assignable to type 'new () => T'. - Construct signature '(x: T): T' expects more arguments than construct signature '(): T'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(113,15): error TS2430: Interface 'I4' incorrectly extends interface 'Base2'. The types returned by 'new a2(...)' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -53,7 +53,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(138,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. Types of property 'a3' are incompatible. Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. - Construct signature '(x: T, y: T): T' expects more arguments than construct signature '(x: T): T'. + The source signature requires more arguments (2) than are provided by the target (1). tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(143,15): error TS2430: Interface 'I11' incorrectly extends interface 'Base2'. The types returned by 'new a4(...)' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -101,11 +101,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(196,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. Type 'new (x: T) => T' is not assignable to type 'new () => T'. - Construct signature '(x: T): T' expects more arguments than construct signature '(): T'. + The source signature requires more arguments (1) than are provided by the target (0). tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(226,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. Types of property 'a3' are incompatible. Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. - Construct signature '(x: T, y: T): T' expects more arguments than construct signature '(x: T): T'. + The source signature requires more arguments (2) than are provided by the target (1). ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts (22 errors) ==== @@ -133,7 +133,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new () => T'. -!!! error TS2430: Construct signature '(x: T): T' expects more arguments than construct signature '(): T'. +!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). a: new (x: T) => T; // error, too many required params } @@ -168,7 +168,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. -!!! error TS2430: Construct signature '(x: T, y: T): T' expects more arguments than construct signature '(x: T): T'. +!!! error TS2430: The source signature requires more arguments (2) than are provided by the target (1). a3: new (x: T, y: T) => T; // error, too many required params } @@ -243,7 +243,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new () => T'. -!!! error TS2430: Construct signature '(x: T): T' expects more arguments than construct signature '(): T'. +!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). a: new (x: T) => T; } @@ -322,7 +322,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. -!!! error TS2430: Construct signature '(x: T, y: T): T' expects more arguments than construct signature '(x: T): T'. +!!! error TS2430: The source signature requires more arguments (2) than are provided by the target (1). a3: new (x: T, y: T) => T; } @@ -445,7 +445,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new () => T'. -!!! error TS2430: Construct signature '(x: T): T' expects more arguments than construct signature '(): T'. +!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). a: new (x: T) => T; // error, not identical and contextual signature instatiation can't make inference from T to T } @@ -480,7 +480,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. -!!! error TS2430: Construct signature '(x: T, y: T): T' expects more arguments than construct signature '(x: T): T'. +!!! error TS2430: The source signature requires more arguments (2) than are provided by the target (1). a3: new (x: T, y: T) => T; // error, too many required params } diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt index 90a56dab7b3d6..27c1703513a46 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/jsx/file.tsx(8,15): error TS2322: Type 'T & { "ignore-pr tests/cases/conformance/jsx/file.tsx(13,15): error TS2322: Type 'T' is not assignable to type 'IntrinsicAttributes & { prop: unknown; "ignore-prop": string; }'. Type 'T' is not assignable to type '{ prop: unknown; "ignore-prop": string; }'. tests/cases/conformance/jsx/file.tsx(20,19): error TS2322: Type '(a: number, b: string) => void' is not assignable to type '(arg: number) => void'. - Call signature '(a: number, b: string): void' expects more arguments than call signature '(arg: number): void'. + The source signature requires more arguments (2) than are provided by the target (1). tests/cases/conformance/jsx/file.tsx(31,52): error TS2322: Type '(val: string) => void' is not assignable to type '(selectedVal: number) => void'. Types of parameters 'val' and 'selectedVal' are incompatible. Type 'number' is not assignable to type 'string'. @@ -44,7 +44,7 @@ tests/cases/conformance/jsx/file.tsx(31,52): error TS2322: Type '(val: string) = let o = ~~~~ !!! error TS2322: Type '(a: number, b: string) => void' is not assignable to type '(arg: number) => void'. -!!! error TS2322: Call signature '(a: number, b: string): void' expects more arguments than call signature '(arg: number): void'. +!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). !!! related TS6500 tests/cases/conformance/jsx/file.tsx:16:30: The expected type comes from property 'func' which is declared here on type 'IntrinsicAttributes & { func: (arg: number) => void; }' } diff --git a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt index d0fbe472215e0..9402ab69f8f87 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt +++ b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt @@ -27,7 +27,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(84,1): Type predicate 'p2 is A' is not assignable to 'p1 is A'. Parameter 'p2' is not in the same position as parameter 'p1'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(90,1): error TS2322: Type '(p1: any, p2: any, p3: any) => p1 is A' is not assignable to type '(p1: any, p2: any) => p1 is A'. - Call signature '(p1: any, p2: any, p3: any): p1 is A' expects more arguments than call signature '(p1: any, p2: any): p1 is A'. + The source signature requires more arguments (3) than are provided by the target (2). tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(95,9): error TS2749: 'b' refers to a value, but is being used as a type here. Did you mean 'typeof b'? tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(95,11): error TS1005: ',' expected. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(95,14): error TS1005: ',' expected. @@ -212,7 +212,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(166,54 assign3 = function(p1, p2, p3): p1 is A { ~~~~~~~ !!! error TS2322: Type '(p1: any, p2: any, p3: any) => p1 is A' is not assignable to type '(p1: any, p2: any) => p1 is A'. -!!! error TS2322: Call signature '(p1: any, p2: any, p3: any): p1 is A' expects more arguments than call signature '(p1: any, p2: any): p1 is A'. +!!! error TS2322: The source signature requires more arguments (3) than are provided by the target (2). return true; }; From 44c1d6f7f9929e2b2f95abf3a95f092920add46f Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Sat, 12 Nov 2022 14:37:46 -0800 Subject: [PATCH 08/12] change assert to runtime test --- src/compiler/checker.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2e58b779eb451..ac8d4188907de 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -18480,8 +18480,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const sourceHasMoreParameters = !hasEffectiveRestParameter(target) && (checkMode & SignatureCheckMode.StrictArity ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount); if (sourceHasMoreParameters) { - if (reportErrors) { - Debug.assert(!(checkMode & SignatureCheckMode.StrictArity), "no error reporting when comparing signatures by strict arity, which is only done for subtype reduction"); + if (reportErrors && !(checkMode & SignatureCheckMode.StrictArity)) { + // the second condition should be redundant, because there is no error reporting when comparing signatures by strict arity + // since it is only done for subtype reduction errorReporter!(Diagnostics.The_source_signature_requires_more_arguments_0_than_are_provided_by_the_target_1, getMinArgumentCount(source), targetCount.toString()); } return Ternary.False; From edb8842b2db51a147b3b3b23ff3061c687fa786f Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Wed, 15 Feb 2023 16:52:21 -0800 Subject: [PATCH 09/12] update baselines --- .../tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js b/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js index 27ced28860c73..04a776a9f3ffb 100644 --- a/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js +++ b/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js @@ -1156,6 +1156,7 @@ Info 32 [00:01:13.000] response: "2843", "2844", "2846", + "2847", "4000", "4002", "4004", From 2ec58eadc5ba4bd44af8fad7dec1190cbad98e94 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Fri, 17 Mar 2023 15:54:16 -0700 Subject: [PATCH 10/12] switch error message --- src/compiler/checker.ts | 2 +- src/compiler/diagnosticMessages.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index fa01b9d6930d9..d7e4de7050a6c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19796,7 +19796,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (reportErrors && !(checkMode & SignatureCheckMode.StrictArity)) { // the second condition should be redundant, because there is no error reporting when comparing signatures by strict arity // since it is only done for subtype reduction - errorReporter!(Diagnostics.The_source_signature_requires_more_arguments_0_than_are_provided_by_the_target_1, getMinArgumentCount(source), targetCount.toString()); + errorReporter!(Diagnostics.Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1, getMinArgumentCount(source), targetCount.toString()); } return Ternary.False; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index cf7c7445c93b1..a72154ed1ca85 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3619,7 +3619,7 @@ "category": "Error", "code": 2848 }, - "The source signature requires more arguments ({0}) than are provided by the target ({1}).": { + "Target signature provides too few arguments. Expected {0} or more, but got {1}.": { "category": "Error", "code": 2849 }, From 3f74ead6530a6dc67804e2bae12c7ae9eccc1df5 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Fri, 17 Mar 2023 16:00:11 -0700 Subject: [PATCH 11/12] rebaseline --- ...addMoreOverloadsToBaseSignature.errors.txt | 4 +- .../arrowFunctionErrorSpan.errors.txt | 8 +-- ...ignaturesWithOptionalParameters.errors.txt | 28 ++++---- ...ignaturesWithOptionalParameters.errors.txt | 20 +++--- ...ignaturesWithOptionalParameters.errors.txt | 24 +++---- .../assignmentCompatability44.errors.txt | 4 +- .../assignmentCompatability45.errors.txt | 4 +- .../reference/checkJsdocTypeTag6.errors.txt | 12 ++-- ...assCanExtendConstructorFunction.errors.txt | 4 +- .../classSideInheritance3.errors.txt | 8 +-- .../reference/covariantCallbacks.errors.txt | 4 +- .../derivedInterfaceCallSignature.errors.txt | 4 +- ...functionConstraintSatisfaction2.errors.txt | 4 +- ...lWithConstructorTypedArguments5.errors.txt | 8 +-- ...CallWithFunctionTypedArguments5.errors.txt | 8 +-- ...oadedConstructorTypedArguments2.errors.txt | 4 +- ...erloadedFunctionTypedArguments2.errors.txt | 4 +- .../reference/incompatibleTypes.errors.txt | 4 +- .../reference/inferTypes1.errors.txt | 4 +- .../reference/inheritance.errors.txt | 4 +- .../reference/lambdaArgCrash.errors.txt | 4 +- .../reference/multipleInheritance.errors.txt | 4 +- ...ralFunctionArgContextualTyping2.errors.txt | 12 ++-- .../baselines/reference/parseTypes.errors.txt | 8 +-- ...AnnotatedFunctionInferenceError.errors.txt | 12 ++-- .../reference/promisePermutations.errors.txt | 64 +++++++++---------- .../reference/promisePermutations2.errors.txt | 64 +++++++++---------- .../reference/promisePermutations3.errors.txt | 64 +++++++++---------- .../requiredInitializedParameter2.errors.txt | 4 +- ...edTypeContextualTypeNotCircular.errors.txt | 4 +- .../signatureLengthMismatchCall.errors.txt | 4 +- ...gnatureLengthMismatchInOverload.errors.txt | 4 +- ...hMismatchWithOptionalParameters.errors.txt | 4 +- ...ignaturesWithOptionalParameters.errors.txt | 8 +-- ...ignaturesWithOptionalParameters.errors.txt | 8 +-- ...ignaturesWithOptionalParameters.errors.txt | 24 +++---- ...ignaturesWithOptionalParameters.errors.txt | 24 +++---- ...ionComponentsWithTypeArguments2.errors.txt | 4 +- .../typeGuardFunctionErrors.errors.txt | 4 +- 39 files changed, 244 insertions(+), 244 deletions(-) diff --git a/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt b/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt index 725fc9f22f638..dc6b00bdb8ea6 100644 --- a/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt +++ b/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/addMoreOverloadsToBaseSignature.ts(5,11): error TS2430: Interface 'Bar' incorrectly extends interface 'Foo'. Types of property 'f' are incompatible. Type '(key: string) => string' is not assignable to type '() => string'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. ==== tests/cases/compiler/addMoreOverloadsToBaseSignature.ts (1 errors) ==== @@ -14,7 +14,7 @@ tests/cases/compiler/addMoreOverloadsToBaseSignature.ts(5,11): error TS2430: Int !!! error TS2430: Interface 'Bar' incorrectly extends interface 'Foo'. !!! error TS2430: Types of property 'f' are incompatible. !!! error TS2430: Type '(key: string) => string' is not assignable to type '() => string'. -!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0. f(key: string): string; } \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionErrorSpan.errors.txt b/tests/baselines/reference/arrowFunctionErrorSpan.errors.txt index 37e02b506766f..07e49c757b623 100644 --- a/tests/baselines/reference/arrowFunctionErrorSpan.errors.txt +++ b/tests/baselines/reference/arrowFunctionErrorSpan.errors.txt @@ -8,7 +8,7 @@ tests/cases/compiler/arrowFunctionErrorSpan.ts(17,3): error TS2345: Argument of Type 'void' is not assignable to type 'number'. tests/cases/compiler/arrowFunctionErrorSpan.ts(18,5): error TS1200: Line terminator not permitted before arrow. tests/cases/compiler/arrowFunctionErrorSpan.ts(21,3): error TS2345: Argument of type '(a: any, b: any, c: any, d: any) => void' is not assignable to parameter of type '() => number'. - The source signature requires more arguments (4) than are provided by the target (0). + Target signature provides too few arguments. Expected 4 or more, but got 0. tests/cases/compiler/arrowFunctionErrorSpan.ts(28,7): error TS2345: Argument of type '() => void' is not assignable to parameter of type '() => number'. Type 'void' is not assignable to type 'number'. tests/cases/compiler/arrowFunctionErrorSpan.ts(32,7): error TS2345: Argument of type '() => void' is not assignable to parameter of type '() => number'. @@ -18,7 +18,7 @@ tests/cases/compiler/arrowFunctionErrorSpan.ts(36,7): error TS2345: Argument of tests/cases/compiler/arrowFunctionErrorSpan.ts(43,5): error TS2345: Argument of type '() => void' is not assignable to parameter of type '() => number'. Type 'void' is not assignable to type 'number'. tests/cases/compiler/arrowFunctionErrorSpan.ts(52,3): error TS2345: Argument of type '(_: any) => number' is not assignable to parameter of type '() => number'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. ==== tests/cases/compiler/arrowFunctionErrorSpan.ts (11 errors) ==== @@ -66,7 +66,7 @@ tests/cases/compiler/arrowFunctionErrorSpan.ts(52,3): error TS2345: Argument of d) => { }); ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(a: any, b: any, c: any, d: any) => void' is not assignable to parameter of type '() => number'. -!!! error TS2345: The source signature requires more arguments (4) than are provided by the target (0). +!!! error TS2345: Target signature provides too few arguments. Expected 4 or more, but got 0. // single line with a comment f(/* @@ -111,5 +111,5 @@ tests/cases/compiler/arrowFunctionErrorSpan.ts(52,3): error TS2345: Argument of 2); ~~~~~ !!! error TS2345: Argument of type '(_: any) => number' is not assignable to parameter of type '() => number'. -!!! error TS2345: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2345: Target signature provides too few arguments. Expected 1 or more, but got 0. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt index f56de5c04f9d2..7f73c916eb8cc 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt @@ -1,17 +1,17 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(16,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(20,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(22,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '() => number'. - The source signature requires more arguments (2) than are provided by the target (0). + Target signature provides too few arguments. Expected 2 or more, but got 0. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(33,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(39,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(45,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts (7 errors) ==== @@ -33,22 +33,22 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = (x: number) => 1; // error, too many required params ~ !!! error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. a = b.a; // ok a = b.a2; // ok a = b.a3; // error ~ !!! error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. a = b.a4; // error ~ !!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. a = b.a5; // ok a = b.a6; // error ~ !!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '() => number'. -!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 0. var a2: (x?: number) => number; a2 = () => 1; // ok, same number of required params @@ -62,7 +62,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = b.a6; // error ~~ !!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. -!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1. var a3: (x: number) => number; a3 = () => 1; // ok, fewer required params @@ -71,7 +71,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = (x: number, y: number) => 1; // error, too many required params ~~ !!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. -!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1. a3 = b.a; // ok a3 = b.a2; // ok a3 = b.a3; // ok @@ -80,7 +80,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = b.a6; // error ~~ !!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. -!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1. var a4: (x: number, y?: number) => number; a4 = () => 1; // ok, fewer required params diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt index 84e0f1773e8af..236c5191f8d5c 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt @@ -1,13 +1,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(16,5): error TS2322: Type 'new (x: number) => number' is not assignable to type 'new () => number'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(17,5): error TS2322: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. - The source signature requires more arguments (2) than are provided by the target (0). + Target signature provides too few arguments. Expected 2 or more, but got 0. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(27,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(35,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts (5 errors) ==== @@ -29,16 +29,16 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b.a3; // error ~ !!! error TS2322: Type 'new (x: number) => number' is not assignable to type 'new () => number'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. a = b.a4; // error ~ !!! error TS2322: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. a = b.a5; // ok a = b.a6; // error ~ !!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. -!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 0. var a2: new (x?: number) => number; a2 = b.a; // ok @@ -49,7 +49,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = b.a6; // error ~~ !!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. -!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1. var a3: new (x: number) => number; a3 = b.a; // ok @@ -60,7 +60,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = b.a6; // error ~~ !!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. -!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1. var a4: new (x: number, y?: number) => number; a4 = b.a; // ok diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt index d4119b5ae412a..51b59d71176f7 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(14,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(23,13): error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(63,9): error TS2322: Type '() => T' is not assignable to type '() => T'. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'. @@ -9,9 +9,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(65,9): error TS2322: Type '(x: T) => T' is not assignable to type '() => T'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(66,9): error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '() => T'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(67,9): error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '() => T'. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'. @@ -92,9 +92,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(107,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(116,13): error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts (29 errors) ==== @@ -114,7 +114,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a = (x: T) => null; // error, too many required params ~~~~~~ !!! error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. this.a2 = () => null; // ok, same T of required params this.a2 = (x?: T) => null; // ok, same T of required params @@ -126,7 +126,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a3 = (x: T, y: T) => null; // error, too many required params ~~~~~~~ !!! error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. -!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1. this.a4 = () => null; // ok, fewer required params this.a4 = (x?: T, y?: T) => null; // ok, fewer required params @@ -181,11 +181,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme b.a = t.a3; ~~~ !!! error TS2322: Type '(x: T) => T' is not assignable to type '() => T'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. b.a = t.a4; ~~~ !!! error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '() => T'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. b.a = t.a5; ~~~ !!! error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '() => T'. @@ -350,7 +350,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a = (x: T) => null; // error, too many required params ~~~~~~ !!! error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. this.a2 = () => null; // ok, same T of required params this.a2 = (x?: T) => null; // ok, same T of required params @@ -362,7 +362,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a3 = (x: T, y: T) => null; // error, too many required params ~~~~~~~ !!! error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. -!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1. this.a4 = () => null; // ok, fewer required params this.a4 = (x?: T, y?: T) => null; // ok, fewer required params diff --git a/tests/baselines/reference/assignmentCompatability44.errors.txt b/tests/baselines/reference/assignmentCompatability44.errors.txt index 20ff5e077cf7e..030b8c5da1e6d 100644 --- a/tests/baselines/reference/assignmentCompatability44.errors.txt +++ b/tests/baselines/reference/assignmentCompatability44.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/assignmentCompatability44.ts(5,7): error TS2322: Type 'typeof Foo' is not assignable to type 'new () => Foo'. Types of construct signatures are incompatible. Type 'new (x: number) => Foo' is not assignable to type 'new () => Foo'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. ==== tests/cases/compiler/assignmentCompatability44.ts (1 errors) ==== @@ -14,5 +14,5 @@ tests/cases/compiler/assignmentCompatability44.ts(5,7): error TS2322: Type 'type !!! error TS2322: Type 'typeof Foo' is not assignable to type 'new () => Foo'. !!! error TS2322: Types of construct signatures are incompatible. !!! error TS2322: Type 'new (x: number) => Foo' is not assignable to type 'new () => Foo'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability45.errors.txt b/tests/baselines/reference/assignmentCompatability45.errors.txt index 0fce9541c8488..a21de76d3db13 100644 --- a/tests/baselines/reference/assignmentCompatability45.errors.txt +++ b/tests/baselines/reference/assignmentCompatability45.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/assignmentCompatability45.ts(7,7): error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. Types of construct signatures are incompatible. Type 'new (x: number) => B' is not assignable to type 'abstract new () => A'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. ==== tests/cases/compiler/assignmentCompatability45.ts (1 errors) ==== @@ -16,5 +16,5 @@ tests/cases/compiler/assignmentCompatability45.ts(7,7): error TS2322: Type 'type !!! error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. !!! error TS2322: Types of construct signatures are incompatible. !!! error TS2322: Type 'new (x: number) => B' is not assignable to type 'abstract new () => A'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. \ No newline at end of file diff --git a/tests/baselines/reference/checkJsdocTypeTag6.errors.txt b/tests/baselines/reference/checkJsdocTypeTag6.errors.txt index bf19f1afc1ca2..762128117ce54 100644 --- a/tests/baselines/reference/checkJsdocTypeTag6.errors.txt +++ b/tests/baselines/reference/checkJsdocTypeTag6.errors.txt @@ -3,11 +3,11 @@ tests/cases/conformance/jsdoc/test.js(7,5): error TS2322: Type '(prop: any) => v tests/cases/conformance/jsdoc/test.js(10,12): error TS8030: The type of a function declaration must match the function's signature. tests/cases/conformance/jsdoc/test.js(23,12): error TS8030: The type of a function declaration must match the function's signature. tests/cases/conformance/jsdoc/test.js(27,7): error TS2322: Type '(more: any) => void' is not assignable to type '() => void'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/jsdoc/test.js(30,7): error TS2322: Type '(more: any) => void' is not assignable to type '() => void'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/jsdoc/test.js(34,3): error TS2322: Type '(more: any) => void' is not assignable to type '() => void'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. ==== tests/cases/conformance/jsdoc/test.js (7 errors) ==== @@ -48,19 +48,19 @@ tests/cases/conformance/jsdoc/test.js(34,3): error TS2322: Type '(more: any) => const variableWithMoreParameters = function (more) {}; // error ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type '(more: any) => void' is not assignable to type '() => void'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. /** @type {() => void} */ const arrowWithMoreParameters = (more) => {}; // error ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type '(more: any) => void' is not assignable to type '() => void'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. ({ /** @type {() => void} */ methodWithMoreParameters(more) {}, // error ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type '(more: any) => void' is not assignable to type '() => void'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. }); \ No newline at end of file diff --git a/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt b/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt index 6249d18c86b6c..549ea32ebb213 100644 --- a/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt +++ b/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/salsa/first.js(23,9): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/salsa/first.js(31,5): error TS2416: Property 'load' in type 'Sql' is not assignable to the same property in base type 'Wagon'. Type '(files: string[], format: "csv" | "json" | "xmlolololol") => void' is not assignable to type '(supplies?: any[]) => void'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. tests/cases/conformance/salsa/first.js(47,24): error TS2507: Type '(numberEaten: number) => void' is not a constructor function type. tests/cases/conformance/salsa/generic.js(19,19): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/salsa/generic.js(20,32): error TS2345: Argument of type 'number' is not assignable to parameter of type '{ claim: "ignorant" | "malicious"; }'. @@ -53,7 +53,7 @@ tests/cases/conformance/salsa/second.ts(17,15): error TS2345: Argument of type ' ~~~~ !!! error TS2416: Property 'load' in type 'Sql' is not assignable to the same property in base type 'Wagon'. !!! error TS2416: Type '(files: string[], format: "csv" | "json" | "xmlolololol") => void' is not assignable to type '(supplies?: any[]) => void'. -!!! error TS2416: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2416: Target signature provides too few arguments. Expected 2 or more, but got 1. if (format === "xmlolololol") { throw new Error("please do not use XML. It was a joke."); } diff --git a/tests/baselines/reference/classSideInheritance3.errors.txt b/tests/baselines/reference/classSideInheritance3.errors.txt index 82a7fbaab6e23..3a973835e7f31 100644 --- a/tests/baselines/reference/classSideInheritance3.errors.txt +++ b/tests/baselines/reference/classSideInheritance3.errors.txt @@ -1,11 +1,11 @@ tests/cases/compiler/classSideInheritance3.ts(16,5): error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. Types of construct signatures are incompatible. Type 'new (x: string, data: string) => B' is not assignable to type 'new (x: string) => A'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2322: Type 'typeof B' is not assignable to type 'new (x: string) => A'. Types of construct signatures are incompatible. Type 'new (x: string, data: string) => B' is not assignable to type 'new (x: string) => A'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. ==== tests/cases/compiler/classSideInheritance3.ts (2 errors) ==== @@ -29,11 +29,11 @@ tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2322: Type 'typeof !!! error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. !!! error TS2322: Types of construct signatures are incompatible. !!! error TS2322: Type 'new (x: string, data: string) => B' is not assignable to type 'new (x: string) => A'. -!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1. var r2: new (x: string) => A = B; // error ~~ !!! error TS2322: Type 'typeof B' is not assignable to type 'new (x: string) => A'. !!! error TS2322: Types of construct signatures are incompatible. !!! error TS2322: Type 'new (x: string, data: string) => B' is not assignable to type 'new (x: string) => A'. -!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1. var r3: typeof A = C; // ok \ No newline at end of file diff --git a/tests/baselines/reference/covariantCallbacks.errors.txt b/tests/baselines/reference/covariantCallbacks.errors.txt index 428d79cc720af..19edd9745b4ce 100644 --- a/tests/baselines/reference/covariantCallbacks.errors.txt +++ b/tests/baselines/reference/covariantCallbacks.errors.txt @@ -16,7 +16,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covarian Types of property 'forEach' are incompatible. Type '(cb: (item: A) => void) => void' is not assignable to type '(cb: (item: A, context: any) => void) => void'. Types of parameters 'cb' and 'cb' are incompatible. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covariantCallbacks.ts(69,5): error TS2322: Type 'AList4' is not assignable to type 'BList4'. Types of property 'forEach' are incompatible. Type '(cb: (item: A) => A) => void' is not assignable to type '(cb: (item: B) => B) => void'. @@ -106,7 +106,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covarian !!! error TS2322: Types of property 'forEach' are incompatible. !!! error TS2322: Type '(cb: (item: A) => void) => void' is not assignable to type '(cb: (item: A, context: any) => void) => void'. !!! error TS2322: Types of parameters 'cb' and 'cb' are incompatible. -!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1. } interface AList4 { diff --git a/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt b/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt index 355fc4315e3c5..e40fd10ed14bc 100644 --- a/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt +++ b/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/derivedInterfaceCallSignature.ts(11,11): error TS2430: Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath'. Types of property 'x' are incompatible. Type '(x: (data: any, index?: number) => number) => D3SvgArea' is not assignable to type '() => (data: any, index?: number) => number'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. ==== tests/cases/compiler/derivedInterfaceCallSignature.ts (1 errors) ==== @@ -20,7 +20,7 @@ tests/cases/compiler/derivedInterfaceCallSignature.ts(11,11): error TS2430: Inte !!! error TS2430: Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath'. !!! error TS2430: Types of property 'x' are incompatible. !!! error TS2430: Type '(x: (data: any, index?: number) => number) => D3SvgArea' is not assignable to type '() => (data: any, index?: number) => number'. -!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0. x(x: (data: any, index?: number) => number): D3SvgArea; y(y: (data: any, index?: number) => number): D3SvgArea; y0(): (data: any, index?: number) => number; diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt index 650e3691a1818..df8c39dbaa67b 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt +++ b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt @@ -11,7 +11,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(26,15): error TS2345: Argument of type 'new (x: string) => string' is not assignable to parameter of type '(x: string) => string'. Type 'new (x: string) => string' provides no match for the signature '(x: string): string'. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(28,16): error TS2345: Argument of type '(x: U, y: V) => U' is not assignable to parameter of type '(x: string) => string'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(29,16): error TS2345: Argument of type 'typeof C2' is not assignable to parameter of type '(x: string) => string'. Type 'typeof C2' provides no match for the signature '(x: string): string'. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(30,16): error TS2345: Argument of type 'new (x: T) => T' is not assignable to parameter of type '(x: string) => string'. @@ -75,7 +75,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain var r11 = foo2((x: U, y: V) => x); ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: U, y: V) => U' is not assignable to parameter of type '(x: string) => string'. -!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. var r13 = foo2(C2); ~~ !!! error TS2345: Argument of type 'typeof C2' is not assignable to parameter of type '(x: string) => string'. diff --git a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt index 8ff3a77dd505c..9520345d861c6 100644 --- a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt +++ b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts(11,14): error TS2345: Argument of type '{ cb: new (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: unknown) => string; }'. Types of property 'cb' are incompatible. Type 'new (x: T, y: T) => string' is not assignable to type 'new (t: unknown) => string'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts(13,14): error TS2345: Argument of type '{ cb: new (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: new (t: string) => string; }'. Types of property 'cb' are incompatible. Type 'new (x: string, y: number) => string' is not assignable to type 'new (t: string) => string'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts (2 errors) ==== @@ -24,14 +24,14 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithCon !!! error TS2345: Argument of type '{ cb: new (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: unknown) => string; }'. !!! error TS2345: Types of property 'cb' are incompatible. !!! error TS2345: Type 'new (x: T, y: T) => string' is not assignable to type 'new (t: unknown) => string'. -!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. var arg3: { cb: new (x: string, y: number) => string }; var r3 = foo(arg3); // error ~~~~ !!! error TS2345: Argument of type '{ cb: new (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: new (t: string) => string; }'. !!! error TS2345: Types of property 'cb' are incompatible. !!! error TS2345: Type 'new (x: string, y: number) => string' is not assignable to type 'new (t: string) => string'. -!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. function foo2(arg: { cb: new(t: T, t2: T) => U }) { return new arg.cb(null, null); diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt index 58ec2ae672f1b..55b524472d73d 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(10,16): error TS2322: Type '(x: T, y: T) => string' is not assignable to type '(t: unknown) => string'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(11,16): error TS2322: Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts (2 errors) ==== @@ -17,12 +17,12 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun var r2 = foo({ cb: (x: T, y: T) => '' }); // error ~~ !!! error TS2322: Type '(x: T, y: T) => string' is not assignable to type '(t: unknown) => string'. -!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS6500 tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts:3:27: The expected type comes from property 'cb' which is declared here on type '{ cb: (t: unknown) => string; }' var r3 = foo({ cb: (x: string, y: number) => '' }); // error ~~ !!! error TS2322: Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'. -!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS6500 tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts:3:27: The expected type comes from property 'cb' which is declared here on type '{ cb: (t: string) => string; }' function foo2(arg: { cb: (t: T, t2: T) => U }) { diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt index c0db9b1819efc..c1384d44f761b 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments2.ts(31,20): error TS2345: Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: unknown): string; new (x: unknown, y?: unknown): string; }'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments2.ts (1 errors) ==== @@ -36,7 +36,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOve var r10 = foo6(b); // error ~ !!! error TS2345: Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: unknown): string; new (x: unknown, y?: unknown): string; }'. -!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. function foo7(x:T, cb: { new(x: T): string; new(x: T, y?: T): string }) { return cb; diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt index 1507c70004e10..21e853615216e 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments2.ts(28,20): error TS2345: Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: unknown): string; (x: unknown, y?: unknown): string; }'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments2.ts (1 errors) ==== @@ -33,7 +33,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOve var r10 = foo6((x: T, y: T) => ''); // error ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: unknown): string; (x: unknown, y?: unknown): string; }'. -!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { return cb; diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index b767ff9511fdc..4ebfde3786ebe 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -29,7 +29,7 @@ tests/cases/compiler/incompatibleTypes.ts(66,47): error TS2322: Type '{ e: numbe 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 'number' is not assignable to type '() => string'. tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. ==== tests/cases/compiler/incompatibleTypes.ts (9 errors) ==== @@ -149,5 +149,5 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => var fp1: () =>any = a => 0; ~~~ !!! error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. \ No newline at end of file diff --git a/tests/baselines/reference/inferTypes1.errors.txt b/tests/baselines/reference/inferTypes1.errors.txt index 22bdb4b8ef48c..97215b543bb63 100644 --- a/tests/baselines/reference/inferTypes1.errors.txt +++ b/tests/baselines/reference/inferTypes1.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(43,25): error TS2344: T tests/cases/conformance/types/conditional/inferTypes1.ts(44,25): error TS2344: Type 'Function' does not satisfy the constraint 'abstract new (...args: any) => any'. Type 'Function' provides no match for the signature 'new (...args: any): any'. tests/cases/conformance/types/conditional/inferTypes1.ts(55,25): error TS2344: Type '(x: string, y: string) => number' does not satisfy the constraint '(x: any) => any'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. tests/cases/conformance/types/conditional/inferTypes1.ts(56,25): error TS2344: Type 'Function' does not satisfy the constraint '(x: any) => any'. Type 'Function' provides no match for the signature '(x: any): any'. tests/cases/conformance/types/conditional/inferTypes1.ts(82,12): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type. @@ -89,7 +89,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(153,40): error TS2322: type T24 = ArgumentType<(x: string, y: string) => number>; // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2344: Type '(x: string, y: string) => number' does not satisfy the constraint '(x: any) => any'. -!!! error TS2344: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2344: Target signature provides too few arguments. Expected 2 or more, but got 1. type T25 = ArgumentType; // Error ~~~~~~~~ !!! error TS2344: Type 'Function' does not satisfy the constraint '(x: any) => any'. diff --git a/tests/baselines/reference/inheritance.errors.txt b/tests/baselines/reference/inheritance.errors.txt index 7e328ac2b9724..b29966fba8db6 100644 --- a/tests/baselines/reference/inheritance.errors.txt +++ b/tests/baselines/reference/inheritance.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/inheritance.ts(31,12): error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. tests/cases/compiler/inheritance.ts(32,12): error TS2416: Property 'g' in type 'Baad' is not assignable to the same property in base type 'Good'. Type '(n: number) => number' is not assignable to type '() => number'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. ==== tests/cases/compiler/inheritance.ts (2 errors) ==== @@ -42,6 +42,6 @@ tests/cases/compiler/inheritance.ts(32,12): error TS2416: Property 'g' in type ' ~ !!! error TS2416: Property 'g' in type 'Baad' is not assignable to the same property in base type 'Good'. !!! error TS2416: Type '(n: number) => number' is not assignable to type '() => number'. -!!! error TS2416: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2416: Target signature provides too few arguments. Expected 1 or more, but got 0. } \ No newline at end of file diff --git a/tests/baselines/reference/lambdaArgCrash.errors.txt b/tests/baselines/reference/lambdaArgCrash.errors.txt index 5bdda79452c07..560dde9bb7a0f 100644 --- a/tests/baselines/reference/lambdaArgCrash.errors.txt +++ b/tests/baselines/reference/lambdaArgCrash.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/lambdaArgCrash.ts(27,25): error TS2304: Cannot find name 'ItemSet'. tests/cases/compiler/lambdaArgCrash.ts(29,14): error TS2345: Argument of type '(items: ItemSet) => void' is not assignable to parameter of type '() => any'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. ==== tests/cases/compiler/lambdaArgCrash.ts (2 errors) ==== @@ -37,7 +37,7 @@ tests/cases/compiler/lambdaArgCrash.ts(29,14): error TS2345: Argument of type '( super.add(listener); ~~~~~~~~ !!! error TS2345: Argument of type '(items: ItemSet) => void' is not assignable to parameter of type '() => any'. -!!! error TS2345: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2345: Target signature provides too few arguments. Expected 1 or more, but got 0. } diff --git a/tests/baselines/reference/multipleInheritance.errors.txt b/tests/baselines/reference/multipleInheritance.errors.txt index e105c70c23086..133d9a697e7a2 100644 --- a/tests/baselines/reference/multipleInheritance.errors.txt +++ b/tests/baselines/reference/multipleInheritance.errors.txt @@ -3,7 +3,7 @@ tests/cases/compiler/multipleInheritance.ts(18,21): error TS1174: Classes can on tests/cases/compiler/multipleInheritance.ts(35,12): error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. tests/cases/compiler/multipleInheritance.ts(36,12): error TS2416: Property 'g' in type 'Baad' is not assignable to the same property in base type 'Good'. Type '(n: number) => number' is not assignable to type '() => number'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. ==== tests/cases/compiler/multipleInheritance.ts (4 errors) ==== @@ -52,6 +52,6 @@ tests/cases/compiler/multipleInheritance.ts(36,12): error TS2416: Property 'g' i ~ !!! error TS2416: Property 'g' in type 'Baad' is not assignable to the same property in base type 'Good'. !!! error TS2416: Type '(n: number) => number' is not assignable to type '() => number'. -!!! error TS2416: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2416: Target signature provides too few arguments. Expected 1 or more, but got 0. } \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt index daf89a7e66811..f6645716915dc 100644 --- a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt +++ b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt @@ -5,11 +5,11 @@ tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(9,4): error TS tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(10,17): error TS2345: Argument of type '{ value: string; what: number; }' is not assignable to parameter of type 'I2'. Object literal may only specify known properties, and 'what' does not exist in type 'I2'. tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(11,6): error TS2322: Type '(s: any) => any' is not assignable to type '() => string'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(12,6): error TS2322: Type '(s: string) => string' is not assignable to type '() => string'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(13,17): error TS2322: Type '(s: any) => any' is not assignable to type '() => string'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. ==== tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts (6 errors) ==== @@ -36,12 +36,12 @@ tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(13,17): error f2({ toString: (s) => s }) ~~~~~~~~ !!! error TS2322: Type '(s: any) => any' is not assignable to type '() => string'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. f2({ toString: (s: string) => s }) ~~~~~~~~ !!! error TS2322: Type '(s: string) => string' is not assignable to type '() => string'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. f2({ value: '', toString: (s) => s.uhhh }) ~~~~~~~~ !!! error TS2322: Type '(s: any) => any' is not assignable to type '() => string'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). \ No newline at end of file +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. \ No newline at end of file diff --git a/tests/baselines/reference/parseTypes.errors.txt b/tests/baselines/reference/parseTypes.errors.txt index dea60fe20c310..9fbd9334da162 100644 --- a/tests/baselines/reference/parseTypes.errors.txt +++ b/tests/baselines/reference/parseTypes.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/parseTypes.ts(8,1): error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/compiler/parseTypes.ts(9,1): error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/compiler/parseTypes.ts(10,1): error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'. Index signature for type 'number' is missing in type '(s: string) => void'. tests/cases/compiler/parseTypes.ts(11,1): error TS2322: Type '(s: string) => void' is not assignable to type 'new () => number'. @@ -19,11 +19,11 @@ tests/cases/compiler/parseTypes.ts(11,1): error TS2322: Type '(s: string) => voi y=g; ~ !!! error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. x=g; ~ !!! error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. -!!! error TS2322: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. w=g; ~ !!! error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'. diff --git a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.errors.txt b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.errors.txt index 5c7049a9afabd..2f970037eabdd 100644 --- a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.errors.txt +++ b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partiallyAnnotatedFunctionInferenceError.ts(12,11): error TS2345: Argument of type '(t1: D, t2: any, t3: any) => void' is not assignable to parameter of type '(t: any, t1: any) => void'. - The source signature requires more arguments (3) than are provided by the target (2). + Target signature provides too few arguments. Expected 3 or more, but got 2. tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partiallyAnnotatedFunctionInferenceError.ts(13,11): error TS2345: Argument of type '(t1: any, t2: D, t3: any) => void' is not assignable to parameter of type '(t: any, t1: any) => void'. - The source signature requires more arguments (3) than are provided by the target (2). + Target signature provides too few arguments. Expected 3 or more, but got 2. tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partiallyAnnotatedFunctionInferenceError.ts(14,11): error TS2345: Argument of type '(t1: any, t2: any, t3: D) => void' is not assignable to parameter of type '(t: any, t1: any) => void'. - The source signature requires more arguments (3) than are provided by the target (2). + Target signature provides too few arguments. Expected 3 or more, but got 2. ==== tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partiallyAnnotatedFunctionInferenceError.ts (3 errors) ==== @@ -21,13 +21,13 @@ tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partial testError((t1: D, t2, t3) => {}) ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(t1: D, t2: any, t3: any) => void' is not assignable to parameter of type '(t: any, t1: any) => void'. -!!! error TS2345: The source signature requires more arguments (3) than are provided by the target (2). +!!! error TS2345: Target signature provides too few arguments. Expected 3 or more, but got 2. testError((t1, t2: D, t3) => {}) ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(t1: any, t2: D, t3: any) => void' is not assignable to parameter of type '(t: any, t1: any) => void'. -!!! error TS2345: The source signature requires more arguments (3) than are provided by the target (2). +!!! error TS2345: Target signature provides too few arguments. Expected 3 or more, but got 2. testError((t1, t2, t3: D) => {}) ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(t1: any, t2: any, t3: D) => void' is not assignable to parameter of type '(t: any, t1: any) => void'. -!!! error TS2345: The source signature requires more arguments (3) than are provided by the target (2). +!!! error TS2345: Target signature provides too few arguments. Expected 3 or more, but got 2. \ No newline at end of file diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index c2666f33cf08c..5e05243f8bf4e 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -26,35 +26,35 @@ tests/cases/compiler/promisePermutations.ts(84,19): error TS2769: No overload ma 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. @@ -76,23 +76,23 @@ tests/cases/compiler/promisePermutations.ts(111,19): error TS2769: No overload m 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. @@ -101,15 +101,15 @@ tests/cases/compiler/promisePermutations.ts(129,33): error TS2769: No overload m 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. @@ -274,7 +274,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! 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; @@ -283,21 +283,21 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! 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 @@ -307,7 +307,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! 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; @@ -316,21 +316,21 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! 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 @@ -377,7 +377,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! 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; @@ -386,21 +386,21 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! 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 @@ -410,7 +410,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! 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 @@ -429,21 +429,21 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! 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 diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index 6ba8eb4ce83e0..fb5ac870ab1ef 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -18,23 +18,23 @@ tests/cases/compiler/promisePermutations2.ts(83,19): error TS2345: Argument of t 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. @@ -56,28 +56,28 @@ tests/cases/compiler/promisePermutations2.ts(110,19): error TS2769: No overload 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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 TS2769: No overload matches this call. @@ -219,22 +219,22 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! 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 ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. 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 TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. 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 TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; @@ -243,22 +243,22 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! 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 ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. 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 TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. 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 TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; @@ -304,22 +304,22 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! 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 ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. 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 TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. 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 TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; @@ -328,7 +328,7 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! 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 @@ -345,15 +345,15 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of 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 TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. 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 TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. 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 TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index fc89ef1124c0e..ed5fc6577ee01 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -25,33 +25,33 @@ tests/cases/compiler/promisePermutations3.ts(83,19): error TS2769: No overload m 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. @@ -63,36 +63,36 @@ 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. 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'. @@ -253,7 +253,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of 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 TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error @@ -261,21 +261,21 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! 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 @@ -283,7 +283,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of 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 TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error @@ -291,21 +291,21 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! 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 @@ -338,7 +338,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of 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 TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error @@ -346,21 +346,21 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! 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 @@ -368,7 +368,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of 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 TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // error @@ -383,21 +383,21 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ~~~~~~~~~~~~~~ !!! 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'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! 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 diff --git a/tests/baselines/reference/requiredInitializedParameter2.errors.txt b/tests/baselines/reference/requiredInitializedParameter2.errors.txt index 570d328e65b3c..1e786a8eb7669 100644 --- a/tests/baselines/reference/requiredInitializedParameter2.errors.txt +++ b/tests/baselines/reference/requiredInitializedParameter2.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/requiredInitializedParameter2.ts(6,5): error TS2416: Property 'method' in type 'C1' is not assignable to the same property in base type 'I1'. Type '(a: number, b: any) => void' is not assignable to type '() => any'. - The source signature requires more arguments (2) than are provided by the target (0). + Target signature provides too few arguments. Expected 2 or more, but got 0. ==== tests/cases/compiler/requiredInitializedParameter2.ts (1 errors) ==== @@ -13,5 +13,5 @@ tests/cases/compiler/requiredInitializedParameter2.ts(6,5): error TS2416: Proper ~~~~~~ !!! error TS2416: Property 'method' in type 'C1' is not assignable to the same property in base type 'I1'. !!! error TS2416: Type '(a: number, b: any) => void' is not assignable to type '() => any'. -!!! error TS2416: The source signature requires more arguments (2) than are provided by the target (0). +!!! error TS2416: Target signature provides too few arguments. Expected 2 or more, but got 0. } \ No newline at end of file diff --git a/tests/baselines/reference/reverseMappedTypeContextualTypeNotCircular.errors.txt b/tests/baselines/reference/reverseMappedTypeContextualTypeNotCircular.errors.txt index 6ccefb972541c..ef1df41caec22 100644 --- a/tests/baselines/reference/reverseMappedTypeContextualTypeNotCircular.errors.txt +++ b/tests/baselines/reference/reverseMappedTypeContextualTypeNotCircular.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/reverseMappedTypeContextualTypeNotCircular.ts(10,3): error TS2322: Type '(state: any, props: any) => {}' is not assignable to type 'Selector'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. ==== tests/cases/compiler/reverseMappedTypeContextualTypeNotCircular.ts (1 errors) ==== @@ -15,6 +15,6 @@ tests/cases/compiler/reverseMappedTypeContextualTypeNotCircular.ts(10,3): error editable: (state: any, props: any) => editable(), // expect "Type '(state: any, props: any) => {}' is not assignable to type 'Selector'", _not_ a circularity error ~~~~~~~~ !!! error TS2322: Type '(state: any, props: any) => {}' is not assignable to type 'Selector'. -!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS6500 tests/cases/compiler/reverseMappedTypeContextualTypeNotCircular.ts:10:3: The expected type comes from property 'editable' which is declared here on type '{ editable: Selector; }' }); \ No newline at end of file diff --git a/tests/baselines/reference/signatureLengthMismatchCall.errors.txt b/tests/baselines/reference/signatureLengthMismatchCall.errors.txt index c37fb27d744ff..86d0fb96889da 100644 --- a/tests/baselines/reference/signatureLengthMismatchCall.errors.txt +++ b/tests/baselines/reference/signatureLengthMismatchCall.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/signatureLengthMismatchCall.ts(5,15): error TS2345: Argument of type '(a: number, b: number) => void' is not assignable to parameter of type '(a: number) => void'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. ==== tests/cases/compiler/signatureLengthMismatchCall.ts (1 errors) ==== @@ -10,5 +10,5 @@ tests/cases/compiler/signatureLengthMismatchCall.ts(5,15): error TS2345: Argumen takesCallback((a: number, b: number) => {}); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(a: number, b: number) => void' is not assignable to parameter of type '(a: number) => void'. -!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. \ No newline at end of file diff --git a/tests/baselines/reference/signatureLengthMismatchInOverload.errors.txt b/tests/baselines/reference/signatureLengthMismatchInOverload.errors.txt index 56830e6d63153..cc315cb156f5c 100644 --- a/tests/baselines/reference/signatureLengthMismatchInOverload.errors.txt +++ b/tests/baselines/reference/signatureLengthMismatchInOverload.errors.txt @@ -5,7 +5,7 @@ tests/cases/compiler/signatureLengthMismatchInOverload.ts(5,3): error TS2769: No Type 'string' is not assignable to type 'number'. Overload 2 of 2, '(callback: (arg: number) => void): void', gave the following error. Argument of type '(arg: number, arg2: number) => void' is not assignable to parameter of type '(arg: number) => void'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. ==== tests/cases/compiler/signatureLengthMismatchInOverload.ts (1 errors) ==== @@ -22,6 +22,6 @@ tests/cases/compiler/signatureLengthMismatchInOverload.ts(5,3): error TS2769: No !!! error TS2769: Type 'string' is not assignable to type 'number'. !!! error TS2769: Overload 2 of 2, '(callback: (arg: number) => void): void', gave the following error. !!! error TS2769: Argument of type '(arg: number, arg2: number) => void' is not assignable to parameter of type '(arg: number) => void'. -!!! error TS2769: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS2793 tests/cases/compiler/signatureLengthMismatchInOverload.ts:3:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. \ No newline at end of file diff --git a/tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.errors.txt b/tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.errors.txt index da2640380cf44..b5a3db1869505 100644 --- a/tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/signatureLengthMismatchWithOptionalParameters.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/signatureLengthMismatchWithOptionalParameters.ts(5,8): error TS2345: Argument of type '(n: number, m: string) => void' is not assignable to parameter of type '(n?: number) => void'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. ==== tests/cases/compiler/signatureLengthMismatchWithOptionalParameters.ts (1 errors) ==== @@ -10,5 +10,5 @@ tests/cases/compiler/signatureLengthMismatchWithOptionalParameters.ts(5,8): erro caller(callee); ~~~~~~ !!! error TS2345: Argument of type '(n: number, m: string) => void' is not assignable to parameter of type '(n?: number) => void'. -!!! error TS2345: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1. \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt index ec913f9c832f8..9e123b3718813 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts(19,11): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. Types of property 'a' are incompatible. Type '(x: number) => number' is not assignable to type '() => number'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts(49,11): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. Types of property 'a3' are incompatible. Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts (2 errors) ==== @@ -32,7 +32,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type '(x: number) => number' is not assignable to type '() => number'. -!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0. a: (x: number) => number; // error, too many required params } @@ -67,7 +67,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. -!!! error TS2430: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2430: Target signature provides too few arguments. Expected 2 or more, but got 1. a3: (x: number, y: number) => number; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt index 17c947fd1c511..2febb535b28b1 100644 --- a/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts(19,11): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. Types of property 'a' are incompatible. Type 'new (x: number) => number' is not assignable to type 'new () => number'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts(49,11): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. Types of property 'a3' are incompatible. Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts (2 errors) ==== @@ -32,7 +32,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type 'new (x: number) => number' is not assignable to type 'new () => number'. -!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0. a: new (x: number) => number; // error, too many required params } @@ -67,7 +67,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. -!!! error TS2430: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2430: Target signature provides too few arguments. Expected 2 or more, but got 1. a3: new (x: number, y: number) => number; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt index 6fa794c4bf7b5..27755bf2b7cee 100644 --- a/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(20,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. Types of property 'a' are incompatible. Type '(x: T) => T' is not assignable to type '() => T'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(50,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. Types of property 'a3' are incompatible. Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(100,15): error TS2430: Interface 'I1' incorrectly extends interface 'Base2'. The types returned by 'a()' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -17,7 +17,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(108,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. Type '(x: T) => T' is not assignable to type '() => T'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(113,15): error TS2430: Interface 'I4' incorrectly extends interface 'Base2'. The types returned by 'a2(...)' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -53,7 +53,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(138,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. Types of property 'a3' are incompatible. Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(143,15): error TS2430: Interface 'I11' incorrectly extends interface 'Base2'. The types returned by 'a4(...)' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -101,11 +101,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(196,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. Type '(x: T) => T' is not assignable to type '() => T'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(226,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. Types of property 'a3' are incompatible. Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts (22 errors) ==== @@ -133,7 +133,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type '(x: T) => T' is not assignable to type '() => T'. -!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0. a: (x: T) => T; // error, too many required params } @@ -168,7 +168,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. -!!! error TS2430: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2430: Target signature provides too few arguments. Expected 2 or more, but got 1. a3: (x: T, y: T) => T; // error, too many required params } @@ -243,7 +243,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type '(x: T) => T' is not assignable to type '() => T'. -!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0. a: (x: T) => T; } @@ -322,7 +322,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. -!!! error TS2430: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2430: Target signature provides too few arguments. Expected 2 or more, but got 1. a3: (x: T, y: T) => T; } @@ -445,7 +445,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type '(x: T) => T' is not assignable to type '() => T'. -!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0. a: (x: T) => T; // error, not identical and contextual signature instatiation can't make inference from T to T } @@ -480,7 +480,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. -!!! error TS2430: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2430: Target signature provides too few arguments. Expected 2 or more, but got 1. a3: (x: T, y: T) => T; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt index 10f842893cb83..888919b8884e3 100644 --- a/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(20,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. Types of property 'a' are incompatible. Type 'new (x: T) => T' is not assignable to type 'new () => T'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(50,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. Types of property 'a3' are incompatible. Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(100,15): error TS2430: Interface 'I1' incorrectly extends interface 'Base2'. The types returned by 'new a()' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -17,7 +17,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(108,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. Type 'new (x: T) => T' is not assignable to type 'new () => T'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(113,15): error TS2430: Interface 'I4' incorrectly extends interface 'Base2'. The types returned by 'new a2(...)' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -53,7 +53,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(138,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. Types of property 'a3' are incompatible. Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(143,15): error TS2430: Interface 'I11' incorrectly extends interface 'Base2'. The types returned by 'new a4(...)' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -101,11 +101,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(196,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. Type 'new (x: T) => T' is not assignable to type 'new () => T'. - The source signature requires more arguments (1) than are provided by the target (0). + Target signature provides too few arguments. Expected 1 or more, but got 0. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(226,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. Types of property 'a3' are incompatible. Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts (22 errors) ==== @@ -133,7 +133,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new () => T'. -!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0. a: new (x: T) => T; // error, too many required params } @@ -168,7 +168,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. -!!! error TS2430: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2430: Target signature provides too few arguments. Expected 2 or more, but got 1. a3: new (x: T, y: T) => T; // error, too many required params } @@ -243,7 +243,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new () => T'. -!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0. a: new (x: T) => T; } @@ -322,7 +322,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. -!!! error TS2430: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2430: Target signature provides too few arguments. Expected 2 or more, but got 1. a3: new (x: T, y: T) => T; } @@ -445,7 +445,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new () => T'. -!!! error TS2430: The source signature requires more arguments (1) than are provided by the target (0). +!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0. a: new (x: T) => T; // error, not identical and contextual signature instatiation can't make inference from T to T } @@ -480,7 +480,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. -!!! error TS2430: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2430: Target signature provides too few arguments. Expected 2 or more, but got 1. a3: new (x: T, y: T) => T; // error, too many required params } diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt index 27c1703513a46..02779d7d58855 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/jsx/file.tsx(8,15): error TS2322: Type 'T & { "ignore-pr tests/cases/conformance/jsx/file.tsx(13,15): error TS2322: Type 'T' is not assignable to type 'IntrinsicAttributes & { prop: unknown; "ignore-prop": string; }'. Type 'T' is not assignable to type '{ prop: unknown; "ignore-prop": string; }'. tests/cases/conformance/jsx/file.tsx(20,19): error TS2322: Type '(a: number, b: string) => void' is not assignable to type '(arg: number) => void'. - The source signature requires more arguments (2) than are provided by the target (1). + Target signature provides too few arguments. Expected 2 or more, but got 1. tests/cases/conformance/jsx/file.tsx(31,52): error TS2322: Type '(val: string) => void' is not assignable to type '(selectedVal: number) => void'. Types of parameters 'val' and 'selectedVal' are incompatible. Type 'number' is not assignable to type 'string'. @@ -44,7 +44,7 @@ tests/cases/conformance/jsx/file.tsx(31,52): error TS2322: Type '(val: string) = let o = ~~~~ !!! error TS2322: Type '(a: number, b: string) => void' is not assignable to type '(arg: number) => void'. -!!! error TS2322: The source signature requires more arguments (2) than are provided by the target (1). +!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1. !!! related TS6500 tests/cases/conformance/jsx/file.tsx:16:30: The expected type comes from property 'func' which is declared here on type 'IntrinsicAttributes & { func: (arg: number) => void; }' } diff --git a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt index f04bcf3a74282..ff0aad32daa12 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt +++ b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt @@ -27,7 +27,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(84,1): Type predicate 'p2 is A' is not assignable to 'p1 is A'. Parameter 'p2' is not in the same position as parameter 'p1'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(90,1): error TS2322: Type '(p1: any, p2: any, p3: any) => p1 is A' is not assignable to type '(p1: any, p2: any) => p1 is A'. - The source signature requires more arguments (3) than are provided by the target (2). + Target signature provides too few arguments. Expected 3 or more, but got 2. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(95,9): error TS2749: 'b' refers to a value, but is being used as a type here. Did you mean 'typeof b'? tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(95,11): error TS1005: ',' expected. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(95,14): error TS1005: ',' expected. @@ -212,7 +212,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(166,54 assign3 = function(p1, p2, p3): p1 is A { ~~~~~~~ !!! error TS2322: Type '(p1: any, p2: any, p3: any) => p1 is A' is not assignable to type '(p1: any, p2: any) => p1 is A'. -!!! error TS2322: The source signature requires more arguments (3) than are provided by the target (2). +!!! error TS2322: Target signature provides too few arguments. Expected 3 or more, but got 2. return true; }; From 7eac40564a73c8c0de74259f8713c07759ea8ac8 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Fri, 17 Mar 2023 16:11:04 -0700 Subject: [PATCH 12/12] tostring is no longer necessary --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d7e4de7050a6c..75709d5d596ee 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19796,7 +19796,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (reportErrors && !(checkMode & SignatureCheckMode.StrictArity)) { // the second condition should be redundant, because there is no error reporting when comparing signatures by strict arity // since it is only done for subtype reduction - errorReporter!(Diagnostics.Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1, getMinArgumentCount(source), targetCount.toString()); + errorReporter!(Diagnostics.Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1, getMinArgumentCount(source), targetCount); } return Ternary.False; }