From 772f8dd26d8d3bdc56e51f01c75cd569e68a8a1d Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Tue, 24 Nov 2015 09:37:12 -0800 Subject: [PATCH] Accept baselines --- ...addMoreOverloadsToBaseSignature.errors.txt | 2 + .../arityAndOrderCompatibility01.errors.txt | 20 +- ...teralExpressionContextualTyping.errors.txt | 10 +- .../reference/arrayLiterals3.errors.txt | 28 +- .../asOperatorContextualType.errors.txt | 6 +- .../assignFromBooleanInterface2.errors.txt | 6 +- .../baselines/reference/assignToFn.errors.txt | 2 + ...nmentCompatBetweenTupleAndArray.errors.txt | 10 +- .../reference/assignmentCompatBug5.errors.txt | 16 +- ...ignmentCompatWithCallSignatures.errors.txt | 80 +++--- ...gnmentCompatWithCallSignatures2.errors.txt | 40 +-- ...gnmentCompatWithCallSignatures4.errors.txt | 38 +-- ...ignaturesWithOptionalParameters.errors.txt | 14 + ...allSignaturesWithRestParameters.errors.txt | 90 ++++--- ...ntCompatWithConstructSignatures.errors.txt | 16 ++ ...tCompatWithConstructSignatures2.errors.txt | 8 + ...tCompatWithConstructSignatures4.errors.txt | 82 +++--- ...ignaturesWithOptionalParameters.errors.txt | 10 + ...ignaturesWithOptionalParameters.errors.txt | 12 + .../assignmentCompatWithOverloads.errors.txt | 36 ++- .../assignmentCompatability24.errors.txt | 4 +- .../assignmentCompatability33.errors.txt | 4 +- .../assignmentCompatability34.errors.txt | 4 +- .../assignmentCompatability37.errors.txt | 4 +- .../assignmentCompatability38.errors.txt | 4 +- .../reference/assignmentToObject.errors.txt | 2 + .../assignmentToObjectAndFunction.errors.txt | 6 +- .../asyncFunctionDeclaration15_es6.errors.txt | 20 +- .../reference/booleanAssignment.errors.txt | 18 +- .../callConstructAssignment.errors.txt | 6 +- ...atureAssignabilityInInheritance.errors.txt | 6 +- ...tureAssignabilityInInheritance3.errors.txt | 38 +-- .../reference/castingTuple.errors.txt | 10 +- ...ConstrainedToOtherTypeParameter.errors.txt | 10 +- ...onstrainedToOtherTypeParameter2.errors.txt | 12 +- ...ssignabilityConstructorFunction.errors.txt | 4 +- .../classSideInheritance3.errors.txt | 4 + ...onalOperatorWithoutIdenticalBCT.errors.txt | 18 +- ...atureAssignabilityInInheritance.errors.txt | 6 +- ...tureAssignabilityInInheritance3.errors.txt | 38 +-- .../reference/constructorAsType.errors.txt | 2 + .../contextualTypeWithTuple.errors.txt | 24 +- ...lTypeWithUnionTypeObjectLiteral.errors.txt | 10 +- .../reference/contextualTyping24.errors.txt | 12 +- .../reference/contextualTyping39.errors.txt | 6 +- .../reference/contextualTyping41.errors.txt | 6 +- ...lTypingOfConditionalExpression2.errors.txt | 14 +- ...fGenericFunctionTypedArguments1.errors.txt | 16 +- .../derivedClassTransitivity.errors.txt | 10 +- .../derivedClassTransitivity2.errors.txt | 10 +- .../derivedClassTransitivity3.errors.txt | 10 +- .../derivedClassTransitivity4.errors.txt | 10 +- .../derivedInterfaceCallSignature.errors.txt | 2 + ...tructuringParameterDeclaration2.errors.txt | 32 ++- .../reference/enumAssignability.errors.txt | 6 + .../reference/errorElaboration.errors.txt | 14 +- ...orOnContextuallyTypedReturnType.errors.txt | 6 +- ...AnnotationAndInvalidInitializer.errors.txt | 42 +-- ...endAndImplementTheSameBaseType2.errors.txt | 6 +- ...fixingTypeParametersRepeatedly2.errors.txt | 16 +- tests/baselines/reference/for-of30.errors.txt | 16 +- tests/baselines/reference/for-of31.errors.txt | 24 +- ...functionConstraintSatisfaction2.errors.txt | 24 +- ...tionExpressionContextualTyping2.errors.txt | 6 +- ...ctionSignatureAssignmentCompat1.errors.txt | 10 +- .../reference/generatorTypeCheck25.errors.txt | 46 ++-- .../reference/generatorTypeCheck31.errors.txt | 2 + .../reference/generatorTypeCheck8.errors.txt | 10 +- ...AssignmentCompatWithInterfaces1.errors.txt | 10 +- ...edMethodWithOverloadedArguments.errors.txt | 40 +-- ...lWithConstructorTypedArguments5.errors.txt | 4 + ...lWithGenericSignatureArguments2.errors.txt | 38 +-- ...lWithGenericSignatureArguments3.errors.txt | 10 +- ...oadedConstructorTypedArguments2.errors.txt | 2 + ...erloadedFunctionTypedArguments2.errors.txt | 2 + .../genericCallWithTupleType.errors.txt | 14 +- .../reference/genericCombinators2.errors.txt | 16 +- .../genericSpecializations3.errors.txt | 30 ++- .../genericTypeAssertions2.errors.txt | 10 +- ...cTypeWithNonGenericBaseMisMatch.errors.txt | 40 +-- .../baselines/reference/generics4.errors.txt | 6 +- ...ementGenericWithMismatchedTypes.errors.txt | 16 +- .../reference/incompatibleTypes.errors.txt | 26 +- .../reference/inheritance.errors.txt | 2 + ...eMemberAccessorOverridingMethod.errors.txt | 2 + ...eStaticAccessorOverridingMethod.errors.txt | 2 + ...eStaticPropertyOverridingMethod.errors.txt | 2 + ...nheritedModuleMembersForClodule.errors.txt | 6 +- ...ceMemberAssignsToClassPrototype.errors.txt | 6 +- .../reference/intTypeCheck.errors.txt | 42 ++- .../interfaceAssignmentCompat.errors.txt | 14 +- .../interfaceImplementation1.errors.txt | 2 + .../interfaceImplementation7.errors.txt | 10 +- .../invalidBooleanAssignments.errors.txt | 2 + .../iteratorSpreadInArray9.errors.txt | 24 +- .../reference/lambdaArgCrash.errors.txt | 2 + .../reference/multipleInheritance.errors.txt | 2 + ...MembersOfObjectAssignmentCompat.errors.txt | 18 +- ...embersOfObjectAssignmentCompat2.errors.txt | 30 ++- ...mbersOfFunctionAssignmentCompat.errors.txt | 6 +- ...mbersOfFunctionAssignmentCompat.errors.txt | 6 +- ...ptionalFunctionArgAssignability.errors.txt | 20 +- .../optionalParamAssignmentCompat.errors.txt | 10 +- .../optionalParamTypeComparison.errors.txt | 20 +- .../overloadOnConstInheritance2.errors.txt | 2 + .../overloadOnConstInheritance3.errors.txt | 2 + .../overloadResolutionOverCTLambda.errors.txt | 6 +- ...nWithConstraintCheckingDeferred.errors.txt | 14 +- .../overloadsWithProvisionalErrors.errors.txt | 20 +- .../baselines/reference/parseTypes.errors.txt | 6 + .../reference/parser536727.errors.txt | 12 +- ...serAutomaticSemicolonInsertion1.errors.txt | 4 + .../reference/promiseChaining1.errors.txt | 10 +- .../reference/promiseChaining2.errors.txt | 10 +- .../reference/promisePermutations.errors.txt | 210 +++++++++------ .../reference/promisePermutations2.errors.txt | 210 +++++++++------ .../reference/promisePermutations3.errors.txt | 240 ++++++++++++------ .../reference/propertyAssignment.errors.txt | 6 +- tests/baselines/reference/qualify.errors.txt | 4 + .../recursiveFunctionTypes.errors.txt | 16 +- .../requiredInitializedParameter2.errors.txt | 2 + .../restArgAssignmentCompat.errors.txt | 14 +- ...gnsToConstructorFunctionMembers.errors.txt | 6 +- ...ypesAsTypeParameterConstraint02.errors.txt | 6 +- .../subtypingWithCallSignaturesA.errors.txt | 6 +- ...ignaturesWithOptionalParameters.errors.txt | 4 + ...allSignaturesWithRestParameters.errors.txt | 110 ++++---- ...aturesWithSpecializedSignatures.errors.txt | 6 +- ...ignaturesWithOptionalParameters.errors.txt | 4 + ...aturesWithSpecializedSignatures.errors.txt | 6 +- ...ignaturesWithOptionalParameters.errors.txt | 12 + ...ignaturesWithOptionalParameters.errors.txt | 12 + .../reference/symbolProperty24.errors.txt | 6 +- .../reference/targetTypeVoidFunc.errors.txt | 2 + .../baselines/reference/tupleTypes.errors.txt | 20 +- ...entInferenceConstructSignatures.errors.txt | 30 ++- .../typeArgumentInferenceErrors.errors.txt | 30 ++- ...ntInferenceWithClassExpression2.errors.txt | 10 +- ...rgumentInferenceWithConstraints.errors.txt | 30 ++- .../typeGuardFunctionErrors.errors.txt | 28 +- .../baselines/reference/typeName1.errors.txt | 4 + ...ypeParameterArgumentEquivalence.errors.txt | 20 +- ...peParameterArgumentEquivalence2.errors.txt | 20 +- ...peParameterArgumentEquivalence3.errors.txt | 12 +- ...peParameterArgumentEquivalence4.errors.txt | 12 +- ...peParameterArgumentEquivalence5.errors.txt | 24 +- ...gWithContextSensitiveArguments2.errors.txt | 10 +- ...gWithContextSensitiveArguments3.errors.txt | 10 +- .../typesWithPrivateConstructor.errors.txt | 2 + .../typesWithPublicConstructor.errors.txt | 2 + .../undeclaredModuleError.errors.txt | 6 +- 151 files changed, 1874 insertions(+), 992 deletions(-) diff --git a/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt b/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt index 4b6255688f8..be20b673287 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'. + Signature '(): string' has no corresponding signature in '(key: string) => 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: Signature '(): string' has no corresponding signature in '(key: string) => string' f(key: string): string; } \ No newline at end of file diff --git a/tests/baselines/reference/arityAndOrderCompatibility01.errors.txt b/tests/baselines/reference/arityAndOrderCompatibility01.errors.txt index d60f0b7d03c..a766bab8a96 100644 --- a/tests/baselines/reference/arityAndOrderCompatibility01.errors.txt +++ b/tests/baselines/reference/arityAndOrderCompatibility01.errors.txt @@ -29,13 +29,15 @@ tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(24,5): error tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(25,5): error TS2322: Type '[string, number]' is not assignable to type '[string]'. Types of property 'pop' are incompatible. Type '() => string | number' is not assignable to type '() => string'. - Type 'string | number' is not assignable to type 'string'. - Type 'number' is not assignable to type 'string'. + Signature '(): string' has no corresponding signature in '() => string | number' + Type 'string | number' is not assignable to type 'string'. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(26,5): error TS2322: Type 'StrNum' is not assignable to type '[string]'. Types of property 'pop' are incompatible. Type '() => string | number' is not assignable to type '() => string'. - Type 'string | number' is not assignable to type 'string'. - Type 'number' is not assignable to type 'string'. + Signature '(): string' has no corresponding signature in '() => string | number' + Type 'string | number' is not assignable to type 'string'. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(27,5): error TS2322: Type '{ 0: string; 1: number; }' is not assignable to type '[string]'. Property 'length' is missing in type '{ 0: string; 1: number; }'. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(28,5): error TS2322: Type '[string, number]' is not assignable to type '[number, string]'. @@ -120,15 +122,17 @@ tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(30,5): error !!! error TS2322: Type '[string, number]' is not assignable to type '[string]'. !!! error TS2322: Types of property 'pop' are incompatible. !!! error TS2322: Type '() => string | number' is not assignable to type '() => string'. -!!! error TS2322: Type 'string | number' is not assignable to type 'string'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature '(): string' has no corresponding signature in '() => string | number' +!!! error TS2322: Type 'string | number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var m2: [string] = y; ~~ !!! error TS2322: Type 'StrNum' is not assignable to type '[string]'. !!! error TS2322: Types of property 'pop' are incompatible. !!! error TS2322: Type '() => string | number' is not assignable to type '() => string'. -!!! error TS2322: Type 'string | number' is not assignable to type 'string'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature '(): string' has no corresponding signature in '() => string | number' +!!! error TS2322: Type 'string | number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var m3: [string] = z; ~~ !!! error TS2322: Type '{ 0: string; 1: number; }' is not assignable to type '[string]'. diff --git a/tests/baselines/reference/arrayLiteralExpressionContextualTyping.errors.txt b/tests/baselines/reference/arrayLiteralExpressionContextualTyping.errors.txt index 72ba1411320..b7ea49c7283 100644 --- a/tests/baselines/reference/arrayLiteralExpressionContextualTyping.errors.txt +++ b/tests/baselines/reference/arrayLiteralExpressionContextualTyping.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(8,5): error TS2322: Type '[number, number, number, string]' is not assignable to type '[number, number, number]'. Types of property 'pop' are incompatible. Type '() => number | string' is not assignable to type '() => number'. - Type 'number | string' is not assignable to type 'number'. - Type 'string' is not assignable to type 'number'. + Signature '(): number' has no corresponding signature in '() => number | string' + Type 'number | string' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(14,5): error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'. Property '0' is missing in type 'number[]'. @@ -20,8 +21,9 @@ tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionConte !!! error TS2322: Type '[number, number, number, string]' is not assignable to type '[number, number, number]'. !!! error TS2322: Types of property 'pop' are incompatible. !!! error TS2322: Type '() => number | string' is not assignable to type '() => number'. -!!! error TS2322: Type 'number | string' is not assignable to type 'number'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(): number' has no corresponding signature in '() => number | string' +!!! error TS2322: Type 'number | string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. // In a contextually typed array literal expression containing one or more spread elements, // an element expression at index N is contextually typed by the numeric index type of the contextual type, if any. diff --git a/tests/baselines/reference/arrayLiterals3.errors.txt b/tests/baselines/reference/arrayLiterals3.errors.txt index 637fb3e3bc4..a3d3611cf55 100644 --- a/tests/baselines/reference/arrayLiterals3.errors.txt +++ b/tests/baselines/reference/arrayLiterals3.errors.txt @@ -6,8 +6,9 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,5): error tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(17,5): error TS2322: Type '[number, number, string, boolean]' is not assignable to type '[number, number]'. Types of property 'pop' are incompatible. Type '() => number | string | boolean' is not assignable to type '() => number'. - Type 'number | string | boolean' is not assignable to type 'number'. - Type 'string' is not assignable to type 'number'. + Signature '(): number' has no corresponding signature in '() => number | string | boolean' + Type 'number | string | boolean' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(32,5): error TS2322: Type '(number[] | string[])[]' is not assignable to type 'tup'. Property '0' is missing in type '(number[] | string[])[]'. tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(33,5): error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'. @@ -15,10 +16,11 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(33,5): error tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error TS2322: Type '(number | string)[]' is not assignable to type 'myArray'. Types of property 'push' are incompatible. Type '(...items: (number | string)[]) => number' is not assignable to type '(...items: Number[]) => number'. - Types of parameters 'items' and 'items' are incompatible. - Type 'number | string' is not assignable to type 'Number'. - Type 'string' is not assignable to type 'Number'. - Property 'toFixed' is missing in type 'String'. + Signature '(...items: Number[]): number' has no corresponding signature in '(...items: (number | string)[]) => number' + Types of parameters 'items' and 'items' are incompatible. + Type 'number | string' is not assignable to type 'Number'. + Type 'string' is not assignable to type 'Number'. + Property 'toFixed' is missing in type 'String'. ==== tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts (6 errors) ==== @@ -50,8 +52,9 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error !!! error TS2322: Type '[number, number, string, boolean]' is not assignable to type '[number, number]'. !!! error TS2322: Types of property 'pop' are incompatible. !!! error TS2322: Type '() => number | string | boolean' is not assignable to type '() => number'. -!!! error TS2322: Type 'number | string | boolean' is not assignable to type 'number'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(): number' has no corresponding signature in '() => number | string | boolean' +!!! error TS2322: Type 'number | string | boolean' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. // The resulting type an array literal expression is determined as follows: // - the resulting type is an array type with an element type that is the union of the types of the @@ -79,8 +82,9 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error !!! error TS2322: Type '(number | string)[]' is not assignable to type 'myArray'. !!! error TS2322: Types of property 'push' are incompatible. !!! error TS2322: Type '(...items: (number | string)[]) => number' is not assignable to type '(...items: Number[]) => number'. -!!! error TS2322: Types of parameters 'items' and 'items' are incompatible. -!!! error TS2322: Type 'number | string' is not assignable to type 'Number'. -!!! error TS2322: Type 'string' is not assignable to type 'Number'. -!!! error TS2322: Property 'toFixed' is missing in type 'String'. +!!! error TS2322: Signature '(...items: Number[]): number' has no corresponding signature in '(...items: (number | string)[]) => number' +!!! error TS2322: Types of parameters 'items' and 'items' are incompatible. +!!! error TS2322: Type 'number | string' is not assignable to type 'Number'. +!!! error TS2322: Type 'string' is not assignable to type 'Number'. +!!! error TS2322: Property 'toFixed' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/asOperatorContextualType.errors.txt b/tests/baselines/reference/asOperatorContextualType.errors.txt index c53b407b5cf..6c52114625b 100644 --- a/tests/baselines/reference/asOperatorContextualType.errors.txt +++ b/tests/baselines/reference/asOperatorContextualType.errors.txt @@ -1,5 +1,6 @@ tests/cases/conformance/expressions/asOperator/asOperatorContextualType.ts(2,9): error TS2352: Neither type '(v: number) => number' nor type '(x: number) => string' is assignable to the other. - Type 'number' is not assignable to type 'string'. + Signature '(x: number): string' has no corresponding signature in '(v: number) => number' + Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/expressions/asOperator/asOperatorContextualType.ts (1 errors) ==== @@ -7,4 +8,5 @@ tests/cases/conformance/expressions/asOperator/asOperatorContextualType.ts(2,9): var x = (v => v) as (x: number) => string; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2352: Neither type '(v: number) => number' nor type '(x: number) => string' is assignable to the other. -!!! error TS2352: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2352: Signature '(x: number): string' has no corresponding signature in '(v: number) => number' +!!! error TS2352: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignFromBooleanInterface2.errors.txt b/tests/baselines/reference/assignFromBooleanInterface2.errors.txt index c03eab60c74..f20050a5b9e 100644 --- a/tests/baselines/reference/assignFromBooleanInterface2.errors.txt +++ b/tests/baselines/reference/assignFromBooleanInterface2.errors.txt @@ -1,7 +1,8 @@ tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(14,1): error TS2322: Type 'NotBoolean' is not assignable to type 'Boolean'. Types of property 'valueOf' are incompatible. Type '() => Object' is not assignable to type '() => boolean'. - Type 'Object' is not assignable to type 'boolean'. + Signature '(): boolean' has no corresponding signature in '() => Object' + Type 'Object' is not assignable to type 'boolean'. tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(19,1): error TS2322: Type 'Boolean' is not assignable to type 'boolean'. tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(20,1): error TS2322: Type 'NotBoolean' is not assignable to type 'boolean'. @@ -25,7 +26,8 @@ tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts( !!! error TS2322: Type 'NotBoolean' is not assignable to type 'Boolean'. !!! error TS2322: Types of property 'valueOf' are incompatible. !!! error TS2322: Type '() => Object' is not assignable to type '() => boolean'. -!!! error TS2322: Type 'Object' is not assignable to type 'boolean'. +!!! error TS2322: Signature '(): boolean' has no corresponding signature in '() => Object' +!!! error TS2322: Type 'Object' is not assignable to type 'boolean'. b = a; b = x; diff --git a/tests/baselines/reference/assignToFn.errors.txt b/tests/baselines/reference/assignToFn.errors.txt index 7f2c7855a35..2b2b2a5366f 100644 --- a/tests/baselines/reference/assignToFn.errors.txt +++ b/tests/baselines/reference/assignToFn.errors.txt @@ -1,4 +1,5 @@ tests/cases/compiler/assignToFn.ts(8,5): error TS2322: Type 'string' is not assignable to type '(n: number) => boolean'. + Signature '(n: number): boolean' has no corresponding signature in 'String' ==== tests/cases/compiler/assignToFn.ts (1 errors) ==== @@ -12,5 +13,6 @@ tests/cases/compiler/assignToFn.ts(8,5): error TS2322: Type 'string' is not assi x.f="hello"; ~~~ !!! error TS2322: Type 'string' is not assignable to type '(n: number) => boolean'. +!!! error TS2322: Signature '(n: number): boolean' has no corresponding signature in 'String' } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt b/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt index c7552c3fdb2..16fff660c1d 100644 --- a/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt +++ b/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(17,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]'. Types of property 'pop' are incompatible. Type '() => number | string' is not assignable to type '() => number'. - Type 'number | string' is not assignable to type 'number'. - Type 'string' is not assignable to type 'number'. + Signature '(): number' has no corresponding signature in '() => number | string' + Type 'number | string' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(18,1): error TS2322: Type '{}[]' is not assignable to type '[{}]'. Property '0' is missing in type '{}[]'. @@ -29,8 +30,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type '[number, string]' is not assignable to type 'number[]'. !!! error TS2322: Types of property 'pop' are incompatible. !!! error TS2322: Type '() => number | string' is not assignable to type '() => number'. -!!! error TS2322: Type 'number | string' is not assignable to type 'number'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(): number' has no corresponding signature in '() => number | string' +!!! error TS2322: Type 'number | string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. emptyObjTuple = emptyObjArray; ~~~~~~~~~~~~~ !!! error TS2322: Type '{}[]' is not assignable to type '[{}]'. diff --git a/tests/baselines/reference/assignmentCompatBug5.errors.txt b/tests/baselines/reference/assignmentCompatBug5.errors.txt index 1b5e3d80259..f8b1a1094e2 100644 --- a/tests/baselines/reference/assignmentCompatBug5.errors.txt +++ b/tests/baselines/reference/assignmentCompatBug5.errors.txt @@ -3,10 +3,12 @@ tests/cases/compiler/assignmentCompatBug5.ts(2,8): error TS2345: Argument of typ tests/cases/compiler/assignmentCompatBug5.ts(5,6): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'number[]'. Type 'string' is not assignable to type 'number'. tests/cases/compiler/assignmentCompatBug5.ts(8,6): error TS2345: Argument of type '(s: string) => void' is not assignable to parameter of type '(n: number) => number'. - Types of parameters 's' and 'n' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(n: number): number' has no corresponding signature in '(s: string) => void' + Types of parameters 's' and 'n' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/assignmentCompatBug5.ts(9,6): error TS2345: Argument of type '(n: number) => void' is not assignable to parameter of type '(n: number) => number'. - Type 'void' is not assignable to type 'number'. + Signature '(n: number): number' has no corresponding signature in '(n: number) => void' + Type 'void' is not assignable to type 'number'. ==== tests/cases/compiler/assignmentCompatBug5.ts (4 errors) ==== @@ -26,11 +28,13 @@ tests/cases/compiler/assignmentCompatBug5.ts(9,6): error TS2345: Argument of typ foo3((s:string) => { }); ~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(s: string) => void' is not assignable to parameter of type '(n: number) => number'. -!!! error TS2345: Types of parameters 's' and 'n' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2345: Signature '(n: number): number' has no corresponding signature in '(s: string) => void' +!!! error TS2345: Types of parameters 's' and 'n' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'number'. foo3((n) => { return; }); ~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(n: number) => void' is not assignable to parameter of type '(n: number) => number'. -!!! error TS2345: Type 'void' is not assignable to type 'number'. +!!! error TS2345: Signature '(n: number): number' has no corresponding signature in '(n: number) => void' +!!! error TS2345: Type 'void' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt index 6a221ef144e..194b1834a61 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt @@ -1,27 +1,35 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(35,1): error TS2322: Type 'S2' is not assignable to type 'T'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in 'S2' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(36,1): error TS2322: Type '(x: string) => void' is not assignable to type 'T'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x: string) => void' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(37,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x: string) => number' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(38,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x: string) => string' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(39,1): error TS2322: Type 'S2' is not assignable to type '(x: number) => void'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in 'S2' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(40,1): error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x: string) => void' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(41,1): error TS2322: Type '(x: string) => number' is not assignable to type '(x: number) => void'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x: string) => number' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(42,1): error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => void'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x: string) => string' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts (8 errors) ==== @@ -62,41 +70,49 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme t = s2; ~ !!! error TS2322: Type 'S2' is not assignable to type 'T'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number): void' has no corresponding signature in 'S2' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. t = a3; ~ !!! error TS2322: Type '(x: string) => void' is not assignable to type 'T'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => void' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. t = (x: string) => 1; ~ !!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => number' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. t = function (x: string) { return ''; } ~ !!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => string' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = s2; ~ !!! error TS2322: Type 'S2' is not assignable to type '(x: number) => void'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number): void' has no corresponding signature in 'S2' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = a3; ~ !!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => void' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = (x: string) => 1; ~ !!! error TS2322: Type '(x: string) => number' is not assignable to type '(x: number) => void'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => number' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = function (x: string) { return ''; } ~ !!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => void'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => string' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt index e67f0a930c2..fdcc9fe6ec9 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt @@ -9,13 +9,15 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(42,1): error TS2322: Type 'S2' is not assignable to type 'T'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type '(x: number) => void'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x: string) => void' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(43,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type '(x: number) => void'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x: string) => void' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(44,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. Property 'f' is missing in type '(x: string) => number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(45,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. @@ -23,13 +25,15 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(46,1): error TS2322: Type 'S2' is not assignable to type '{ f(x: number): void; }'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type '(x: number) => void'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x: string) => void' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(47,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type '(x: number) => void'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x: string) => void' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(48,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }'. Property 'f' is missing in type '(x: string) => number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(49,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }'. @@ -95,15 +99,17 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'S2' is not assignable to type 'T'. !!! error TS2322: Types of property 'f' are incompatible. !!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => void' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. t = a3; ~ !!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'. !!! error TS2322: Types of property 'f' are incompatible. !!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => void' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. t = (x: string) => 1; ~ !!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. @@ -117,15 +123,17 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'S2' is not assignable to type '{ f(x: number): void; }'. !!! error TS2322: Types of property 'f' are incompatible. !!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => void' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = a3; ~ !!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }'. !!! error TS2322: Types of property 'f' are incompatible. !!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => void' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = (x: string) => 1; ~ !!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }'. diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt index e00d1eea042..3620fb0e8c3 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt @@ -1,13 +1,16 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(52,9): error TS2322: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. - Types of parameters 'y' and 'y' are incompatible. - Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. - Types of parameters 'arg2' and 'arg2' are incompatible. - Type '{ foo: number; }' is not assignable to type 'Base'. - Types of property 'foo' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived): (r: Base) => Derived' has no corresponding signature in '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. + Signature '(arg2: Base): Derived' has no corresponding signature in '(arg2: { foo: number; }) => any' + Types of parameters 'arg2' and 'arg2' are incompatible. + Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(53,9): error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. - Types of parameters 'y' and 'y' are incompatible. - Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. + Signature '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U): (r: T) => U' has no corresponding signature in '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts (2 errors) ==== @@ -65,17 +68,20 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a8 = b8; // error, { foo: number } and Base are incompatible ~~ !!! error TS2322: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. -!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. -!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base'. -!!! error TS2322: Types of property 'foo' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived): (r: Base) => Derived' has no corresponding signature in '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. +!!! error TS2322: Signature '(arg2: Base): Derived' has no corresponding signature in '(arg2: { foo: number; }) => any' +!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. b8 = a8; // error, { foo: number } and Base are incompatible ~~ !!! error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. +!!! error TS2322: Signature '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U): (r: T) => U' has no corresponding signature in '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. var b10: (...x: T[]) => T; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt index f89bbfa5798..504f6d70799 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'. + Signature '(): number' has no corresponding signature in '(x: number) => number' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. + Signature '(): number' has no corresponding signature in '(x: number) => 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'. + Signature '(): number' has no corresponding signature in '(x: number, y?: number) => 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'. + Signature '(): number' has no corresponding signature in '(x: number, y: number) => 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'. + Signature '(x?: number): number' has no corresponding signature in '(x: number, y: 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'. + Signature '(x: number): number' has no corresponding signature in '(x: number, y: 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'. + Signature '(x: number): number' has no corresponding signature in '(x: number, y: 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: Signature '(): number' has no corresponding signature in '(x: number) => 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: Signature '(): number' has no corresponding signature in '(x: number) => number' a = b.a4; // error ~ !!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. +!!! error TS2322: Signature '(): number' has no corresponding signature in '(x: number, y?: number) => 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: Signature '(): number' has no corresponding signature in '(x: number, y: number) => 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: Signature '(x?: number): number' has no corresponding signature in '(x: number, y: 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: Signature '(x: number): number' has no corresponding signature in '(x: number, y: 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: Signature '(x: number): number' has no corresponding signature in '(x: number, y: number) => number' var a4: (x: number, y?: number) => number; a4 = () => 1; // ok, fewer required params diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt index 8eec8503e70..e785ab663ca 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt @@ -1,30 +1,39 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(13,5): error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. - Types of parameters 'args' and 'args' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(...args: number[]): number' has no corresponding signature in '(...args: string[]) => number' + Types of parameters 'args' and 'args' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(17,5): error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. - Types of parameters 'x' and 'args' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(...args: number[]): number' has no corresponding signature in '(x?: string) => number' + Types of parameters 'x' and 'args' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(26,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. - Types of parameters 'args' and 'z' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number, ...z: number[]): number' has no corresponding signature in '(x: number, ...args: string[]) => number' + Types of parameters 'args' and 'z' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(35,5): error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. - Types of parameters 'y' and 'y' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, y?: number, z?: number) => number' + Types of parameters 'y' and 'y' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(36,5): error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. - Types of parameters 'z' and 'y' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, ...z: number[]) => number' + Types of parameters 'z' and 'y' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(37,5): error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: string, y?: string, z?: string) => number' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(41,5): error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. - Types of parameters 'y' and 'y' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x?: number, y?: number) => number' + Types of parameters 'y' and 'y' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(43,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. - Types of parameters 'y' and 'y' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, y?: number) => number' + Types of parameters 'y' and 'y' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. - Types of parameters 'args' and 'z' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, ...args: string[]) => number' + Types of parameters 'args' and 'z' are incompatible. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts (9 errors) ==== @@ -43,16 +52,18 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = (...args: string[]) => 1; // error, type mismatch ~ !!! error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. -!!! error TS2322: Types of parameters 'args' and 'args' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(...args: number[]): number' has no corresponding signature in '(...args: string[]) => number' +!!! error TS2322: Types of parameters 'args' and 'args' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = (x?: number) => 1; // ok, same number of required params a = (x?: number, y?: number, z?: number) => 1; // ok, same number of required params a = (x: number) => 1; // ok, rest param corresponds to infinite number of params a = (x?: string) => 1; // error, incompatible type ~ !!! error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. -!!! error TS2322: Types of parameters 'x' and 'args' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(...args: number[]): number' has no corresponding signature in '(x?: string) => number' +!!! error TS2322: Types of parameters 'x' and 'args' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var a2: (x: number, ...z: number[]) => number; @@ -64,8 +75,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = (x: number, ...args: string[]) => 1; // should be type mismatch error ~~ !!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. -!!! error TS2322: Types of parameters 'args' and 'z' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number, ...z: number[]): number' has no corresponding signature in '(x: number, ...args: string[]) => number' +!!! error TS2322: Types of parameters 'args' and 'z' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a2 = (x: number, y: number) => 1; // ok, rest param corresponds to infinite number of params a2 = (x: number, y?: number) => 1; // ok, same number of required params @@ -77,35 +89,41 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = (x: number, y?: number, z?: number) => 1; // error ~~ !!! error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, y?: number, z?: number) => number' +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. a3 = (x: number, ...z: number[]) => 1; // error ~~ !!! error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. -!!! error TS2322: Types of parameters 'z' and 'y' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, ...z: number[]) => number' +!!! error TS2322: Types of parameters 'z' and 'y' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. a3 = (x: string, y?: string, z?: string) => 1; // error ~~ !!! error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: string, y?: string, z?: string) => number' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var a4: (x?: number, y?: string, ...z: number[]) => number; a4 = () => 1; // ok, fewer required params a4 = (x?: number, y?: number) => 1; // error, type mismatch ~~ !!! error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x?: number, y?: number) => number' +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. a4 = (x: number) => 1; // ok, all present params match a4 = (x: number, y?: number) => 1; // error, second param has type mismatch ~~ !!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, y?: number) => number' +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. a4 = (x?: number, y?: string) => 1; // ok, same number of required params with matching types a4 = (x: number, ...args: string[]) => 1; // error, rest params have type mismatch ~~ !!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. -!!! error TS2322: Types of parameters 'args' and 'z' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, ...args: string[]) => number' +!!! error TS2322: Types of parameters 'args' and 'z' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt index 9c0c0d6a8fd..dfefb83af2f 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt @@ -1,11 +1,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(28,1): error TS2322: Type 'S2' is not assignable to type 'T'. + Signature 'new (x: number): void' has no corresponding signature in 'S2' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(29,1): error TS2322: Type '(x: string) => void' is not assignable to type 'T'. + Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(30,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. + Signature 'new (x: number): void' has no corresponding signature in '(x: string) => number' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(31,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. + Signature 'new (x: number): void' has no corresponding signature in '(x: string) => string' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(32,1): error TS2322: Type 'S2' is not assignable to type 'new (x: number) => void'. + Signature 'new (x: number): void' has no corresponding signature in 'S2' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(33,1): error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. + Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(34,1): error TS2322: Type '(x: string) => number' is not assignable to type 'new (x: number) => void'. + Signature 'new (x: number): void' has no corresponding signature in '(x: string) => number' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(35,1): error TS2322: Type '(x: string) => string' is not assignable to type 'new (x: number) => void'. + Signature 'new (x: number): void' has no corresponding signature in '(x: string) => string' ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts (8 errors) ==== @@ -39,25 +47,33 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme t = s2; ~ !!! error TS2322: Type 'S2' is not assignable to type 'T'. +!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in 'S2' t = a3; ~ !!! error TS2322: Type '(x: string) => void' is not assignable to type 'T'. +!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void' t = (x: string) => 1; ~ !!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. +!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => number' t = function (x: string) { return ''; } ~ !!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'. +!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => string' a = s2; ~ !!! error TS2322: Type 'S2' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in 'S2' a = a3; ~ !!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void' a = (x: string) => 1; ~ !!! error TS2322: Type '(x: string) => number' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => number' a = function (x: string) { return ''; } ~ !!! error TS2322: Type '(x: string) => string' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => string' \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt index 5e8fc6dd3a4..ab181157b6e 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt @@ -9,9 +9,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(34,1): error TS2322: Type 'S2' is not assignable to type 'T'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. + Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(35,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. + Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(36,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. Property 'f' is missing in type '(x: string) => number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(37,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. @@ -19,9 +21,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(38,1): error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. + Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(39,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. + Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(40,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'. Property 'f' is missing in type '(x: string) => number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(41,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }'. @@ -79,11 +83,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'S2' is not assignable to type 'T'. !!! error TS2322: Types of property 'f' are incompatible. !!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void' t = a3; ~ !!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'. !!! error TS2322: Types of property 'f' are incompatible. !!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void' t = (x: string) => 1; ~ !!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. @@ -97,11 +103,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'. !!! error TS2322: Types of property 'f' are incompatible. !!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void' a = a3; ~ !!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }'. !!! error TS2322: Types of property 'f' are incompatible. !!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void' a = (x: string) => 1; ~ !!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'. diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt index 804e31600e1..3a771411b53 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt @@ -1,25 +1,34 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(52,9): error TS2322: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. - Types of parameters 'y' and 'y' are incompatible. - Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. - Types of parameters 'arg2' and 'arg2' are incompatible. - Type '{ foo: number; }' is not assignable to type 'Base'. - Types of property 'foo' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived): (r: Base) => Derived' has no corresponding signature in 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. + Signature '(arg2: Base): Derived' has no corresponding signature in '(arg2: { foo: number; }) => any' + Types of parameters 'arg2' and 'arg2' are incompatible. + Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(53,9): error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. - Types of parameters 'y' and 'y' are incompatible. - Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. + Signature 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U): (r: T) => U' has no corresponding signature in 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(77,9): error TS2322: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'. - Types of parameters 'x' and 'x' are incompatible. - Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. + Signature 'new (x: { new (a: number): number; new (a?: number): number; }): number[]' has no corresponding signature in 'new (x: (a: T) => T) => T[]' + Types of parameters 'x' and 'x' are incompatible. + Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. + Signature 'new (a: number): number' has no corresponding signature in '(a: any) => any' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(78,9): error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. - Types of parameters 'x' and 'x' are incompatible. - Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. + Signature 'new (x: (a: T) => T): T[]' has no corresponding signature in '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' + Types of parameters 'x' and 'x' are incompatible. + Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(81,9): error TS2322: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }'. - Types of parameters 'x' and 'x' are incompatible. - Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'. + Signature 'new (x: { new (a: T): T; new (a: T): T; }): any[]' has no corresponding signature in 'new (x: (a: T) => T) => any[]' + Types of parameters 'x' and 'x' are incompatible. + Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'. + Signature 'new (a: T): T' has no corresponding signature in '(a: any) => any' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(82,9): error TS2322: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]'. - Types of parameters 'x' and 'x' are incompatible. - Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. + Signature 'new (x: (a: T) => T): any[]' has no corresponding signature in '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' + Types of parameters 'x' and 'x' are incompatible. + Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts (6 errors) ==== @@ -77,17 +86,20 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a8 = b8; // error, type mismatch ~~ !!! error TS2322: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. -!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. -!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base'. -!!! error TS2322: Types of property 'foo' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived): (r: Base) => Derived' has no corresponding signature in 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. +!!! error TS2322: Signature '(arg2: Base): Derived' has no corresponding signature in '(arg2: { foo: number; }) => any' +!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. b8 = a8; // error ~~ !!! error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. +!!! error TS2322: Signature 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U): (r: T) => U' has no corresponding signature in 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. var b10: new (...x: T[]) => T; @@ -114,25 +126,31 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a16 = b16; // error ~~~ !!! error TS2322: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. +!!! error TS2322: Signature 'new (x: { new (a: number): number; new (a?: number): number; }): number[]' has no corresponding signature in 'new (x: (a: T) => T) => T[]' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. +!!! error TS2322: Signature 'new (a: number): number' has no corresponding signature in '(a: any) => any' b16 = a16; // error ~~~ !!! error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. +!!! error TS2322: Signature 'new (x: (a: T) => T): T[]' has no corresponding signature in '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. var b17: new (x: (a: T) => T) => any[]; a17 = b17; // error ~~~ !!! error TS2322: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'. +!!! error TS2322: Signature 'new (x: { new (a: T): T; new (a: T): T; }): any[]' has no corresponding signature in 'new (x: (a: T) => T) => any[]' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'. +!!! error TS2322: Signature 'new (a: T): T' has no corresponding signature in '(a: any) => any' b17 = a17; // error ~~~ !!! error TS2322: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. +!!! error TS2322: Signature 'new (x: (a: T) => T): any[]' has no corresponding signature in '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. } module WithGenericSignaturesInBaseType { diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt index df56af3ee98..4ba4ec9a3c3 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'. + Signature 'new (): number' has no corresponding signature in 'new (x: number) => 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'. + Signature 'new (): number' has no corresponding signature in 'new (x: number, y?: number) => 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'. + Signature 'new (): number' has no corresponding signature in 'new (x: number, y: number) => 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'. + Signature 'new (x?: number): number' has no corresponding signature in 'new (x: number, y: 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'. + Signature 'new (x: number): number' has no corresponding signature in 'new (x: number, y: 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: Signature 'new (): number' has no corresponding signature in 'new (x: number) => number' a = b.a4; // error ~ !!! error TS2322: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. +!!! error TS2322: Signature 'new (): number' has no corresponding signature in 'new (x: number, y?: number) => 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: Signature 'new (): number' has no corresponding signature in 'new (x: number, y: number) => 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: Signature 'new (x?: number): number' has no corresponding signature in 'new (x: number, y: 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: Signature 'new (x: number): number' has no corresponding signature in 'new (x: number, y: 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 a18da8fd8f7..229ec114d39 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt @@ -1,9 +1,15 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(14,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. + Signature '(): T' has no corresponding signature in '(x: T) => any' 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'. + Signature '(x: T): T' has no corresponding signature in '(x: T, y: T) => any' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(65,9): error TS2322: Type '(x: T) => T' is not assignable to type '() => T'. + Signature '(): T' has no corresponding signature in '(x: T) => 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'. + Signature '(): T' has no corresponding signature in '(x: T, y?: T) => T' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(107,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. + Signature '(): T' has no corresponding signature in '(x: T) => any' 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'. + Signature '(x: T): T' has no corresponding signature in '(x: T, y: T) => any' ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts (6 errors) ==== @@ -23,6 +29,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: Signature '(): T' has no corresponding signature in '(x: T) => any' this.a2 = () => null; // ok, same T of required params this.a2 = (x?: T) => null; // ok, same T of required params @@ -34,6 +41,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: Signature '(x: T): T' has no corresponding signature in '(x: T, y: T) => any' this.a4 = () => null; // ok, fewer required params this.a4 = (x?: T, y?: T) => null; // ok, fewer required params @@ -78,9 +86,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: Signature '(): T' has no corresponding signature in '(x: T) => T' b.a = t.a4; ~~~ !!! error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '() => T'. +!!! error TS2322: Signature '(): T' has no corresponding signature in '(x: T, y?: T) => T' b.a = t.a5; b.a2 = t.a; @@ -124,6 +134,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: Signature '(): T' has no corresponding signature in '(x: T) => any' this.a2 = () => null; // ok, same T of required params this.a2 = (x?: T) => null; // ok, same T of required params @@ -135,6 +146,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: Signature '(x: T): T' has no corresponding signature in '(x: T, y: T) => any' this.a4 = () => null; // ok, fewer required params this.a4 = (x?: T, y?: T) => null; // ok, fewer required params diff --git a/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt b/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt index 3bea0c46716..1def25bf372 100644 --- a/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt @@ -1,13 +1,17 @@ tests/cases/compiler/assignmentCompatWithOverloads.ts(17,1): error TS2322: Type '(x: string) => string' is not assignable to type '(s1: string) => number'. - Type 'string' is not assignable to type 'number'. -tests/cases/compiler/assignmentCompatWithOverloads.ts(19,1): error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number'. - Types of parameters 'x' and 's1' are incompatible. - Type 'number' is not assignable to type 'string'. -tests/cases/compiler/assignmentCompatWithOverloads.ts(21,1): error TS2322: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number'. - Type 'string' is not assignable to type 'number'. -tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type 'typeof C' is not assignable to type 'new (x: number) => void'. - Types of parameters 'x' and 'x' are incompatible. + Signature '(s1: string): number' has no corresponding signature in '(x: string) => string' Type 'string' is not assignable to type 'number'. +tests/cases/compiler/assignmentCompatWithOverloads.ts(19,1): error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number'. + Signature '(s1: string): number' has no corresponding signature in '(x: number) => number' + Types of parameters 'x' and 's1' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/assignmentCompatWithOverloads.ts(21,1): error TS2322: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number'. + Signature '(s1: string): number' has no corresponding signature in '{ (x: string): string; (x: number): number; }' + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type 'typeof C' is not assignable to type 'new (x: number) => void'. + Signature 'new (x: number): void' has no corresponding signature in 'typeof C' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/assignmentCompatWithOverloads.ts (4 errors) ==== @@ -30,18 +34,21 @@ tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type g = f2; // Error ~ !!! error TS2322: Type '(x: string) => string' is not assignable to type '(s1: string) => number'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(s1: string): number' has no corresponding signature in '(x: string) => string' +!!! error TS2322: Type 'string' is not assignable to type 'number'. g = f3; // Error ~ !!! error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number'. -!!! error TS2322: Types of parameters 'x' and 's1' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature '(s1: string): number' has no corresponding signature in '(x: number) => number' +!!! error TS2322: Types of parameters 'x' and 's1' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. g = f4; // Error ~ !!! error TS2322: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(s1: string): number' has no corresponding signature in '{ (x: string): string; (x: number): number; }' +!!! error TS2322: Type 'string' is not assignable to type 'number'. class C { constructor(x: string); @@ -53,5 +60,6 @@ tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type d = C; // Error ~ !!! error TS2322: Type 'typeof C' is not assignable to type 'new (x: number) => void'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in 'typeof C' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability24.errors.txt b/tests/baselines/reference/assignmentCompatability24.errors.txt index 0f4a535d413..69c0bd2b288 100644 --- a/tests/baselines/reference/assignmentCompatability24.errors.txt +++ b/tests/baselines/reference/assignmentCompatability24.errors.txt @@ -1,4 +1,5 @@ tests/cases/compiler/assignmentCompatability24.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. + Signature '(a: Tstring): Tstring' has no corresponding signature in 'interfaceWithPublicAndOptional' ==== tests/cases/compiler/assignmentCompatability24.ts (1 errors) ==== @@ -12,4 +13,5 @@ tests/cases/compiler/assignmentCompatability24.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. +!!! error TS2322: Signature '(a: Tstring): Tstring' has no corresponding signature in 'interfaceWithPublicAndOptional' \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability33.errors.txt b/tests/baselines/reference/assignmentCompatability33.errors.txt index e2352625280..50e173b1202 100644 --- a/tests/baselines/reference/assignmentCompatability33.errors.txt +++ b/tests/baselines/reference/assignmentCompatability33.errors.txt @@ -1,4 +1,5 @@ tests/cases/compiler/assignmentCompatability33.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. + Signature '(a: Tstring): Tstring' has no corresponding signature in 'interfaceWithPublicAndOptional' ==== tests/cases/compiler/assignmentCompatability33.ts (1 errors) ==== @@ -12,4 +13,5 @@ tests/cases/compiler/assignmentCompatability33.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. +!!! error TS2322: Signature '(a: Tstring): Tstring' has no corresponding signature in 'interfaceWithPublicAndOptional' \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability34.errors.txt b/tests/baselines/reference/assignmentCompatability34.errors.txt index 2dd9cba6470..2f0bca9dff2 100644 --- a/tests/baselines/reference/assignmentCompatability34.errors.txt +++ b/tests/baselines/reference/assignmentCompatability34.errors.txt @@ -1,4 +1,5 @@ tests/cases/compiler/assignmentCompatability34.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tnumber) => Tnumber'. + Signature '(a: Tnumber): Tnumber' has no corresponding signature in 'interfaceWithPublicAndOptional' ==== tests/cases/compiler/assignmentCompatability34.ts (1 errors) ==== @@ -12,4 +13,5 @@ tests/cases/compiler/assignmentCompatability34.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tnumber) => Tnumber'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tnumber) => Tnumber'. +!!! error TS2322: Signature '(a: Tnumber): Tnumber' has no corresponding signature in 'interfaceWithPublicAndOptional' \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability37.errors.txt b/tests/baselines/reference/assignmentCompatability37.errors.txt index 452b72fe8ff..f965d49a0da 100644 --- a/tests/baselines/reference/assignmentCompatability37.errors.txt +++ b/tests/baselines/reference/assignmentCompatability37.errors.txt @@ -1,4 +1,5 @@ tests/cases/compiler/assignmentCompatability37.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tnumber) => any'. + Signature 'new (param: Tnumber): any' has no corresponding signature in 'interfaceWithPublicAndOptional' ==== tests/cases/compiler/assignmentCompatability37.ts (1 errors) ==== @@ -12,4 +13,5 @@ tests/cases/compiler/assignmentCompatability37.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tnumber) => any'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tnumber) => any'. +!!! error TS2322: Signature 'new (param: Tnumber): any' has no corresponding signature in 'interfaceWithPublicAndOptional' \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability38.errors.txt b/tests/baselines/reference/assignmentCompatability38.errors.txt index 5f7918374c1..1a5540065cc 100644 --- a/tests/baselines/reference/assignmentCompatability38.errors.txt +++ b/tests/baselines/reference/assignmentCompatability38.errors.txt @@ -1,4 +1,5 @@ tests/cases/compiler/assignmentCompatability38.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tstring) => any'. + Signature 'new (param: Tstring): any' has no corresponding signature in 'interfaceWithPublicAndOptional' ==== tests/cases/compiler/assignmentCompatability38.ts (1 errors) ==== @@ -12,4 +13,5 @@ tests/cases/compiler/assignmentCompatability38.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tstring) => any'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tstring) => any'. +!!! error TS2322: Signature 'new (param: Tstring): any' has no corresponding signature in 'interfaceWithPublicAndOptional' \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToObject.errors.txt b/tests/baselines/reference/assignmentToObject.errors.txt index aa1222bd799..796f8430b84 100644 --- a/tests/baselines/reference/assignmentToObject.errors.txt +++ b/tests/baselines/reference/assignmentToObject.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/assignmentToObject.ts(3,5): error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'. Types of property 'toString' are incompatible. Type 'number' is not assignable to type '() => string'. + Signature '(): string' has no corresponding signature in 'Number' ==== tests/cases/compiler/assignmentToObject.ts (1 errors) ==== @@ -11,4 +12,5 @@ tests/cases/compiler/assignmentToObject.ts(3,5): error TS2322: Type '{ toString: !!! error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'. !!! error TS2322: Types of property 'toString' are incompatible. !!! error TS2322: Type 'number' is not assignable to type '() => string'. +!!! error TS2322: Signature '(): string' has no corresponding signature in 'Number' \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt index 2e85ee101f5..881b29bf443 100644 --- a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt +++ b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt @@ -1,11 +1,13 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(1,5): error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'. Types of property 'toString' are incompatible. Type 'number' is not assignable to type '() => string'. + Signature '(): string' has no corresponding signature in 'Number' tests/cases/compiler/assignmentToObjectAndFunction.ts(8,5): error TS2322: Type '{}' is not assignable to type 'Function'. Property 'apply' is missing in type '{}'. tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type 'typeof bad' is not assignable to type 'Function'. Types of property 'apply' are incompatible. Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'. + Signature '(thisArg: any, argArray?: any): any' has no corresponding signature in 'Number' ==== tests/cases/compiler/assignmentToObjectAndFunction.ts (3 errors) ==== @@ -14,6 +16,7 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type !!! error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'. !!! error TS2322: Types of property 'toString' are incompatible. !!! error TS2322: Type 'number' is not assignable to type '() => string'. +!!! error TS2322: Signature '(): string' has no corresponding signature in 'Number' var goodObj: Object = { toString(x?) { return ""; @@ -48,4 +51,5 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type ~~~~~~~~~~ !!! error TS2322: Type 'typeof bad' is not assignable to type 'Function'. !!! error TS2322: Types of property 'apply' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'. +!!! error TS2322: Signature '(thisArg: any, argArray?: any): any' has no corresponding signature in 'Number' \ No newline at end of file diff --git a/tests/baselines/reference/asyncFunctionDeclaration15_es6.errors.txt b/tests/baselines/reference/asyncFunctionDeclaration15_es6.errors.txt index bc1ef24127a..8aa24d79ac0 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration15_es6.errors.txt +++ b/tests/baselines/reference/asyncFunctionDeclaration15_es6.errors.txt @@ -3,10 +3,12 @@ tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration1 tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts(8,16): error TS1055: Type 'number' is not a valid async function return type. tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts(9,16): error TS1055: Type 'PromiseLike' is not a valid async function return type. tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts(10,16): error TS1055: Type 'typeof Thenable' is not a valid async function return type. - Type 'Thenable' is not assignable to type 'PromiseLike'. - Types of property 'then' are incompatible. - Type '() => void' is not assignable to type '{ (onfulfilled?: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; (onfulfilled?: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; }'. - Type 'void' is not assignable to type 'PromiseLike'. + Signature 'new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): PromiseLike' has no corresponding signature in 'typeof Thenable' + Type 'Thenable' is not assignable to type 'PromiseLike'. + Types of property 'then' are incompatible. + Type '() => void' is not assignable to type '{ (onfulfilled?: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; (onfulfilled?: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; }'. + Signature '(onfulfilled?: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike' has no corresponding signature in '() => void' + Type 'void' is not assignable to type 'PromiseLike'. tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts(17,16): error TS1059: Return expression in async function does not have a valid callable 'then' member. tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts(23,25): error TS1058: Operand for 'await' does not have a valid callable 'then' member. @@ -32,10 +34,12 @@ tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration1 async function fn6(): Thenable { } // error ~~~ !!! error TS1055: Type 'typeof Thenable' is not a valid async function return type. -!!! error TS1055: Type 'Thenable' is not assignable to type 'PromiseLike'. -!!! error TS1055: Types of property 'then' are incompatible. -!!! error TS1055: Type '() => void' is not assignable to type '{ (onfulfilled?: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; (onfulfilled?: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; }'. -!!! error TS1055: Type 'void' is not assignable to type 'PromiseLike'. +!!! error TS1055: Signature 'new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): PromiseLike' has no corresponding signature in 'typeof Thenable' +!!! error TS1055: Type 'Thenable' is not assignable to type 'PromiseLike'. +!!! error TS1055: Types of property 'then' are incompatible. +!!! error TS1055: Type '() => void' is not assignable to type '{ (onfulfilled?: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; (onfulfilled?: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; }'. +!!! error TS1055: Signature '(onfulfilled?: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike' has no corresponding signature in '() => void' +!!! error TS1055: Type 'void' is not assignable to type 'PromiseLike'. async function fn7() { return; } // valid: Promise async function fn8() { return 1; } // valid: Promise async function fn9() { return null; } // valid: Promise diff --git a/tests/baselines/reference/booleanAssignment.errors.txt b/tests/baselines/reference/booleanAssignment.errors.txt index 454bd7ef707..b16cca5c1bb 100644 --- a/tests/baselines/reference/booleanAssignment.errors.txt +++ b/tests/baselines/reference/booleanAssignment.errors.txt @@ -1,15 +1,18 @@ tests/cases/compiler/booleanAssignment.ts(2,1): error TS2322: Type 'number' is not assignable to type 'Boolean'. Types of property 'valueOf' are incompatible. Type '() => number' is not assignable to type '() => boolean'. - Type 'number' is not assignable to type 'boolean'. + Signature '(): boolean' has no corresponding signature in '() => number' + Type 'number' is not assignable to type 'boolean'. tests/cases/compiler/booleanAssignment.ts(3,1): error TS2322: Type 'string' is not assignable to type 'Boolean'. Types of property 'valueOf' are incompatible. Type '() => string' is not assignable to type '() => boolean'. - Type 'string' is not assignable to type 'boolean'. + Signature '(): boolean' has no corresponding signature in '() => string' + Type 'string' is not assignable to type 'boolean'. tests/cases/compiler/booleanAssignment.ts(4,1): error TS2322: Type '{}' is not assignable to type 'Boolean'. Types of property 'valueOf' are incompatible. Type '() => Object' is not assignable to type '() => boolean'. - Type 'Object' is not assignable to type 'boolean'. + Signature '(): boolean' has no corresponding signature in '() => Object' + Type 'Object' is not assignable to type 'boolean'. ==== tests/cases/compiler/booleanAssignment.ts (3 errors) ==== @@ -19,19 +22,22 @@ tests/cases/compiler/booleanAssignment.ts(4,1): error TS2322: Type '{}' is not a !!! error TS2322: Type 'number' is not assignable to type 'Boolean'. !!! error TS2322: Types of property 'valueOf' are incompatible. !!! error TS2322: Type '() => number' is not assignable to type '() => boolean'. -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Signature '(): boolean' has no corresponding signature in '() => number' +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. b = "a"; // Error ~ !!! error TS2322: Type 'string' is not assignable to type 'Boolean'. !!! error TS2322: Types of property 'valueOf' are incompatible. !!! error TS2322: Type '() => string' is not assignable to type '() => boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Signature '(): boolean' has no corresponding signature in '() => string' +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. b = {}; // Error ~ !!! error TS2322: Type '{}' is not assignable to type 'Boolean'. !!! error TS2322: Types of property 'valueOf' are incompatible. !!! error TS2322: Type '() => Object' is not assignable to type '() => boolean'. -!!! error TS2322: Type 'Object' is not assignable to type 'boolean'. +!!! error TS2322: Signature '(): boolean' has no corresponding signature in '() => Object' +!!! error TS2322: Type 'Object' is not assignable to type 'boolean'. var o = {}; o = b; // OK diff --git a/tests/baselines/reference/callConstructAssignment.errors.txt b/tests/baselines/reference/callConstructAssignment.errors.txt index 42949cf585d..e52d8b1f063 100644 --- a/tests/baselines/reference/callConstructAssignment.errors.txt +++ b/tests/baselines/reference/callConstructAssignment.errors.txt @@ -1,5 +1,7 @@ tests/cases/compiler/callConstructAssignment.ts(7,1): error TS2322: Type 'new () => any' is not assignable to type '() => void'. + Signature '(): void' has no corresponding signature in 'new () => any' tests/cases/compiler/callConstructAssignment.ts(8,1): error TS2322: Type '() => void' is not assignable to type 'new () => any'. + Signature 'new (): any' has no corresponding signature in '() => void' ==== tests/cases/compiler/callConstructAssignment.ts (2 errors) ==== @@ -12,6 +14,8 @@ tests/cases/compiler/callConstructAssignment.ts(8,1): error TS2322: Type '() => foo = bar; // error ~~~ !!! error TS2322: Type 'new () => any' is not assignable to type '() => void'. +!!! error TS2322: Signature '(): void' has no corresponding signature in 'new () => any' bar = foo; // error ~~~ -!!! error TS2322: Type '() => void' is not assignable to type 'new () => any'. \ No newline at end of file +!!! error TS2322: Type '() => void' is not assignable to type 'new () => any'. +!!! error TS2322: Signature 'new (): any' has no corresponding signature in '() => void' \ No newline at end of file diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt index d6efdd66868..3e66787b54d 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt @@ -1,7 +1,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance.ts(57,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. Type '(x: number) => string' is not assignable to type '(x: number) => number'. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): number' has no corresponding signature in '(x: number) => string' + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance.ts (1 errors) ==== @@ -66,7 +67,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign !!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type '(x: number) => string' is not assignable to type '(x: number) => number'. -!!! error TS2430: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Signature '(x: number): number' has no corresponding signature in '(x: number) => string' +!!! error TS2430: Type 'string' is not assignable to type 'number'. // N's a: (x: number) => string; // error because base returns non-void; } diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt index 7e9d75b1b41..b3bdb17ea71 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt @@ -1,17 +1,20 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(51,19): error TS2430: Interface 'I2' incorrectly extends interface 'A'. Types of property 'a2' are incompatible. Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]'. - Types of parameters 'x' and 'x' are incompatible. - Type 'T' is not assignable to type 'number'. + Signature '(x: number): string[]' has no corresponding signature in '(x: T) => U[]' + Types of parameters 'x' and 'x' are incompatible. + Type 'T' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(60,19): error TS2430: Interface 'I4' incorrectly extends interface 'A'. Types of property 'a8' are incompatible. Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. - Types of parameters 'y' and 'y' are incompatible. - Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. - Types of parameters 'arg2' and 'arg2' are incompatible. - Type '{ foo: number; }' is not assignable to type 'Base'. - Types of property 'foo' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived): (r: Base) => Derived' has no corresponding signature in '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. + Signature '(arg2: Base): Derived' has no corresponding signature in '(arg2: { foo: number; }) => any' + Types of parameters 'arg2' and 'arg2' are incompatible. + Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. + Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts (2 errors) ==== @@ -70,8 +73,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign !!! error TS2430: Interface 'I2' incorrectly extends interface 'A'. !!! error TS2430: Types of property 'a2' are incompatible. !!! error TS2430: Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]'. -!!! error TS2430: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2430: Type 'T' is not assignable to type 'number'. +!!! error TS2430: Signature '(x: number): string[]' has no corresponding signature in '(x: T) => U[]' +!!! error TS2430: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type 'number'. a2: (x: T) => U[]; // error, no contextual signature instantiation since I2.a2 is not generic } @@ -85,12 +89,14 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign !!! error TS2430: Interface 'I4' incorrectly extends interface 'A'. !!! error TS2430: Types of property 'a8' are incompatible. !!! error TS2430: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. -!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. -!!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible. -!!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'. -!!! error TS2430: Types of property 'foo' are incompatible. -!!! error TS2430: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Signature '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived): (r: Base) => Derived' has no corresponding signature in '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' +!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. +!!! error TS2430: Signature '(arg2: Base): Derived' has no corresponding signature in '(arg2: { foo: number; }) => any' +!!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2430: Types of property 'foo' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a8: (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch } diff --git a/tests/baselines/reference/castingTuple.errors.txt b/tests/baselines/reference/castingTuple.errors.txt index 62a36c9c156..cdf40eeeff6 100644 --- a/tests/baselines/reference/castingTuple.errors.txt +++ b/tests/baselines/reference/castingTuple.errors.txt @@ -13,8 +13,9 @@ tests/cases/conformance/types/tuple/castingTuple.ts(30,5): error TS2403: Subsequ tests/cases/conformance/types/tuple/castingTuple.ts(30,14): error TS2352: Neither type '[number, string]' nor type 'number[]' is assignable to the other. Types of property 'pop' are incompatible. Type '() => number | string' is not assignable to type '() => number'. - Type 'number | string' is not assignable to type 'number'. - Type 'string' is not assignable to type 'number'. + Signature '(): number' has no corresponding signature in '() => number | string' + Type 'number | string' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/tuple/castingTuple.ts(31,1): error TS2304: Cannot find name 't4'. @@ -70,8 +71,9 @@ tests/cases/conformance/types/tuple/castingTuple.ts(31,1): error TS2304: Cannot !!! error TS2352: Neither type '[number, string]' nor type 'number[]' is assignable to the other. !!! error TS2352: Types of property 'pop' are incompatible. !!! error TS2352: Type '() => number | string' is not assignable to type '() => number'. -!!! error TS2352: Type 'number | string' is not assignable to type 'number'. -!!! error TS2352: Type 'string' is not assignable to type 'number'. +!!! error TS2352: Signature '(): number' has no corresponding signature in '() => number | string' +!!! error TS2352: Type 'number | string' is not assignable to type 'number'. +!!! error TS2352: Type 'string' is not assignable to type 'number'. t4[2] = 10; ~~ !!! error TS2304: Cannot find name 't4'. diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt index 181bfcc907d..579f6c47138 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts(19,59): error TS2345: Argument of type '(c: C) => B' is not assignable to parameter of type '(x: C) => C'. - Type 'B' is not assignable to type 'C'. - Property 'z' is missing in type 'B'. + Signature '(x: C): C' has no corresponding signature in '(c: C) => B' + Type 'B' is not assignable to type 'C'. + Property 'z' is missing in type 'B'. ==== tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts (1 errors) ==== @@ -25,5 +26,6 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParamete (new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then(b => new A); ~~~~~~~~~~ !!! error TS2345: Argument of type '(c: C) => B' is not assignable to parameter of type '(x: C) => C'. -!!! error TS2345: Type 'B' is not assignable to type 'C'. -!!! error TS2345: Property 'z' is missing in type 'B'. \ No newline at end of file +!!! error TS2345: Signature '(x: C): C' has no corresponding signature in '(c: C) => B' +!!! error TS2345: Type 'B' is not assignable to type 'C'. +!!! error TS2345: Property 'z' is missing in type 'B'. \ No newline at end of file diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt index 8f5924586df..1de7ead6e04 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt @@ -1,7 +1,9 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(7,43): error TS2345: Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'. - Type 'T' is not assignable to type 'S'. + Signature '(x: S): S' has no corresponding signature in '(ss: S) => T' + Type 'T' is not assignable to type 'S'. tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(10,29): error TS2345: Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'. - Type 'T' is not assignable to type 'S'. + Signature '(x: S): S' has no corresponding signature in '(ss: S) => T' + Type 'T' is not assignable to type 'S'. tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(32,9): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(36,9): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(37,9): error TS2322: Type 'string' is not assignable to type 'number'. @@ -17,13 +19,15 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParamete (new Chain(t)).then(tt => s).then(ss => t); ~~~~~~~ !!! error TS2345: Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'. -!!! error TS2345: Type 'T' is not assignable to type 'S'. +!!! error TS2345: Signature '(x: S): S' has no corresponding signature in '(ss: S) => T' +!!! error TS2345: Type 'T' is not assignable to type 'S'. // But error to try to climb up the chain (new Chain(s)).then(ss => t); ~~~~~~~ !!! error TS2345: Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'. -!!! error TS2345: Type 'T' is not assignable to type 'S'. +!!! error TS2345: Signature '(x: S): S' has no corresponding signature in '(ss: S) => T' +!!! error TS2345: Type 'T' is not assignable to type 'S'. // Staying at T or S should be fine (new Chain(t)).then(tt => t).then(tt => t).then(tt => t); diff --git a/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.errors.txt b/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.errors.txt index c6c242396d8..5cb9a2e7f08 100644 --- a/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.errors.txt +++ b/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.errors.txt @@ -1,6 +1,7 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAssignabilityConstructorFunction.ts(7,1): error TS2322: Type 'typeof A' is not assignable to type 'new () => A'. Cannot assign an abstract constructor type to a non-abstract constructor type. tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAssignabilityConstructorFunction.ts(8,1): error TS2322: Type 'string' is not assignable to type 'new () => A'. + Signature 'new (): A' has no corresponding signature in 'String' ==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAssignabilityConstructorFunction.ts (2 errors) ==== @@ -16,4 +17,5 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbst !!! error TS2322: Cannot assign an abstract constructor type to a non-abstract constructor type. AAA = "asdf"; ~~~ -!!! error TS2322: Type 'string' is not assignable to type 'new () => A'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'new () => A'. +!!! error TS2322: Signature 'new (): A' has no corresponding signature in 'String' \ No newline at end of file diff --git a/tests/baselines/reference/classSideInheritance3.errors.txt b/tests/baselines/reference/classSideInheritance3.errors.txt index c845defa5b8..4d6a5a9b018 100644 --- a/tests/baselines/reference/classSideInheritance3.errors.txt +++ b/tests/baselines/reference/classSideInheritance3.errors.txt @@ -1,5 +1,7 @@ tests/cases/compiler/classSideInheritance3.ts(16,5): error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. + Signature 'new (x: string): A' has no corresponding signature in 'typeof B' tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2322: Type 'typeof B' is not assignable to type 'new (x: string) => A'. + Signature 'new (x: string): A' has no corresponding signature in 'typeof B' ==== tests/cases/compiler/classSideInheritance3.ts (2 errors) ==== @@ -21,7 +23,9 @@ tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2322: Type 'typeof var r1: typeof A = B; // error ~~ !!! error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. +!!! error TS2322: Signature 'new (x: string): A' has no corresponding signature in 'typeof B' var r2: new (x: string) => A = B; // error ~~ !!! error TS2322: Type 'typeof B' is not assignable to type 'new (x: string) => A'. +!!! error TS2322: Signature 'new (x: string): A' has no corresponding signature in 'typeof B' var r3: typeof A = C; // ok \ No newline at end of file diff --git a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt index 2fa13333058..867a044420d 100644 --- a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt @@ -6,13 +6,16 @@ tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithou Property 'propertyB' is missing in type 'A'. tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(19,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number'. Type '(n: X) => string' is not assignable to type '(t: X) => number'. - Type 'string' is not assignable to type 'number'. + Signature '(t: X): number' has no corresponding signature in '(n: X) => string' + Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(20,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string'. Type '(m: X) => number' is not assignable to type '(t: X) => string'. - Type 'number' is not assignable to type 'string'. + Signature '(t: X): string' has no corresponding signature in '(m: X) => number' + Type 'number' is not assignable to type 'string'. tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(21,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean'. Type '(m: X) => number' is not assignable to type '(t: X) => boolean'. - Type 'number' is not assignable to type 'boolean'. + Signature '(t: X): boolean' has no corresponding signature in '(m: X) => number' + Type 'number' is not assignable to type 'boolean'. ==== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts (5 errors) ==== @@ -46,16 +49,19 @@ tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithou ~~~~~~~ !!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number'. !!! error TS2322: Type '(n: X) => string' is not assignable to type '(t: X) => number'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(t: X): number' has no corresponding signature in '(n: X) => string' +!!! error TS2322: Type 'string' is not assignable to type 'number'. var result5: (t: X) => string = true ? (m) => m.propertyX1 : (n) => n.propertyX2; ~~~~~~~ !!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string'. !!! error TS2322: Type '(m: X) => number' is not assignable to type '(t: X) => string'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature '(t: X): string' has no corresponding signature in '(m: X) => number' +!!! error TS2322: Type 'number' is not assignable to type 'string'. var result6: (t: X) => boolean = true ? (m) => m.propertyX1 : (n) => n.propertyX2; ~~~~~~~ !!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean'. !!! error TS2322: Type '(m: X) => number' is not assignable to type '(t: X) => boolean'. -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Signature '(t: X): boolean' has no corresponding signature in '(m: X) => number' +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. var result61: (t: X) => number| string = true ? (m) => m.propertyX1 : (n) => n.propertyX2; \ No newline at end of file diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt index 51278fc3f44..178239b729e 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt @@ -1,7 +1,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance.ts(61,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number'. - Type 'string' is not assignable to type 'number'. + Signature 'new (x: number): number' has no corresponding signature in 'new (x: number) => string' + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance.ts (1 errors) ==== @@ -70,7 +71,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc !!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number'. -!!! error TS2430: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Signature 'new (x: number): number' has no corresponding signature in 'new (x: number) => string' +!!! error TS2430: Type 'string' is not assignable to type 'number'. // N's a: new (x: number) => string; // error because base returns non-void; } diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt index 8d6273804f7..5125fc27301 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt @@ -1,17 +1,20 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts(41,19): error TS2430: Interface 'I2' incorrectly extends interface 'A'. Types of property 'a2' are incompatible. Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]'. - Types of parameters 'x' and 'x' are incompatible. - Type 'T' is not assignable to type 'number'. + Signature 'new (x: number): string[]' has no corresponding signature in 'new (x: T) => U[]' + Types of parameters 'x' and 'x' are incompatible. + Type 'T' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts(50,19): error TS2430: Interface 'I4' incorrectly extends interface 'A'. Types of property 'a8' are incompatible. Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. - Types of parameters 'y' and 'y' are incompatible. - Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. - Types of parameters 'arg2' and 'arg2' are incompatible. - Type '{ foo: number; }' is not assignable to type 'Base'. - Types of property 'foo' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived): (r: Base) => Derived' has no corresponding signature in 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. + Signature '(arg2: Base): Derived' has no corresponding signature in '(arg2: { foo: number; }) => any' + Types of parameters 'arg2' and 'arg2' are incompatible. + Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. + Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts (2 errors) ==== @@ -60,8 +63,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc !!! error TS2430: Interface 'I2' incorrectly extends interface 'A'. !!! error TS2430: Types of property 'a2' are incompatible. !!! error TS2430: Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]'. -!!! error TS2430: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2430: Type 'T' is not assignable to type 'number'. +!!! error TS2430: Signature 'new (x: number): string[]' has no corresponding signature in 'new (x: T) => U[]' +!!! error TS2430: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type 'number'. a2: new (x: T) => U[]; // error, no contextual signature instantiation since I2.a2 is not generic } @@ -75,12 +79,14 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc !!! error TS2430: Interface 'I4' incorrectly extends interface 'A'. !!! error TS2430: Types of property 'a8' are incompatible. !!! error TS2430: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. -!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. -!!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible. -!!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'. -!!! error TS2430: Types of property 'foo' are incompatible. -!!! error TS2430: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Signature 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived): (r: Base) => Derived' has no corresponding signature in 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' +!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. +!!! error TS2430: Signature '(arg2: Base): Derived' has no corresponding signature in '(arg2: { foo: number; }) => any' +!!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2430: Types of property 'foo' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a8: new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch } diff --git a/tests/baselines/reference/constructorAsType.errors.txt b/tests/baselines/reference/constructorAsType.errors.txt index b0d30295cde..3bf3dc688ed 100644 --- a/tests/baselines/reference/constructorAsType.errors.txt +++ b/tests/baselines/reference/constructorAsType.errors.txt @@ -1,10 +1,12 @@ tests/cases/compiler/constructorAsType.ts(1,5): error TS2322: Type '() => { name: string; }' is not assignable to type 'new () => { name: string; }'. + Signature 'new (): { name: string; }' has no corresponding signature in '() => { name: string; }' ==== tests/cases/compiler/constructorAsType.ts (1 errors) ==== var Person:new () => {name: string;} = function () {return {name:"joe"};}; ~~~~~~ !!! error TS2322: Type '() => { name: string; }' is not assignable to type 'new () => { name: string; }'. +!!! error TS2322: Signature 'new (): { name: string; }' has no corresponding signature in '() => { name: string; }' var Person2:{new() : {name:string;};}; diff --git a/tests/baselines/reference/contextualTypeWithTuple.errors.txt b/tests/baselines/reference/contextualTypeWithTuple.errors.txt index e447ed62b39..249e96c8829 100644 --- a/tests/baselines/reference/contextualTypeWithTuple.errors.txt +++ b/tests/baselines/reference/contextualTypeWithTuple.errors.txt @@ -1,9 +1,10 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(3,5): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. Types of property 'pop' are incompatible. Type '() => number | string | boolean' is not assignable to type '() => number | string'. - Type 'number | string | boolean' is not assignable to type 'number | string'. - Type 'boolean' is not assignable to type 'number | string'. - Type 'boolean' is not assignable to type 'string'. + Signature '(): number | string' has no corresponding signature in '() => number | string | boolean' + Type 'number | string | boolean' is not assignable to type 'number | string'. + Type 'boolean' is not assignable to type 'number | string'. + Type 'boolean' is not assignable to type 'string'. tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(15,1): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(18,1): error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]'. Types of property '0' are incompatible. @@ -14,8 +15,9 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(19,1): error TS23 tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(20,5): error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]'. Types of property 'pop' are incompatible. Type '() => string | number' is not assignable to type '() => string'. - Type 'string | number' is not assignable to type 'string'. - Type 'number' is not assignable to type 'string'. + Signature '(): string' has no corresponding signature in '() => string | number' + Type 'string | number' is not assignable to type 'string'. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(24,1): error TS2322: Type '[C, string | number]' is not assignable to type '[C, string | number, D]'. Property '2' is missing in type '[C, string | number]'. tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(25,1): error TS2322: Type '[number, string | number]' is not assignable to type '[number, string]'. @@ -32,9 +34,10 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(25,1): error TS23 !!! error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. !!! error TS2322: Types of property 'pop' are incompatible. !!! error TS2322: Type '() => number | string | boolean' is not assignable to type '() => number | string'. -!!! error TS2322: Type 'number | string | boolean' is not assignable to type 'number | string'. -!!! error TS2322: Type 'boolean' is not assignable to type 'number | string'. -!!! error TS2322: Type 'boolean' is not assignable to type 'string'. +!!! error TS2322: Signature '(): number | string' has no corresponding signature in '() => number | string | boolean' +!!! error TS2322: Type 'number | string | boolean' is not assignable to type 'number | string'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number | string'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string'. var numStrBoolTuple: [number, string, boolean] = [5, "foo", true]; var objNumTuple: [{ a: string }, number] = [{ a: "world" }, 5]; var strTupleTuple: [string, [number, {}]] = ["bar", [5, { x: 1, y: 1 }]]; @@ -66,8 +69,9 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(25,1): error TS23 !!! error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]'. !!! error TS2322: Types of property 'pop' are incompatible. !!! error TS2322: Type '() => string | number' is not assignable to type '() => string'. -!!! error TS2322: Type 'string | number' is not assignable to type 'string'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature '(): string' has no corresponding signature in '() => string | number' +!!! error TS2322: Type 'string | number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. unionTuple = unionTuple1; unionTuple = unionTuple2; diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt index 8be323f9af4..1e0865de8db 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt +++ b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt @@ -27,8 +27,9 @@ tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts( Type '{ commonMethodDifferentReturnType: (a: string, b: number) => string | number; }' is not assignable to type 'I21'. Types of property 'commonMethodDifferentReturnType' are incompatible. Type '(a: string, b: number) => string | number' is not assignable to type '(a: string, b: number) => number'. - Type 'string | number' is not assignable to type 'number'. - Type 'string' is not assignable to type 'number'. + Signature '(a: string, b: number): number' has no corresponding signature in '(a: string, b: number) => string | number' + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts (6 errors) ==== @@ -124,7 +125,8 @@ tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts( !!! error TS2322: Type '{ commonMethodDifferentReturnType: (a: string, b: number) => string | number; }' is not assignable to type 'I21'. !!! error TS2322: Types of property 'commonMethodDifferentReturnType' are incompatible. !!! error TS2322: Type '(a: string, b: number) => string | number' is not assignable to type '(a: string, b: number) => number'. -!!! error TS2322: Type 'string | number' is not assignable to type 'number'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(a: string, b: number): number' has no corresponding signature in '(a: string, b: number) => string | number' +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. commonMethodDifferentReturnType: (a, b) => strOrNumber, }; \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping24.errors.txt b/tests/baselines/reference/contextualTyping24.errors.txt index a172600e1c5..1d1fd191944 100644 --- a/tests/baselines/reference/contextualTyping24.errors.txt +++ b/tests/baselines/reference/contextualTyping24.errors.txt @@ -1,11 +1,15 @@ tests/cases/compiler/contextualTyping24.ts(1,55): error TS2322: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. - Types of parameters 'a' and 'a' are incompatible. - Type 'string' is not assignable to type '{ (): number; (i: number): number; }'. + Signature '(a: { (): number; (i: number): number; }): number' has no corresponding signature in '(a: string) => number' + Types of parameters 'a' and 'a' are incompatible. + Type 'string' is not assignable to type '{ (): number; (i: number): number; }'. + Signature '(): number' has no corresponding signature in 'String' ==== tests/cases/compiler/contextualTyping24.ts (1 errors) ==== var foo:(a:{():number; (i:number):number; })=>number; foo = function(a:string){return 5}; ~~~ !!! error TS2322: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. -!!! error TS2322: Types of parameters 'a' and 'a' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type '{ (): number; (i: number): number; }'. \ No newline at end of file +!!! error TS2322: Signature '(a: { (): number; (i: number): number; }): number' has no corresponding signature in '(a: string) => number' +!!! error TS2322: Types of parameters 'a' and 'a' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type '{ (): number; (i: number): number; }'. +!!! error TS2322: Signature '(): number' has no corresponding signature in 'String' \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping39.errors.txt b/tests/baselines/reference/contextualTyping39.errors.txt index e43624fbead..3cf5e5aa9ff 100644 --- a/tests/baselines/reference/contextualTyping39.errors.txt +++ b/tests/baselines/reference/contextualTyping39.errors.txt @@ -1,9 +1,11 @@ tests/cases/compiler/contextualTyping39.ts(1,11): error TS2352: Neither type '() => string' nor type '() => number' is assignable to the other. - Type 'string' is not assignable to type 'number'. + Signature '(): number' has no corresponding signature in '() => string' + Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/contextualTyping39.ts (1 errors) ==== var foo = <{ (): number; }> function() { return "err"; }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2352: Neither type '() => string' nor type '() => number' is assignable to the other. -!!! error TS2352: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2352: Signature '(): number' has no corresponding signature in '() => string' +!!! error TS2352: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping41.errors.txt b/tests/baselines/reference/contextualTyping41.errors.txt index 1ed6da1b782..a3e33f26ddd 100644 --- a/tests/baselines/reference/contextualTyping41.errors.txt +++ b/tests/baselines/reference/contextualTyping41.errors.txt @@ -1,9 +1,11 @@ tests/cases/compiler/contextualTyping41.ts(1,11): error TS2352: Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other. - Type 'string' is not assignable to type 'number'. + Signature '(): number' has no corresponding signature in '() => string' + Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/contextualTyping41.ts (1 errors) ==== var foo = <{():number; (i:number):number; }> (function(){return "err";}); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2352: Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other. -!!! error TS2352: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2352: Signature '(): number' has no corresponding signature in '() => string' +!!! error TS2352: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt b/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt index 08fe22c08e0..6fbf1b12967 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt @@ -1,8 +1,9 @@ tests/cases/compiler/contextualTypingOfConditionalExpression2.ts(11,5): error TS2322: Type '((a: C) => number) | ((b: number) => void)' is not assignable to type '(a: A) => void'. Type '(b: number) => void' is not assignable to type '(a: A) => void'. - Types of parameters 'b' and 'a' are incompatible. - Type 'number' is not assignable to type 'A'. - Property 'foo' is missing in type 'Number'. + Signature '(a: A): void' has no corresponding signature in '(b: number) => void' + Types of parameters 'b' and 'a' are incompatible. + Type 'number' is not assignable to type 'A'. + Property 'foo' is missing in type 'Number'. ==== tests/cases/compiler/contextualTypingOfConditionalExpression2.ts (1 errors) ==== @@ -20,7 +21,8 @@ tests/cases/compiler/contextualTypingOfConditionalExpression2.ts(11,5): error TS ~~ !!! error TS2322: Type '((a: C) => number) | ((b: number) => void)' is not assignable to type '(a: A) => void'. !!! error TS2322: Type '(b: number) => void' is not assignable to type '(a: A) => void'. -!!! error TS2322: Types of parameters 'b' and 'a' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'A'. -!!! error TS2322: Property 'foo' is missing in type 'Number'. +!!! error TS2322: Signature '(a: A): void' has no corresponding signature in '(b: number) => void' +!!! error TS2322: Types of parameters 'b' and 'a' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'A'. +!!! error TS2322: Property 'foo' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt index a11f0009016..530993a7e23 100644 --- a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt +++ b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt @@ -1,8 +1,10 @@ tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts(16,32): error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. - Type 'string' is not assignable to type 'Date'. - Property 'toDateString' is missing in type 'String'. + Signature '(x: number): Date' has no corresponding signature in '(x: number) => string' + Type 'string' is not assignable to type 'Date'. + Property 'toDateString' is missing in type 'String'. tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts(17,32): error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. - Type 'string' is not assignable to type 'Date'. + Signature '(x: number): Date' has no corresponding signature in '(x: number) => string' + Type 'string' is not assignable to type 'Date'. ==== tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts (2 errors) ==== @@ -24,10 +26,12 @@ tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts(17,32): var r5 = _.forEach(c2, f); ~ !!! error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. -!!! error TS2345: Type 'string' is not assignable to type 'Date'. -!!! error TS2345: Property 'toDateString' is missing in type 'String'. +!!! error TS2345: Signature '(x: number): Date' has no corresponding signature in '(x: number) => string' +!!! error TS2345: Type 'string' is not assignable to type 'Date'. +!!! error TS2345: Property 'toDateString' is missing in type 'String'. var r6 = _.forEach(c2, (x) => { return x.toFixed() }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. -!!! error TS2345: Type 'string' is not assignable to type 'Date'. +!!! error TS2345: Signature '(x: number): Date' has no corresponding signature in '(x: number) => string' +!!! error TS2345: Type 'string' is not assignable to type 'Date'. \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity.errors.txt b/tests/baselines/reference/derivedClassTransitivity.errors.txt index c6b620beb18..5f47163f13f 100644 --- a/tests/baselines/reference/derivedClassTransitivity.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'. Types of property 'foo' are incompatible. Type '(x?: string) => void' is not assignable to type '(x: number) => void'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x?: string) => void' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity.ts (1 errors) ==== @@ -28,7 +29,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra !!! error TS2322: Type 'E' is not assignable to type 'C'. !!! error TS2322: Types of property 'foo' are incompatible. !!! error TS2322: Type '(x?: string) => void' is not assignable to type '(x: number) => void'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x?: string) => void' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var r = c.foo(1); var r2 = e.foo(''); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity2.errors.txt b/tests/baselines/reference/derivedClassTransitivity2.errors.txt index a8d2003c876..16aa54ef101 100644 --- a/tests/baselines/reference/derivedClassTransitivity2.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity2.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity2.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'. Types of property 'foo' are incompatible. Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void'. - Types of parameters 'y' and 'y' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number, y: number): void' has no corresponding signature in '(x: number, y?: string) => void' + Types of parameters 'y' and 'y' are incompatible. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity2.ts (1 errors) ==== @@ -28,7 +29,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra !!! error TS2322: Type 'E' is not assignable to type 'C'. !!! error TS2322: Types of property 'foo' are incompatible. !!! error TS2322: Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void'. -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number, y: number): void' has no corresponding signature in '(x: number, y?: string) => void' +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var r = c.foo(1, 1); var r2 = e.foo(1, ''); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity3.errors.txt b/tests/baselines/reference/derivedClassTransitivity3.errors.txt index 9d301255dfd..837c6db67c4 100644 --- a/tests/baselines/reference/derivedClassTransitivity3.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity3.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity3.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'. Types of property 'foo' are incompatible. Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void'. - Types of parameters 'y' and 'y' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(x: string, y: string): void' has no corresponding signature in '(x: string, y?: number) => void' + Types of parameters 'y' and 'y' are incompatible. + Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity3.ts (1 errors) ==== @@ -28,7 +29,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra !!! error TS2322: Type 'E' is not assignable to type 'C'. !!! error TS2322: Types of property 'foo' are incompatible. !!! error TS2322: Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void'. -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature '(x: string, y: string): void' has no corresponding signature in '(x: string, y?: number) => void' +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var r = c.foo('', ''); var r2 = e.foo('', 1); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity4.errors.txt b/tests/baselines/reference/derivedClassTransitivity4.errors.txt index c1a80e0a1d7..47d1d767fbd 100644 --- a/tests/baselines/reference/derivedClassTransitivity4.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity4.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity4.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'. Types of property 'foo' are incompatible. Type '(x?: string) => void' is not assignable to type '(x: number) => void'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x?: string) => void' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity4.ts(19,9): error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses. @@ -29,8 +30,9 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra !!! error TS2322: Type 'E' is not assignable to type 'C'. !!! error TS2322: Types of property 'foo' are incompatible. !!! error TS2322: Type '(x?: string) => void' is not assignable to type '(x: number) => void'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x?: string) => void' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var r = c.foo(1); ~~~~~ !!! error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses. diff --git a/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt b/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt index ae8fbe2ff5d..6f088a12a9a 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'. + Signature '(): (data: any, index?: number) => number' has no corresponding signature in '(x: (data: any, index?: number) => number) => D3SvgArea' ==== 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: Signature '(): (data: any, index?: number) => number' has no corresponding signature in '(x: (data: any, index?: number) => number) => D3SvgArea' 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/destructuringParameterDeclaration2.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt index c8037255a32..a3311319960 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt @@ -5,10 +5,11 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts( tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(8,4): error TS2345: Argument of type '[number, number, string[][], string]' is not assignable to parameter of type '[number, number, string[][]]'. Types of property 'pop' are incompatible. Type '() => number | string[][] | string' is not assignable to type '() => number | string[][]'. - Type 'number | string[][] | string' is not assignable to type 'number | string[][]'. - Type 'string' is not assignable to type 'number | string[][]'. - Type 'string' is not assignable to type 'string[][]'. - Property 'push' is missing in type 'String'. + Signature '(): number | string[][]' has no corresponding signature in '() => number | string[][] | string' + Type 'number | string[][] | string' is not assignable to type 'number | string[][]'. + Type 'string' is not assignable to type 'number | string[][]'. + Type 'string' is not assignable to type 'string[][]'. + Property 'push' is missing in type 'String'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(16,8): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(16,16): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(23,14): error TS2345: Argument of type '{ x: string; y: boolean; }' is not assignable to parameter of type '{ x: number; y: any; }'. @@ -47,9 +48,10 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts( tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(55,7): error TS2420: Class 'C4' incorrectly implements interface 'F2'. Types of property 'd4' are incompatible. Type '({x, y, c}: { x: any; y: any; c: any; }) => void' is not assignable to type '({x, y, z}?: { x: any; y: any; z: any; }) => any'. - Types of parameters '__0' and '__0' are incompatible. - Type '{ x: any; y: any; c: any; }' is not assignable to type '{ x: any; y: any; z: any; }'. - Property 'z' is missing in type '{ x: any; y: any; c: any; }'. + Signature '({x, y, z}?: { x: any; y: any; z: any; }): any' has no corresponding signature in '({x, y, c}: { x: any; y: any; c: any; }) => void' + Types of parameters '__0' and '__0' are incompatible. + Type '{ x: any; y: any; c: any; }' is not assignable to type '{ x: any; y: any; z: any; }'. + Property 'z' is missing in type '{ x: any; y: any; c: any; }'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(56,8): error TS2463: A binding pattern parameter cannot be optional in an implementation signature. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(65,18): error TS2300: Duplicate identifier 'number'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(65,26): error TS2300: Duplicate identifier 'number'. @@ -75,10 +77,11 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts( !!! error TS2345: Argument of type '[number, number, string[][], string]' is not assignable to parameter of type '[number, number, string[][]]'. !!! error TS2345: Types of property 'pop' are incompatible. !!! error TS2345: Type '() => number | string[][] | string' is not assignable to type '() => number | string[][]'. -!!! error TS2345: Type 'number | string[][] | string' is not assignable to type 'number | string[][]'. -!!! error TS2345: Type 'string' is not assignable to type 'number | string[][]'. -!!! error TS2345: Type 'string' is not assignable to type 'string[][]'. -!!! error TS2345: Property 'push' is missing in type 'String'. +!!! error TS2345: Signature '(): number | string[][]' has no corresponding signature in '() => number | string[][] | string' +!!! error TS2345: Type 'number | string[][] | string' is not assignable to type 'number | string[][]'. +!!! error TS2345: Type 'string' is not assignable to type 'number | string[][]'. +!!! error TS2345: Type 'string' is not assignable to type 'string[][]'. +!!! error TS2345: Property 'push' is missing in type 'String'. // If the declaration includes an initializer expression (which is permitted only @@ -179,9 +182,10 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts( !!! error TS2420: Class 'C4' incorrectly implements interface 'F2'. !!! error TS2420: Types of property 'd4' are incompatible. !!! error TS2420: Type '({x, y, c}: { x: any; y: any; c: any; }) => void' is not assignable to type '({x, y, z}?: { x: any; y: any; z: any; }) => any'. -!!! error TS2420: Types of parameters '__0' and '__0' are incompatible. -!!! error TS2420: Type '{ x: any; y: any; c: any; }' is not assignable to type '{ x: any; y: any; z: any; }'. -!!! error TS2420: Property 'z' is missing in type '{ x: any; y: any; c: any; }'. +!!! error TS2420: Signature '({x, y, z}?: { x: any; y: any; z: any; }): any' has no corresponding signature in '({x, y, c}: { x: any; y: any; c: any; }) => void' +!!! error TS2420: Types of parameters '__0' and '__0' are incompatible. +!!! error TS2420: Type '{ x: any; y: any; c: any; }' is not assignable to type '{ x: any; y: any; z: any; }'. +!!! error TS2420: Property 'z' is missing in type '{ x: any; y: any; c: any; }'. d3([a, b, c]?) { } // Error, binding pattern can't be optional in implementation signature ~~~~~~~~~~ !!! error TS2463: A binding pattern parameter cannot be optional in an implementation signature. diff --git a/tests/baselines/reference/enumAssignability.errors.txt b/tests/baselines/reference/enumAssignability.errors.txt index 4a060ac3456..55e28ed97d9 100644 --- a/tests/baselines/reference/enumAssignability.errors.txt +++ b/tests/baselines/reference/enumAssignability.errors.txt @@ -6,9 +6,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi Property 'toDateString' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(33,9): error TS2322: Type 'E' is not assignable to type 'void'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(36,9): error TS2322: Type 'E' is not assignable to type '() => {}'. + Signature '(): {}' has no corresponding signature in 'Number' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(37,9): error TS2322: Type 'E' is not assignable to type 'Function'. Property 'apply' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(38,9): error TS2322: Type 'E' is not assignable to type '(x: number) => string'. + Signature '(x: number): string' has no corresponding signature in 'Number' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(39,5): error TS2322: Type 'E' is not assignable to type 'C'. Property 'foo' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(40,5): error TS2322: Type 'E' is not assignable to type 'I'. @@ -18,6 +20,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(42,9): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. Property 'foo' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(43,9): error TS2322: Type 'E' is not assignable to type '(x: T) => T'. + Signature '(x: T): T' has no corresponding signature in 'Number' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(45,9): error TS2322: Type 'E' is not assignable to type 'String'. Property 'charAt' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(47,21): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. @@ -80,6 +83,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi var j: () => {} = e; ~ !!! error TS2322: Type 'E' is not assignable to type '() => {}'. +!!! error TS2322: Signature '(): {}' has no corresponding signature in 'Number' var k: Function = e; ~ !!! error TS2322: Type 'E' is not assignable to type 'Function'. @@ -87,6 +91,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi var l: (x: number) => string = e; ~ !!! error TS2322: Type 'E' is not assignable to type '(x: number) => string'. +!!! error TS2322: Signature '(x: number): string' has no corresponding signature in 'Number' ac = e; ~~ !!! error TS2322: Type 'E' is not assignable to type 'C'. @@ -106,6 +111,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi var o: (x: T) => T = e; ~ !!! error TS2322: Type 'E' is not assignable to type '(x: T) => T'. +!!! error TS2322: Signature '(x: T): T' has no corresponding signature in 'Number' var p: Number = e; var q: String = e; ~ diff --git a/tests/baselines/reference/errorElaboration.errors.txt b/tests/baselines/reference/errorElaboration.errors.txt index 94742d7d98b..42903f7fa04 100644 --- a/tests/baselines/reference/errorElaboration.errors.txt +++ b/tests/baselines/reference/errorElaboration.errors.txt @@ -1,7 +1,8 @@ tests/cases/compiler/errorElaboration.ts(12,5): error TS2345: Argument of type '() => Container>' is not assignable to parameter of type '() => Container>'. - Type 'Container>' is not assignable to type 'Container>'. - Type 'Ref' is not assignable to type 'Ref'. - Type 'string' is not assignable to type 'number'. + Signature '(): Container>' has no corresponding signature in '() => Container>' + Type 'Container>' is not assignable to type 'Container>'. + Type 'Ref' is not assignable to type 'Ref'. + Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/errorElaboration.ts (1 errors) ==== @@ -19,7 +20,8 @@ tests/cases/compiler/errorElaboration.ts(12,5): error TS2345: Argument of type ' foo(a); ~ !!! error TS2345: Argument of type '() => Container>' is not assignable to parameter of type '() => Container>'. -!!! error TS2345: Type 'Container>' is not assignable to type 'Container>'. -!!! error TS2345: Type 'Ref' is not assignable to type 'Ref'. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2345: Signature '(): Container>' has no corresponding signature in '() => Container>' +!!! error TS2345: Type 'Container>' is not assignable to type 'Container>'. +!!! error TS2345: Type 'Ref' is not assignable to type 'Ref'. +!!! error TS2345: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt b/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt index 403e79b8742..8fbd4052bf9 100644 --- a/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt +++ b/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt @@ -1,5 +1,6 @@ tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(1,5): error TS2322: Type '() => void' is not assignable to type '() => boolean'. - Type 'void' is not assignable to type 'boolean'. + Signature '(): boolean' has no corresponding signature in '() => void' + Type 'void' is not assignable to type 'boolean'. tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(2,37): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. @@ -7,7 +8,8 @@ tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(2,37): error TS2355: var n1: () => boolean = function () { }; // expect an error here ~~ !!! error TS2322: Type '() => void' is not assignable to type '() => boolean'. -!!! error TS2322: Type 'void' is not assignable to type 'boolean'. +!!! error TS2322: Signature '(): boolean' has no corresponding signature in '() => void' +!!! error TS2322: Type 'void' is not assignable to type 'boolean'. var n2: () => boolean = function ():boolean { }; // expect an error here ~~~~~~~ !!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt index 12478442472..6cacd56eb17 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt @@ -16,21 +16,26 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd Types of property 'id' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(46,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. - Types of parameters 'x' and 'x' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(x: string): number' has no corresponding signature in '(x: number) => boolean' + Types of parameters 'x' and 'x' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(47,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. - Types of parameters 'x' and 'x' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(x: string): number' has no corresponding signature in '(x: number) => boolean' + Types of parameters 'x' and 'x' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(48,5): error TS2322: Type '(x: string) => string' is not assignable to type '(x: string) => number'. - Type 'string' is not assignable to type 'number'. + Signature '(x: string): number' has no corresponding signature in '(x: string) => string' + Type 'string' is not assignable to type 'number'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(50,5): error TS2322: Type 'typeof N' is not assignable to type 'typeof M'. Types of property 'A' are incompatible. Type 'typeof N.A' is not assignable to type 'typeof M.A'. - Type 'N.A' is not assignable to type 'M.A'. - Property 'name' is missing in type 'A'. + Signature 'new (): A' has no corresponding signature in 'typeof A' + Type 'N.A' is not assignable to type 'M.A'. + Property 'name' is missing in type 'A'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(51,5): error TS2322: Type 'N.A' is not assignable to type 'M.A'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(52,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: number) => string'. - Type 'boolean' is not assignable to type 'string'. + Signature '(x: number): string' has no corresponding signature in '(x: number) => boolean' + Type 'boolean' is not assignable to type 'string'. ==== tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts (15 errors) ==== @@ -108,31 +113,36 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd var aFunction: typeof F = F2; ~~~~~~~~~ !!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature '(x: string): number' has no corresponding signature in '(x: number) => boolean' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var anOtherFunction: (x: string) => number = F2; ~~~~~~~~~~~~~~~ !!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature '(x: string): number' has no corresponding signature in '(x: number) => boolean' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var aLambda: typeof F = (x) => 'a string'; ~~~~~~~ !!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: string) => number'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: string): number' has no corresponding signature in '(x: string) => string' +!!! error TS2322: Type 'string' is not assignable to type 'number'. var aModule: typeof M = N; ~~~~~~~ !!! error TS2322: Type 'typeof N' is not assignable to type 'typeof M'. !!! error TS2322: Types of property 'A' are incompatible. !!! error TS2322: Type 'typeof N.A' is not assignable to type 'typeof M.A'. -!!! error TS2322: Type 'N.A' is not assignable to type 'M.A'. -!!! error TS2322: Property 'name' is missing in type 'A'. +!!! error TS2322: Signature 'new (): A' has no corresponding signature in 'typeof A' +!!! error TS2322: Type 'N.A' is not assignable to type 'M.A'. +!!! error TS2322: Property 'name' is missing in type 'A'. var aClassInModule: M.A = new N.A(); ~~~~~~~~~~~~~~ !!! error TS2322: Type 'N.A' is not assignable to type 'M.A'. var aFunctionInModule: typeof M.F2 = F2; ~~~~~~~~~~~~~~~~~ !!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: number) => string'. -!!! error TS2322: Type 'boolean' is not assignable to type 'string'. +!!! error TS2322: Signature '(x: number): string' has no corresponding signature in '(x: number) => boolean' +!!! error TS2322: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt b/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt index a44c95377dc..448851640cd 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt @@ -1,7 +1,8 @@ tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(7,7): error TS2420: Class 'D' incorrectly implements interface 'C'. Types of property 'bar' are incompatible. Type '() => string' is not assignable to type '() => number'. - Type 'string' is not assignable to type 'number'. + Signature '(): number' has no corresponding signature in '() => string' + Type 'string' is not assignable to type 'number'. tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(12,5): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(16,5): error TS2322: Type 'string' is not assignable to type 'number'. @@ -18,7 +19,8 @@ tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(16,5): error TS2322: !!! error TS2420: Class 'D' incorrectly implements interface 'C'. !!! error TS2420: Types of property 'bar' are incompatible. !!! error TS2420: Type '() => string' is not assignable to type '() => number'. -!!! error TS2420: Type 'string' is not assignable to type 'number'. +!!! error TS2420: Signature '(): number' has no corresponding signature in '() => string' +!!! error TS2420: Type 'string' is not assignable to type 'number'. baz() { } } diff --git a/tests/baselines/reference/fixingTypeParametersRepeatedly2.errors.txt b/tests/baselines/reference/fixingTypeParametersRepeatedly2.errors.txt index e56b58a268d..ca0c6bb9dca 100644 --- a/tests/baselines/reference/fixingTypeParametersRepeatedly2.errors.txt +++ b/tests/baselines/reference/fixingTypeParametersRepeatedly2.errors.txt @@ -1,8 +1,10 @@ tests/cases/compiler/fixingTypeParametersRepeatedly2.ts(11,27): error TS2345: Argument of type '(d: Derived) => Base' is not assignable to parameter of type '(p: Derived) => Derived'. - Type 'Base' is not assignable to type 'Derived'. - Property 'toBase' is missing in type 'Base'. + Signature '(p: Derived): Derived' has no corresponding signature in '(d: Derived) => Base' + Type 'Base' is not assignable to type 'Derived'. + Property 'toBase' is missing in type 'Base'. tests/cases/compiler/fixingTypeParametersRepeatedly2.ts(17,27): error TS2345: Argument of type '(d: Derived) => Base' is not assignable to parameter of type '(p: Derived) => Derived'. - Type 'Base' is not assignable to type 'Derived'. + Signature '(p: Derived): Derived' has no corresponding signature in '(d: Derived) => Base' + Type 'Base' is not assignable to type 'Derived'. ==== tests/cases/compiler/fixingTypeParametersRepeatedly2.ts (2 errors) ==== @@ -19,8 +21,9 @@ tests/cases/compiler/fixingTypeParametersRepeatedly2.ts(17,27): error TS2345: Ar var result = foo(derived, d => d.toBase()); ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(d: Derived) => Base' is not assignable to parameter of type '(p: Derived) => Derived'. -!!! error TS2345: Type 'Base' is not assignable to type 'Derived'. -!!! error TS2345: Property 'toBase' is missing in type 'Base'. +!!! error TS2345: Signature '(p: Derived): Derived' has no corresponding signature in '(d: Derived) => Base' +!!! error TS2345: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2345: Property 'toBase' is missing in type 'Base'. // bar should type check just like foo. // The same error should be observed in both cases. @@ -29,4 +32,5 @@ tests/cases/compiler/fixingTypeParametersRepeatedly2.ts(17,27): error TS2345: Ar var result = bar(derived, d => d.toBase()); ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(d: Derived) => Base' is not assignable to parameter of type '(p: Derived) => Derived'. -!!! error TS2345: Type 'Base' is not assignable to type 'Derived'. \ No newline at end of file +!!! error TS2345: Signature '(p: Derived): Derived' has no corresponding signature in '(d: Derived) => Base' +!!! error TS2345: Type 'Base' is not assignable to type 'Derived'. \ No newline at end of file diff --git a/tests/baselines/reference/for-of30.errors.txt b/tests/baselines/reference/for-of30.errors.txt index 6434b5294d5..85c04fffdd0 100644 --- a/tests/baselines/reference/for-of30.errors.txt +++ b/tests/baselines/reference/for-of30.errors.txt @@ -1,9 +1,11 @@ tests/cases/conformance/es6/for-ofStatements/for-of30.ts(1,15): error TS2322: Type 'StringIterator' is not assignable to type 'Iterable'. Types of property '[Symbol.iterator]' are incompatible. Type '() => StringIterator' is not assignable to type '() => Iterator'. - Type 'StringIterator' is not assignable to type 'Iterator'. - Types of property 'return' are incompatible. - Type 'number' is not assignable to type '(value?: any) => IteratorResult'. + Signature '(): Iterator' has no corresponding signature in '() => StringIterator' + Type 'StringIterator' is not assignable to type 'Iterator'. + Types of property 'return' are incompatible. + Type 'number' is not assignable to type '(value?: any) => IteratorResult'. + Signature '(value?: any): IteratorResult' has no corresponding signature in 'Number' ==== tests/cases/conformance/es6/for-ofStatements/for-of30.ts (1 errors) ==== @@ -12,9 +14,11 @@ tests/cases/conformance/es6/for-ofStatements/for-of30.ts(1,15): error TS2322: Ty !!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterable'. !!! error TS2322: Types of property '[Symbol.iterator]' are incompatible. !!! error TS2322: Type '() => StringIterator' is not assignable to type '() => Iterator'. -!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterator'. -!!! error TS2322: Types of property 'return' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type '(value?: any) => IteratorResult'. +!!! error TS2322: Signature '(): Iterator' has no corresponding signature in '() => StringIterator' +!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterator'. +!!! error TS2322: Types of property 'return' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type '(value?: any) => IteratorResult'. +!!! error TS2322: Signature '(value?: any): IteratorResult' has no corresponding signature in 'Number' class StringIterator { next() { diff --git a/tests/baselines/reference/for-of31.errors.txt b/tests/baselines/reference/for-of31.errors.txt index 6d5f6e816be..111235d2f57 100644 --- a/tests/baselines/reference/for-of31.errors.txt +++ b/tests/baselines/reference/for-of31.errors.txt @@ -1,11 +1,13 @@ tests/cases/conformance/es6/for-ofStatements/for-of31.ts(1,15): error TS2322: Type 'StringIterator' is not assignable to type 'Iterable'. Types of property '[Symbol.iterator]' are incompatible. Type '() => StringIterator' is not assignable to type '() => Iterator'. - Type 'StringIterator' is not assignable to type 'Iterator'. - Types of property 'next' are incompatible. - Type '() => { value: string; }' is not assignable to type '(value?: any) => IteratorResult'. - Type '{ value: string; }' is not assignable to type 'IteratorResult'. - Property 'done' is missing in type '{ value: string; }'. + Signature '(): Iterator' has no corresponding signature in '() => StringIterator' + Type 'StringIterator' is not assignable to type 'Iterator'. + Types of property 'next' are incompatible. + Type '() => { value: string; }' is not assignable to type '(value?: any) => IteratorResult'. + Signature '(value?: any): IteratorResult' has no corresponding signature in '() => { value: string; }' + Type '{ value: string; }' is not assignable to type 'IteratorResult'. + Property 'done' is missing in type '{ value: string; }'. ==== tests/cases/conformance/es6/for-ofStatements/for-of31.ts (1 errors) ==== @@ -14,11 +16,13 @@ tests/cases/conformance/es6/for-ofStatements/for-of31.ts(1,15): error TS2322: Ty !!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterable'. !!! error TS2322: Types of property '[Symbol.iterator]' are incompatible. !!! error TS2322: Type '() => StringIterator' is not assignable to type '() => Iterator'. -!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterator'. -!!! error TS2322: Types of property 'next' are incompatible. -!!! error TS2322: Type '() => { value: string; }' is not assignable to type '(value?: any) => IteratorResult'. -!!! error TS2322: Type '{ value: string; }' is not assignable to type 'IteratorResult'. -!!! error TS2322: Property 'done' is missing in type '{ value: string; }'. +!!! error TS2322: Signature '(): Iterator' has no corresponding signature in '() => StringIterator' +!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterator'. +!!! error TS2322: Types of property 'next' are incompatible. +!!! error TS2322: Type '() => { value: string; }' is not assignable to type '(value?: any) => IteratorResult'. +!!! error TS2322: Signature '(value?: any): IteratorResult' has no corresponding signature in '() => { value: string; }' +!!! error TS2322: Type '{ value: string; }' is not assignable to type 'IteratorResult'. +!!! error TS2322: Property 'done' is missing in type '{ value: string; }'. class StringIterator { next() { diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt index 871368da9fe..baf2af9794b 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt +++ b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt @@ -3,15 +3,23 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(6,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(7,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(23,14): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(x: string) => string'. + Signature '(x: string): string' has no corresponding signature in 'Function' tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(24,15): error TS2345: Argument of type '(x: string[]) => string[]' is not assignable to parameter of type '(x: string) => string'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string[]' is not assignable to type 'string'. + Signature '(x: string): string' has no corresponding signature in '(x: string[]) => string[]' + Types of parameters 'x' and 'x' are incompatible. + Type 'string[]' is not assignable to type 'string'. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(25,15): error TS2345: Argument of type 'typeof C' is not assignable to parameter of type '(x: string) => string'. + Signature '(x: string): string' has no corresponding signature in 'typeof C' 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'. + Signature '(x: string): string' has no corresponding signature in 'new (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'. + Signature '(x: string): string' has no corresponding signature in '(x: U, y: V) => U' 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'. + Signature '(x: string): string' has no corresponding signature in 'typeof C2' 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'. + Signature '(x: string): string' has no corresponding signature in 'new (x: T) => T' tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(34,16): error TS2345: Argument of type 'F2' is not assignable to parameter of type '(x: string) => string'. + Signature '(x: string): string' has no corresponding signature in 'F2' tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(36,38): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(37,10): error TS2345: Argument of type 'T' is not assignable to parameter of type '(x: string) => string'. Type '() => void' is not assignable to type '(x: string) => string'. @@ -51,33 +59,41 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain var r = foo2(new Function()); ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type 'Function' is not assignable to parameter of type '(x: string) => string'. +!!! error TS2345: Signature '(x: string): string' has no corresponding signature in 'Function' var r2 = foo2((x: string[]) => x); ~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: string[]) => string[]' is not assignable to parameter of type '(x: string) => string'. -!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2345: Type 'string[]' is not assignable to type 'string'. +!!! error TS2345: Signature '(x: string): string' has no corresponding signature in '(x: string[]) => string[]' +!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2345: Type 'string[]' is not assignable to type 'string'. var r6 = foo2(C); ~ !!! error TS2345: Argument of type 'typeof C' is not assignable to parameter of type '(x: string) => string'. +!!! error TS2345: Signature '(x: string): string' has no corresponding signature in 'typeof C' var r7 = foo2(b); ~ !!! error TS2345: Argument of type 'new (x: string) => string' is not assignable to parameter of type '(x: string) => string'. +!!! error TS2345: Signature '(x: string): string' has no corresponding signature in 'new (x: string) => string' var r8 = foo2((x: U) => x); // no error expected 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: Signature '(x: string): string' has no corresponding signature in '(x: U, y: V) => U' var r13 = foo2(C2); ~~ !!! error TS2345: Argument of type 'typeof C2' is not assignable to parameter of type '(x: string) => string'. +!!! error TS2345: Signature '(x: string): string' has no corresponding signature in 'typeof C2' var r14 = foo2(b2); ~~ !!! error TS2345: Argument of type 'new (x: T) => T' is not assignable to parameter of type '(x: string) => string'. +!!! error TS2345: Signature '(x: string): string' has no corresponding signature in 'new (x: T) => T' interface F2 extends Function { foo: string; } var f2: F2; var r16 = foo2(f2); ~~ !!! error TS2345: Argument of type 'F2' is not assignable to parameter of type '(x: string) => string'. +!!! error TS2345: Signature '(x: string): string' has no corresponding signature in 'F2' function fff(x: T, y: U) { ~~~~~~~~~~~ diff --git a/tests/baselines/reference/functionExpressionContextualTyping2.errors.txt b/tests/baselines/reference/functionExpressionContextualTyping2.errors.txt index 6a3a7998f09..6ac40bcf2d9 100644 --- a/tests/baselines/reference/functionExpressionContextualTyping2.errors.txt +++ b/tests/baselines/reference/functionExpressionContextualTyping2.errors.txt @@ -1,6 +1,7 @@ tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping2.ts(11,1): error TS2322: Type '(foo: number, bar: string) => boolean' is not assignable to type '((n: number, s: string) => number) | ((n: number, s: string) => string)'. Type '(foo: number, bar: string) => boolean' is not assignable to type '(n: number, s: string) => string'. - Type 'boolean' is not assignable to type 'string'. + Signature '(n: number, s: string): string' has no corresponding signature in '(foo: number, bar: string) => boolean' + Type 'boolean' is not assignable to type 'string'. ==== tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping2.ts (1 errors) ==== @@ -18,4 +19,5 @@ tests/cases/conformance/expressions/contextualTyping/functionExpressionContextua ~~ !!! error TS2322: Type '(foo: number, bar: string) => boolean' is not assignable to type '((n: number, s: string) => number) | ((n: number, s: string) => string)'. !!! error TS2322: Type '(foo: number, bar: string) => boolean' is not assignable to type '(n: number, s: string) => string'. -!!! error TS2322: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Signature '(n: number, s: string): string' has no corresponding signature in '(foo: number, bar: string) => boolean' +!!! error TS2322: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt b/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt index 86c4728dda2..86f89e94b04 100644 --- a/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt +++ b/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/functionSignatureAssignmentCompat1.ts(10,5): error TS2322: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc'. - Types of parameters 'delimiter' and 'eventEmitter' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(eventEmitter: number, buffer: string): void' has no corresponding signature in '(delimiter?: string) => ParserFunc' + Types of parameters 'delimiter' and 'eventEmitter' are incompatible. + Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/functionSignatureAssignmentCompat1.ts (1 errors) ==== @@ -16,6 +17,7 @@ tests/cases/compiler/functionSignatureAssignmentCompat1.ts(10,5): error TS2322: var d: ParserFunc = parsers.readline; // not ok ~ !!! error TS2322: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc'. -!!! error TS2322: Types of parameters 'delimiter' and 'eventEmitter' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(eventEmitter: number, buffer: string): void' has no corresponding signature in '(delimiter?: string) => ParserFunc' +!!! error TS2322: Types of parameters 'delimiter' and 'eventEmitter' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var e: ParserFunc = parsers.readline(); // ok \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck25.errors.txt b/tests/baselines/reference/generatorTypeCheck25.errors.txt index 8d414c7c471..65aa94001b5 100644 --- a/tests/baselines/reference/generatorTypeCheck25.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck25.errors.txt @@ -1,14 +1,17 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck25.ts(4,5): error TS2322: Type '() => IterableIterator' is not assignable to type '() => Iterable'. - Type 'IterableIterator' is not assignable to type 'Iterable'. - Types of property '[Symbol.iterator]' are incompatible. - Type '() => IterableIterator' is not assignable to type '() => Iterator'. - Type 'IterableIterator' is not assignable to type 'Iterator'. - Types of property 'next' are incompatible. - Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. - Type 'IteratorResult' is not assignable to type 'IteratorResult'. - Type 'Bar | Baz' is not assignable to type 'Foo'. - Type 'Baz' is not assignable to type 'Foo'. - Property 'x' is missing in type 'Baz'. + Signature '(): Iterable' has no corresponding signature in '() => IterableIterator' + Type 'IterableIterator' is not assignable to type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '() => IterableIterator' is not assignable to type '() => Iterator'. + Signature '(): Iterator' has no corresponding signature in '() => IterableIterator' + Type 'IterableIterator' is not assignable to type 'Iterator'. + Types of property 'next' are incompatible. + Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. + Signature '(value?: any): IteratorResult' has no corresponding signature in '(value?: any) => IteratorResult' + Type 'IteratorResult' is not assignable to type 'IteratorResult'. + Type 'Bar | Baz' is not assignable to type 'Foo'. + Type 'Baz' is not assignable to type 'Foo'. + Property 'x' is missing in type 'Baz'. ==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck25.ts (1 errors) ==== @@ -18,16 +21,19 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck25.ts(4,5): error var g3: () => Iterable = function* () { ~~ !!! error TS2322: Type '() => IterableIterator' is not assignable to type '() => Iterable'. -!!! error TS2322: Type 'IterableIterator' is not assignable to type 'Iterable'. -!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible. -!!! error TS2322: Type '() => IterableIterator' is not assignable to type '() => Iterator'. -!!! error TS2322: Type 'IterableIterator' is not assignable to type 'Iterator'. -!!! error TS2322: Types of property 'next' are incompatible. -!!! error TS2322: Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. -!!! error TS2322: Type 'IteratorResult' is not assignable to type 'IteratorResult'. -!!! error TS2322: Type 'Bar | Baz' is not assignable to type 'Foo'. -!!! error TS2322: Type 'Baz' is not assignable to type 'Foo'. -!!! error TS2322: Property 'x' is missing in type 'Baz'. +!!! error TS2322: Signature '(): Iterable' has no corresponding signature in '() => IterableIterator' +!!! error TS2322: Type 'IterableIterator' is not assignable to type 'Iterable'. +!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible. +!!! error TS2322: Type '() => IterableIterator' is not assignable to type '() => Iterator'. +!!! error TS2322: Signature '(): Iterator' has no corresponding signature in '() => IterableIterator' +!!! error TS2322: Type 'IterableIterator' is not assignable to type 'Iterator'. +!!! error TS2322: Types of property 'next' are incompatible. +!!! error TS2322: Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. +!!! error TS2322: Signature '(value?: any): IteratorResult' has no corresponding signature in '(value?: any) => IteratorResult' +!!! error TS2322: Type 'IteratorResult' is not assignable to type 'IteratorResult'. +!!! error TS2322: Type 'Bar | Baz' is not assignable to type 'Foo'. +!!! error TS2322: Type 'Baz' is not assignable to type 'Foo'. +!!! error TS2322: Property 'x' is missing in type 'Baz'. yield; yield new Bar; yield new Baz; diff --git a/tests/baselines/reference/generatorTypeCheck31.errors.txt b/tests/baselines/reference/generatorTypeCheck31.errors.txt index a0336b464a4..9b77bb178c9 100644 --- a/tests/baselines/reference/generatorTypeCheck31.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck31.errors.txt @@ -1,4 +1,5 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck31.ts(2,11): error TS2322: Type 'IterableIterator<(x: any) => any>' is not assignable to type '() => Iterable<(x: string) => number>'. + Signature '(): Iterable<(x: string) => number>' has no corresponding signature in 'IterableIterator<(x: any) => any>' ==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck31.ts (1 errors) ==== @@ -10,4 +11,5 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck31.ts(2,11): erro } () ~~~~~~~~ !!! error TS2322: Type 'IterableIterator<(x: any) => any>' is not assignable to type '() => Iterable<(x: string) => number>'. +!!! error TS2322: Signature '(): Iterable<(x: string) => number>' has no corresponding signature in 'IterableIterator<(x: any) => any>' } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck8.errors.txt b/tests/baselines/reference/generatorTypeCheck8.errors.txt index cedfecda60b..abd1db46bd1 100644 --- a/tests/baselines/reference/generatorTypeCheck8.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck8.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck8.ts(2,17): error TS2322: Type 'IterableIterator' is not assignable to type 'BadGenerator'. Types of property 'next' are incompatible. Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. - Type 'IteratorResult' is not assignable to type 'IteratorResult'. - Type 'string' is not assignable to type 'number'. + Signature '(value?: any): IteratorResult' has no corresponding signature in '(value?: any) => IteratorResult' + Type 'IteratorResult' is not assignable to type 'IteratorResult'. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck8.ts (1 errors) ==== @@ -12,5 +13,6 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck8.ts(2,17): error !!! error TS2322: Type 'IterableIterator' is not assignable to type 'BadGenerator'. !!! error TS2322: Types of property 'next' are incompatible. !!! error TS2322: Type '(value?: any) => IteratorResult' is not assignable to type '(value?: any) => IteratorResult'. -!!! error TS2322: Type 'IteratorResult' is not assignable to type 'IteratorResult'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Signature '(value?: any): IteratorResult' has no corresponding signature in '(value?: any) => IteratorResult' +!!! error TS2322: Type 'IteratorResult' is not assignable to type 'IteratorResult'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt index f335319cafd..3b52ed1e597 100644 --- a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt +++ b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt @@ -3,8 +3,9 @@ tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(12,5): error TS23 Type 'A' is not assignable to type 'Comparable'. Types of property 'compareTo' are incompatible. Type '(other: number) => number' is not assignable to type '(other: string) => number'. - Types of parameters 'other' and 'other' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(other: string): number' has no corresponding signature in '(other: number) => number' + Types of parameters 'other' and 'other' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(13,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I'. Types of property 'x' are incompatible. Type 'A' is not assignable to type 'Comparable'. @@ -35,8 +36,9 @@ tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(17,5): error TS23 !!! error TS2322: Type 'A' is not assignable to type 'Comparable'. !!! error TS2322: Types of property 'compareTo' are incompatible. !!! error TS2322: Type '(other: number) => number' is not assignable to type '(other: string) => number'. -!!! error TS2322: Types of parameters 'other' and 'other' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature '(other: string): number' has no corresponding signature in '(other: number) => number' +!!! error TS2322: Types of parameters 'other' and 'other' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var a2: I = function (): { x: A } { ~~ !!! error TS2322: Type '{ x: A; }' is not assignable to type 'I'. diff --git a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt index 428ebecf5b0..a6c6de7ffa7 100644 --- a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt +++ b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt @@ -1,15 +1,19 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(24,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. + Signature '(x: number): Promise' has no corresponding signature in '{ (n: number): Promise; (s: string): Promise; }' + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(53,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. + Signature '(x: number): Promise' has no corresponding signature in '{ (n: number): Promise; (s: string): Promise; }' + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(69,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. + Signature '(x: number): Promise' has no corresponding signature in '{ (n: number): Promise; (s: string): Promise; }' + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(85,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'boolean'. + Signature '(x: number): Promise' has no corresponding signature in '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'boolean'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts (4 errors) ==== @@ -39,8 +43,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(x: number): Promise' has no corresponding signature in '{ (n: number): Promise; (s: string): Promise; }' +!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2345: Type 'number' is not assignable to type 'string'. } ////////////////////////////////////// @@ -72,8 +77,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(x: number): Promise' has no corresponding signature in '{ (n: number): Promise; (s: string): Promise; }' +!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2345: Type 'number' is not assignable to type 'string'. } ////////////////////////////////////// @@ -92,8 +98,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(x: number): Promise' has no corresponding signature in '{ (n: number): Promise; (s: string): Promise; }' +!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2345: Type 'number' is not assignable to type 'string'. } ////////////////////////////////////// @@ -112,7 +119,8 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2345: Type 'number' is not assignable to type 'boolean'. +!!! error TS2345: Signature '(x: number): Promise' has no corresponding signature in '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' +!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2345: Type 'number' is not assignable to type 'boolean'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt index a014ef85b6c..451a9e2900d 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: any) => string; }'. Types of property 'cb' are incompatible. Type 'new (x: T, y: T) => string' is not assignable to type 'new (t: any) => string'. + Signature 'new (t: any): string' has no corresponding signature in 'new (x: T, y: T) => 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'. + Signature 'new (t: string): string' has no corresponding signature in 'new (x: string, y: number) => 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: any) => 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: any) => string'. +!!! error TS2345: Signature 'new (t: any): string' has no corresponding signature in 'new (x: T, y: T) => 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: Signature 'new (t: string): string' has no corresponding signature in 'new (x: string, y: number) => string' function foo2(arg: { cb: new(t: T, t2: T) => U }) { return new arg.cb(null, null); diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt index c264058ad9f..4677d24164d 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt @@ -3,18 +3,21 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(15,21): error TS2345: Argument of type 'Date' is not assignable to parameter of type 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(16,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(25,23): error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'. - Types of parameters 'a' and 'x' are incompatible. - Type 'T' is not assignable to type 'Date'. - Type 'RegExp' is not assignable to type 'Date'. - Property 'toDateString' is missing in type 'RegExp'. + Signature '(x: Date): Date' has no corresponding signature in '(a: T) => T' + Types of parameters 'a' and 'x' are incompatible. + Type 'T' is not assignable to type 'Date'. + Type 'RegExp' is not assignable to type 'Date'. + Property 'toDateString' is missing in type 'RegExp'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(37,36): error TS2345: Argument of type '(x: E) => F' is not assignable to parameter of type '(x: E) => E'. - Type 'F' is not assignable to type 'E'. + Signature '(x: E): E' has no corresponding signature in '(x: E) => F' + Type 'F' is not assignable to type 'E'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(50,21): error TS2345: Argument of type 'Date' is not assignable to parameter of type 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(51,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(60,23): error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'. - Types of parameters 'a' and 'x' are incompatible. - Type 'T' is not assignable to type 'Date'. - Type 'RegExp' is not assignable to type 'Date'. + Signature '(x: Date): Date' has no corresponding signature in '(a: T) => T' + Types of parameters 'a' and 'x' are incompatible. + Type 'T' is not assignable to type 'Date'. + Type 'RegExp' is not assignable to type 'Date'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(67,51): error TS2304: Cannot find name 'U'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(67,57): error TS2304: Cannot find name 'U'. @@ -54,10 +57,11 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen var r7 = foo2((a: T) => a, (b: T) => b); // error ~~~~~~~~~~~ !!! error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'. -!!! error TS2345: Types of parameters 'a' and 'x' are incompatible. -!!! error TS2345: Type 'T' is not assignable to type 'Date'. -!!! error TS2345: Type 'RegExp' is not assignable to type 'Date'. -!!! error TS2345: Property 'toDateString' is missing in type 'RegExp'. +!!! error TS2345: Signature '(x: Date): Date' has no corresponding signature in '(a: T) => T' +!!! error TS2345: Types of parameters 'a' and 'x' are incompatible. +!!! error TS2345: Type 'T' is not assignable to type 'Date'. +!!! error TS2345: Type 'RegExp' is not assignable to type 'Date'. +!!! error TS2345: Property 'toDateString' is missing in type 'RegExp'. var r7b = foo2((a) => a, (b) => b); // valid, T is inferred to be Date } @@ -72,7 +76,8 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen var r7 = foo3(E.A, (x) => E.A, (x) => F.A); // error ~~~~~~~~~~ !!! error TS2345: Argument of type '(x: E) => F' is not assignable to parameter of type '(x: E) => E'. -!!! error TS2345: Type 'F' is not assignable to type 'E'. +!!! error TS2345: Signature '(x: E): E' has no corresponding signature in '(x: E) => F' +!!! error TS2345: Type 'F' is not assignable to type 'E'. } module TU { @@ -102,9 +107,10 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen var r7 = foo2((a: T) => a, (b: T) => b); ~~~~~~~~~~~ !!! error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'. -!!! error TS2345: Types of parameters 'a' and 'x' are incompatible. -!!! error TS2345: Type 'T' is not assignable to type 'Date'. -!!! error TS2345: Type 'RegExp' is not assignable to type 'Date'. +!!! error TS2345: Signature '(x: Date): Date' has no corresponding signature in '(a: T) => T' +!!! error TS2345: Types of parameters 'a' and 'x' are incompatible. +!!! error TS2345: Type 'T' is not assignable to type 'Date'. +!!! error TS2345: Type 'RegExp' is not assignable to type 'Date'. var r7b = foo2((a) => a, (b) => b); } diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.errors.txt b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.errors.txt index 87ae6b63855..cfee8e336b3 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.errors.txt +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.errors.txt @@ -1,8 +1,10 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts(32,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '(y: string) => string' is not a valid type argument because it is not a supertype of candidate '(a: string) => boolean'. - Type 'boolean' is not assignable to type 'string'. + Signature '(y: string): string' has no corresponding signature in '(a: string) => boolean' + Type 'boolean' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts(33,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '(n: Object) => number' is not a valid type argument because it is not a supertype of candidate 'number'. + Signature '(n: Object): number' has no corresponding signature in 'Number' ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts (2 errors) ==== @@ -41,8 +43,10 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen ~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate '(y: string) => string' is not a valid type argument because it is not a supertype of candidate '(a: string) => boolean'. -!!! error TS2453: Type 'boolean' is not assignable to type 'string'. +!!! error TS2453: Signature '(y: string): string' has no corresponding signature in '(a: string) => boolean' +!!! error TS2453: Type 'boolean' is not assignable to type 'string'. var r12 = foo2(x, (a1: (y: string) => boolean) => (n: Object) => 1, (a2: (z: string) => boolean) => 2); // error ~~~~ !!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate '(n: Object) => number' is not a valid type argument because it is not a supertype of candidate 'number'. \ No newline at end of file +!!! error TS2453: Type argument candidate '(n: Object) => number' is not a valid type argument because it is not a supertype of candidate 'number'. +!!! error TS2453: Signature '(n: Object): number' has no corresponding signature in 'Number' \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt index 80bcf12494a..230311a6642 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: any): string; new (x: any, y?: any): string; }'. + Signature 'new (x: any): string' has no corresponding signature in 'new (x: T, y: T) => 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: any): string; new (x: any, y?: any): string; }'. +!!! error TS2345: Signature 'new (x: any): string' has no corresponding signature in 'new (x: T, y: T) => 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 32fe6a09344..0e2481feee8 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: any): string; (x: any, y?: any): string; }'. + Signature '(x: any): string' has no corresponding signature in '(x: T, y: T) => 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: any): string; (x: any, y?: any): string; }'. +!!! error TS2345: Signature '(x: any): string' has no corresponding signature in '(x: T, y: T) => string' function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { return cb; diff --git a/tests/baselines/reference/genericCallWithTupleType.errors.txt b/tests/baselines/reference/genericCallWithTupleType.errors.txt index d03f8d5e68a..518a4714247 100644 --- a/tests/baselines/reference/genericCallWithTupleType.errors.txt +++ b/tests/baselines/reference/genericCallWithTupleType.errors.txt @@ -1,9 +1,10 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(12,1): error TS2322: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]'. Types of property 'pop' are incompatible. Type '() => string | number | boolean' is not assignable to type '() => string | number'. - Type 'string | number | boolean' is not assignable to type 'string | number'. - Type 'boolean' is not assignable to type 'string | number'. - Type 'boolean' is not assignable to type 'number'. + Signature '(): string | number' has no corresponding signature in '() => string | number | boolean' + Type 'string | number | boolean' is not assignable to type 'string | number'. + Type 'boolean' is not assignable to type 'string | number'. + Type 'boolean' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(14,1): error TS2322: Type '{ a: string; }' is not assignable to type 'string | number'. Type '{ a: string; }' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,1): error TS2322: Type '[number, string]' is not assignable to type '[string, number]'. @@ -33,9 +34,10 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTup !!! error TS2322: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]'. !!! error TS2322: Types of property 'pop' are incompatible. !!! error TS2322: Type '() => string | number | boolean' is not assignable to type '() => string | number'. -!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'string | number'. -!!! error TS2322: Type 'boolean' is not assignable to type 'string | number'. -!!! error TS2322: Type 'boolean' is not assignable to type 'number'. +!!! error TS2322: Signature '(): string | number' has no corresponding signature in '() => string | number | boolean' +!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'string | number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string | number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. var e3 = i1.tuple1[2]; // {} i1.tuple1[3] = { a: "string" }; ~~~~~~~~~~~~ diff --git a/tests/baselines/reference/genericCombinators2.errors.txt b/tests/baselines/reference/genericCombinators2.errors.txt index d590f1030c3..3dcc1b3c873 100644 --- a/tests/baselines/reference/genericCombinators2.errors.txt +++ b/tests/baselines/reference/genericCombinators2.errors.txt @@ -1,8 +1,10 @@ tests/cases/compiler/genericCombinators2.ts(15,43): error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. - Type 'string' is not assignable to type 'Date'. - Property 'toDateString' is missing in type 'String'. + Signature '(x: number, y: string): Date' has no corresponding signature in '(x: number, y: string) => string' + Type 'string' is not assignable to type 'Date'. + Property 'toDateString' is missing in type 'String'. tests/cases/compiler/genericCombinators2.ts(16,43): error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. - Type 'string' is not assignable to type 'Date'. + Signature '(x: number, y: string): Date' has no corresponding signature in '(x: number, y: string) => string' + Type 'string' is not assignable to type 'Date'. ==== tests/cases/compiler/genericCombinators2.ts (2 errors) ==== @@ -23,9 +25,11 @@ tests/cases/compiler/genericCombinators2.ts(16,43): error TS2345: Argument of ty var r5a = _.map(c2, (x, y) => { return x.toFixed() }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. -!!! error TS2345: Type 'string' is not assignable to type 'Date'. -!!! error TS2345: Property 'toDateString' is missing in type 'String'. +!!! error TS2345: Signature '(x: number, y: string): Date' has no corresponding signature in '(x: number, y: string) => string' +!!! error TS2345: Type 'string' is not assignable to type 'Date'. +!!! error TS2345: Property 'toDateString' is missing in type 'String'. var r5b = _.map(c2, rf1); ~~~ !!! error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. -!!! error TS2345: Type 'string' is not assignable to type 'Date'. \ No newline at end of file +!!! error TS2345: Signature '(x: number, y: string): Date' has no corresponding signature in '(x: number, y: string) => string' +!!! error TS2345: Type 'string' is not assignable to type 'Date'. \ No newline at end of file diff --git a/tests/baselines/reference/genericSpecializations3.errors.txt b/tests/baselines/reference/genericSpecializations3.errors.txt index ccaa839f9d0..abfdf7a6640 100644 --- a/tests/baselines/reference/genericSpecializations3.errors.txt +++ b/tests/baselines/reference/genericSpecializations3.errors.txt @@ -1,18 +1,21 @@ tests/cases/compiler/genericSpecializations3.ts(8,7): error TS2420: Class 'IntFooBad' incorrectly implements interface 'IFoo'. Types of property 'foo' are incompatible. Type '(x: string) => string' is not assignable to type '(x: number) => number'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): number' has no corresponding signature in '(x: string) => string' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/genericSpecializations3.ts(28,1): error TS2322: Type 'StringFoo2' is not assignable to type 'IntFoo'. Types of property 'foo' are incompatible. Type '(x: string) => string' is not assignable to type '(x: number) => number'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): number' has no corresponding signature in '(x: string) => string' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/genericSpecializations3.ts(29,1): error TS2322: Type 'IntFoo' is not assignable to type 'StringFoo2'. Types of property 'foo' are incompatible. Type '(x: number) => number' is not assignable to type '(x: string) => string'. - Types of parameters 'x' and 'x' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(x: string): string' has no corresponding signature in '(x: number) => number' + Types of parameters 'x' and 'x' are incompatible. + Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/genericSpecializations3.ts (3 errors) ==== @@ -28,8 +31,9 @@ tests/cases/compiler/genericSpecializations3.ts(29,1): error TS2322: Type 'IntFo !!! error TS2420: Class 'IntFooBad' incorrectly implements interface 'IFoo'. !!! error TS2420: Types of property 'foo' are incompatible. !!! error TS2420: Type '(x: string) => string' is not assignable to type '(x: number) => number'. -!!! error TS2420: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2420: Type 'string' is not assignable to type 'number'. +!!! error TS2420: Signature '(x: number): number' has no corresponding signature in '(x: string) => string' +!!! error TS2420: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2420: Type 'string' is not assignable to type 'number'. foo(x: string): string { return null; } } @@ -54,15 +58,17 @@ tests/cases/compiler/genericSpecializations3.ts(29,1): error TS2322: Type 'IntFo !!! error TS2322: Type 'StringFoo2' is not assignable to type 'IntFoo'. !!! error TS2322: Types of property 'foo' are incompatible. !!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => number'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number): number' has no corresponding signature in '(x: string) => string' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. stringFoo2 = intFoo; // error ~~~~~~~~~~ !!! error TS2322: Type 'IntFoo' is not assignable to type 'StringFoo2'. !!! error TS2322: Types of property 'foo' are incompatible. !!! error TS2322: Type '(x: number) => number' is not assignable to type '(x: string) => string'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature '(x: string): string' has no corresponding signature in '(x: number) => number' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. class StringFoo3 implements IFoo { // error diff --git a/tests/baselines/reference/genericTypeAssertions2.errors.txt b/tests/baselines/reference/genericTypeAssertions2.errors.txt index eda4c83646c..72bdf8a23a6 100644 --- a/tests/baselines/reference/genericTypeAssertions2.errors.txt +++ b/tests/baselines/reference/genericTypeAssertions2.errors.txt @@ -1,8 +1,9 @@ tests/cases/compiler/genericTypeAssertions2.ts(10,5): error TS2322: Type 'B' is not assignable to type 'A'. Types of property 'foo' are incompatible. Type '(x: string) => void' is not assignable to type '(x: number) => void'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x: string) => void' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/genericTypeAssertions2.ts(11,5): error TS2322: Type 'A' is not assignable to type 'B'. Property 'bar' is missing in type 'A'. tests/cases/compiler/genericTypeAssertions2.ts(13,21): error TS2352: Neither type 'undefined[]' nor type 'A' is assignable to the other. @@ -24,8 +25,9 @@ tests/cases/compiler/genericTypeAssertions2.ts(13,21): error TS2352: Neither typ !!! error TS2322: Type 'B' is not assignable to type 'A'. !!! error TS2322: Types of property 'foo' are incompatible. !!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => void' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var r3: B = >new B(); // error ~~ !!! error TS2322: Type 'A' is not assignable to type 'B'. diff --git a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt index 0fe15afcf33..d8bd78992a7 100644 --- a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt +++ b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt @@ -1,18 +1,20 @@ tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(4,7): error TS2420: Class 'X' incorrectly implements interface 'I'. Types of property 'f' are incompatible. Type '(a: T) => void' is not assignable to type '(a: { a: number; }) => void'. - Types of parameters 'a' and 'a' are incompatible. - Type 'T' is not assignable to type '{ a: number; }'. - Type '{ a: string; }' is not assignable to type '{ a: number; }'. - Types of property 'a' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(a: { a: number; }): void' has no corresponding signature in '(a: T) => void' + Types of parameters 'a' and 'a' are incompatible. + Type 'T' is not assignable to type '{ a: number; }'. + Type '{ a: string; }' is not assignable to type '{ a: number; }'. + Types of property 'a' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(8,5): error TS2322: Type 'X<{ a: string; }>' is not assignable to type 'I'. Types of property 'f' are incompatible. Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void'. - Types of parameters 'a' and 'a' are incompatible. - Type '{ a: string; }' is not assignable to type '{ a: number; }'. - Types of property 'a' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(a: { a: number; }): void' has no corresponding signature in '(a: { a: string; }) => void' + Types of parameters 'a' and 'a' are incompatible. + Type '{ a: string; }' is not assignable to type '{ a: number; }'. + Types of property 'a' are incompatible. + Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts (2 errors) ==== @@ -24,11 +26,12 @@ tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(8,5): error TS2322 !!! error TS2420: Class 'X' incorrectly implements interface 'I'. !!! error TS2420: Types of property 'f' are incompatible. !!! error TS2420: Type '(a: T) => void' is not assignable to type '(a: { a: number; }) => void'. -!!! error TS2420: Types of parameters 'a' and 'a' are incompatible. -!!! error TS2420: Type 'T' is not assignable to type '{ a: number; }'. -!!! error TS2420: Type '{ a: string; }' is not assignable to type '{ a: number; }'. -!!! error TS2420: Types of property 'a' are incompatible. -!!! error TS2420: Type 'string' is not assignable to type 'number'. +!!! error TS2420: Signature '(a: { a: number; }): void' has no corresponding signature in '(a: T) => void' +!!! error TS2420: Types of parameters 'a' and 'a' are incompatible. +!!! error TS2420: Type 'T' is not assignable to type '{ a: number; }'. +!!! error TS2420: Type '{ a: string; }' is not assignable to type '{ a: number; }'. +!!! error TS2420: Types of property 'a' are incompatible. +!!! error TS2420: Type 'string' is not assignable to type 'number'. f(a: T): void { } } var x = new X<{ a: string }>(); @@ -37,8 +40,9 @@ tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(8,5): error TS2322 !!! error TS2322: Type 'X<{ a: string; }>' is not assignable to type 'I'. !!! error TS2322: Types of property 'f' are incompatible. !!! error TS2322: Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void'. -!!! error TS2322: Types of parameters 'a' and 'a' are incompatible. -!!! error TS2322: Type '{ a: string; }' is not assignable to type '{ a: number; }'. -!!! error TS2322: Types of property 'a' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(a: { a: number; }): void' has no corresponding signature in '(a: { a: string; }) => void' +!!! error TS2322: Types of parameters 'a' and 'a' are incompatible. +!!! error TS2322: Type '{ a: string; }' is not assignable to type '{ a: number; }'. +!!! error TS2322: Types of property 'a' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/generics4.errors.txt b/tests/baselines/reference/generics4.errors.txt index 06bfa122901..93828628bd2 100644 --- a/tests/baselines/reference/generics4.errors.txt +++ b/tests/baselines/reference/generics4.errors.txt @@ -2,7 +2,8 @@ tests/cases/compiler/generics4.ts(7,1): error TS2322: Type 'C' is not assigna Type 'Y' is not assignable to type 'X'. Types of property 'f' are incompatible. Type '() => boolean' is not assignable to type '() => string'. - Type 'boolean' is not assignable to type 'string'. + Signature '(): string' has no corresponding signature in '() => boolean' + Type 'boolean' is not assignable to type 'string'. ==== tests/cases/compiler/generics4.ts (1 errors) ==== @@ -18,4 +19,5 @@ tests/cases/compiler/generics4.ts(7,1): error TS2322: Type 'C' is not assigna !!! error TS2322: Type 'Y' is not assignable to type 'X'. !!! error TS2322: Types of property 'f' are incompatible. !!! error TS2322: Type '() => boolean' is not assignable to type '() => string'. -!!! error TS2322: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Signature '(): string' has no corresponding signature in '() => boolean' +!!! error TS2322: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt b/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt index 7a128b87764..9699ab80862 100644 --- a/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt +++ b/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt @@ -1,12 +1,14 @@ tests/cases/compiler/implementGenericWithMismatchedTypes.ts(7,7): error TS2420: Class 'C' incorrectly implements interface 'IFoo'. Types of property 'foo' are incompatible. Type '(x: string) => number' is not assignable to type '(x: T) => T'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'T'. + Signature '(x: T): T' has no corresponding signature in '(x: string) => number' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'T'. tests/cases/compiler/implementGenericWithMismatchedTypes.ts(16,7): error TS2420: Class 'C2' incorrectly implements interface 'IFoo2'. Types of property 'foo' are incompatible. Type '(x: Tstring) => number' is not assignable to type '(x: T) => T'. - Type 'number' is not assignable to type 'T'. + Signature '(x: T): T' has no corresponding signature in '(x: Tstring) => number' + Type 'number' is not assignable to type 'T'. ==== tests/cases/compiler/implementGenericWithMismatchedTypes.ts (2 errors) ==== @@ -21,8 +23,9 @@ tests/cases/compiler/implementGenericWithMismatchedTypes.ts(16,7): error TS2420: !!! error TS2420: Class 'C' incorrectly implements interface 'IFoo'. !!! error TS2420: Types of property 'foo' are incompatible. !!! error TS2420: Type '(x: string) => number' is not assignable to type '(x: T) => T'. -!!! error TS2420: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2420: Type 'string' is not assignable to type 'T'. +!!! error TS2420: Signature '(x: T): T' has no corresponding signature in '(x: string) => number' +!!! error TS2420: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2420: Type 'string' is not assignable to type 'T'. foo(x: string): number { return null; } @@ -36,7 +39,8 @@ tests/cases/compiler/implementGenericWithMismatchedTypes.ts(16,7): error TS2420: !!! error TS2420: Class 'C2' incorrectly implements interface 'IFoo2'. !!! error TS2420: Types of property 'foo' are incompatible. !!! error TS2420: Type '(x: Tstring) => number' is not assignable to type '(x: T) => T'. -!!! error TS2420: Type 'number' is not assignable to type 'T'. +!!! error TS2420: Signature '(x: T): T' has no corresponding signature in '(x: Tstring) => number' +!!! error TS2420: Type 'number' is not assignable to type 'T'. foo(x: Tstring): number { return null; } diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index e612600a7f8..eddd01cc979 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -1,12 +1,14 @@ tests/cases/compiler/incompatibleTypes.ts(5,7): error TS2420: Class 'C1' incorrectly implements interface 'IFoo1'. Types of property 'p1' are incompatible. Type '() => string' is not assignable to type '() => number'. - Type 'string' is not assignable to type 'number'. + Signature '(): number' has no corresponding signature in '() => string' + Type 'string' is not assignable to type 'number'. tests/cases/compiler/incompatibleTypes.ts(15,7): error TS2420: Class 'C2' incorrectly implements interface 'IFoo2'. Types of property 'p1' are incompatible. Type '(n: number) => number' is not assignable to type '(s: string) => number'. - Types of parameters 'n' and 's' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(s: string): number' has no corresponding signature in '(n: number) => number' + Types of parameters 'n' and 's' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/incompatibleTypes.ts(25,7): error TS2420: Class 'C3' incorrectly implements interface 'IFoo3'. Types of property 'p1' are incompatible. Type 'number' is not assignable to type 'string'. @@ -17,13 +19,16 @@ tests/cases/compiler/incompatibleTypes.ts(33,7): error TS2420: Class 'C4' incorr tests/cases/compiler/incompatibleTypes.ts(42,5): error TS2345: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. Types of property 'p1' are incompatible. Type '() => string' is not assignable to type '(s: string) => number'. - Type 'string' is not assignable to type 'number'. + Signature '(s: string): number' has no corresponding signature in '() => string' + Type 'string' is not assignable to type 'number'. tests/cases/compiler/incompatibleTypes.ts(49,7): error TS2345: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. tests/cases/compiler/incompatibleTypes.ts(66,47): error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. tests/cases/compiler/incompatibleTypes.ts(72,5): error TS2322: Type 'number' is not assignable to type '() => string'. + Signature '(): string' has no corresponding signature in 'Number' tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. + Signature '(): any' has no corresponding signature in '(a: any) => number' ==== tests/cases/compiler/incompatibleTypes.ts (9 errors) ==== @@ -36,7 +41,8 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => !!! error TS2420: Class 'C1' incorrectly implements interface 'IFoo1'. !!! error TS2420: Types of property 'p1' are incompatible. !!! error TS2420: Type '() => string' is not assignable to type '() => number'. -!!! error TS2420: Type 'string' is not assignable to type 'number'. +!!! error TS2420: Signature '(): number' has no corresponding signature in '() => string' +!!! error TS2420: Type 'string' is not assignable to type 'number'. public p1() { return "s"; } @@ -51,8 +57,9 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => !!! error TS2420: Class 'C2' incorrectly implements interface 'IFoo2'. !!! error TS2420: Types of property 'p1' are incompatible. !!! error TS2420: Type '(n: number) => number' is not assignable to type '(s: string) => number'. -!!! error TS2420: Types of parameters 'n' and 's' are incompatible. -!!! error TS2420: Type 'number' is not assignable to type 'string'. +!!! error TS2420: Signature '(s: string): number' has no corresponding signature in '(n: number) => number' +!!! error TS2420: Types of parameters 'n' and 's' are incompatible. +!!! error TS2420: Type 'number' is not assignable to type 'string'. public p1(n:number) { return 0; } @@ -93,7 +100,8 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => !!! error TS2345: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. !!! error TS2345: Types of property 'p1' are incompatible. !!! error TS2345: Type '() => string' is not assignable to type '(s: string) => number'. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2345: Signature '(s: string): number' has no corresponding signature in '() => string' +!!! error TS2345: Type 'string' is not assignable to type 'number'. function of1(n: { a: { a: string; }; b: string; }): number; @@ -132,8 +140,10 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => var i1c1: { (): string; } = 5; ~~~~ !!! error TS2322: Type 'number' is not assignable to type '() => string'. +!!! error TS2322: Signature '(): string' has no corresponding signature in 'Number' var fp1: () =>any = a => 0; ~~~ !!! error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. +!!! error TS2322: Signature '(): any' has no corresponding signature in '(a: any) => number' \ No newline at end of file diff --git a/tests/baselines/reference/inheritance.errors.txt b/tests/baselines/reference/inheritance.errors.txt index c667e8b001e..eef06b4c961 100644 --- a/tests/baselines/reference/inheritance.errors.txt +++ b/tests/baselines/reference/inheritance.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/inheritance.ts(30,7): error TS2415: Class 'Baad' incorrectly extends base class 'Good'. Types of property 'g' are incompatible. Type '(n: number) => number' is not assignable to type '() => number'. + Signature '(): number' has no corresponding signature in '(n: number) => number' 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. @@ -39,6 +40,7 @@ tests/cases/compiler/inheritance.ts(31,12): error TS2425: Class 'Good' defines i !!! error TS2415: Class 'Baad' incorrectly extends base class 'Good'. !!! error TS2415: Types of property 'g' are incompatible. !!! error TS2415: Type '(n: number) => number' is not assignable to type '() => number'. +!!! error TS2415: Signature '(): number' has no corresponding signature in '(n: number) => number' public f(): number { return 0; } ~ !!! error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt index 6fde83e08b0..25dd3c2ef3b 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(7,7): error TS2415: Class 'b' incorrectly extends base class 'a'. Types of property 'x' are incompatible. Type 'string' is not assignable to type '() => string'. + Signature '(): string' has no corresponding signature in 'String' tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(8,9): error TS2423: Class 'a' defines instance member function 'x', but extended class 'b' defines it as instance member accessor. tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(11,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -18,6 +19,7 @@ tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(11,9): error T !!! error TS2415: Class 'b' incorrectly extends base class 'a'. !!! error TS2415: Types of property 'x' are incompatible. !!! error TS2415: Type 'string' is not assignable to type '() => string'. +!!! error TS2415: Signature '(): string' has no corresponding signature in 'String' get x() { ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt index 38b1ed61fac..646047f8633 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(7,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. Types of property 'x' are incompatible. Type 'string' is not assignable to type '() => string'. + Signature '(): string' has no corresponding signature in 'String' tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(11,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -17,6 +18,7 @@ tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(11,16): error !!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. !!! error TS2417: Types of property 'x' are incompatible. !!! error TS2417: Type 'string' is not assignable to type '() => string'. +!!! error TS2417: Signature '(): string' has no corresponding signature in 'String' static get x() { ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt index 22748fda783..5e983c0d806 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/inheritanceStaticPropertyOverridingMethod.ts(7,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. Types of property 'x' are incompatible. Type 'string' is not assignable to type '() => string'. + Signature '(): string' has no corresponding signature in 'String' ==== tests/cases/compiler/inheritanceStaticPropertyOverridingMethod.ts (1 errors) ==== @@ -15,5 +16,6 @@ tests/cases/compiler/inheritanceStaticPropertyOverridingMethod.ts(7,7): error TS !!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. !!! error TS2417: Types of property 'x' are incompatible. !!! error TS2417: Type 'string' is not assignable to type '() => string'. +!!! error TS2417: Signature '(): string' has no corresponding signature in 'String' static x: string; } \ No newline at end of file diff --git a/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt b/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt index 0b7e00d95ce..6c67e28e2f9 100644 --- a/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt +++ b/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt @@ -1,7 +1,8 @@ tests/cases/compiler/inheritedModuleMembersForClodule.ts(7,7): error TS2417: Class static side 'typeof D' incorrectly extends base class static side 'typeof C'. Types of property 'foo' are incompatible. Type '() => number' is not assignable to type '() => string'. - Type 'number' is not assignable to type 'string'. + Signature '(): string' has no corresponding signature in '() => number' + Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/inheritedModuleMembersForClodule.ts (1 errors) ==== @@ -16,7 +17,8 @@ tests/cases/compiler/inheritedModuleMembersForClodule.ts(7,7): error TS2417: Cla !!! error TS2417: Class static side 'typeof D' incorrectly extends base class static side 'typeof C'. !!! error TS2417: Types of property 'foo' are incompatible. !!! error TS2417: Type '() => number' is not assignable to type '() => string'. -!!! error TS2417: Type 'number' is not assignable to type 'string'. +!!! error TS2417: Signature '(): string' has no corresponding signature in '() => number' +!!! error TS2417: Type 'number' is not assignable to type 'string'. } module D { diff --git a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt index 080316f8daf..cca68d4ef96 100644 --- a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt +++ b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt @@ -1,5 +1,6 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/instanceMemberAssignsToClassPrototype.ts(7,9): error TS2322: Type '() => void' is not assignable to type '(x: number) => number'. - Type 'void' is not assignable to type 'number'. + Signature '(x: number): number' has no corresponding signature in '() => void' + Type 'void' is not assignable to type 'number'. ==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/instanceMemberAssignsToClassPrototype.ts (1 errors) ==== @@ -12,7 +13,8 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclara C.prototype.bar = () => { } // error ~~~~~~~~~~~~~~~ !!! error TS2322: Type '() => void' is not assignable to type '(x: number) => number'. -!!! error TS2322: Type 'void' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number): number' has no corresponding signature in '() => void' +!!! error TS2322: Type 'void' is not assignable to type 'number'. C.prototype.bar = (x) => x; // ok C.prototype.bar = (x: number) => 1; // ok return 1; diff --git a/tests/baselines/reference/intTypeCheck.errors.txt b/tests/baselines/reference/intTypeCheck.errors.txt index e48d1b1dc73..d9f3f021887 100644 --- a/tests/baselines/reference/intTypeCheck.errors.txt +++ b/tests/baselines/reference/intTypeCheck.errors.txt @@ -14,18 +14,27 @@ tests/cases/compiler/intTypeCheck.ts(106,20): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(106,21): error TS2304: Cannot find name 'i1'. tests/cases/compiler/intTypeCheck.ts(107,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(112,5): error TS2322: Type '{}' is not assignable to type 'i2'. + Signature '(): any' has no corresponding signature in '{}' tests/cases/compiler/intTypeCheck.ts(113,5): error TS2322: Type 'Object' is not assignable to type 'i2'. + Signature '(): any' has no corresponding signature in 'Object' tests/cases/compiler/intTypeCheck.ts(114,17): error TS2350: Only a void function can be called with the 'new' keyword. tests/cases/compiler/intTypeCheck.ts(115,5): error TS2322: Type 'Base' is not assignable to type 'i2'. + Signature '(): any' has no corresponding signature in 'Base' tests/cases/compiler/intTypeCheck.ts(120,5): error TS2322: Type 'boolean' is not assignable to type 'i2'. + Signature '(): any' has no corresponding signature in 'Boolean' tests/cases/compiler/intTypeCheck.ts(120,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(120,22): error TS2304: Cannot find name 'i2'. tests/cases/compiler/intTypeCheck.ts(121,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(126,5): error TS2322: Type '{}' is not assignable to type 'i3'. + Signature 'new (): any' has no corresponding signature in '{}' tests/cases/compiler/intTypeCheck.ts(127,5): error TS2322: Type 'Object' is not assignable to type 'i3'. + Signature 'new (): any' has no corresponding signature in 'Object' tests/cases/compiler/intTypeCheck.ts(129,5): error TS2322: Type 'Base' is not assignable to type 'i3'. + Signature 'new (): any' has no corresponding signature in 'Base' tests/cases/compiler/intTypeCheck.ts(131,5): error TS2322: Type '() => void' is not assignable to type 'i3'. + Signature 'new (): any' has no corresponding signature in '() => void' tests/cases/compiler/intTypeCheck.ts(134,5): error TS2322: Type 'boolean' is not assignable to type 'i3'. + Signature 'new (): any' has no corresponding signature in 'Boolean' tests/cases/compiler/intTypeCheck.ts(134,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(134,22): error TS2304: Cannot find name 'i3'. tests/cases/compiler/intTypeCheck.ts(135,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -50,20 +59,30 @@ tests/cases/compiler/intTypeCheck.ts(162,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(162,22): error TS2304: Cannot find name 'i5'. tests/cases/compiler/intTypeCheck.ts(163,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(168,5): error TS2322: Type '{}' is not assignable to type 'i6'. + Signature '(): any' has no corresponding signature in '{}' tests/cases/compiler/intTypeCheck.ts(169,5): error TS2322: Type 'Object' is not assignable to type 'i6'. + Signature '(): any' has no corresponding signature in 'Object' tests/cases/compiler/intTypeCheck.ts(170,17): error TS2350: Only a void function can be called with the 'new' keyword. tests/cases/compiler/intTypeCheck.ts(171,5): error TS2322: Type 'Base' is not assignable to type 'i6'. + Signature '(): any' has no corresponding signature in 'Base' tests/cases/compiler/intTypeCheck.ts(173,5): error TS2322: Type '() => void' is not assignable to type 'i6'. - Type 'void' is not assignable to type 'number'. + Signature '(): number' has no corresponding signature in '() => void' + Type 'void' is not assignable to type 'number'. tests/cases/compiler/intTypeCheck.ts(176,5): error TS2322: Type 'boolean' is not assignable to type 'i6'. + Signature '(): any' has no corresponding signature in 'Boolean' tests/cases/compiler/intTypeCheck.ts(176,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(176,22): error TS2304: Cannot find name 'i6'. tests/cases/compiler/intTypeCheck.ts(177,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(182,5): error TS2322: Type '{}' is not assignable to type 'i7'. + Signature 'new (): any' has no corresponding signature in '{}' tests/cases/compiler/intTypeCheck.ts(183,5): error TS2322: Type 'Object' is not assignable to type 'i7'. + Signature 'new (): any' has no corresponding signature in 'Object' tests/cases/compiler/intTypeCheck.ts(185,17): error TS2352: Neither type 'Base' nor type 'i7' is assignable to the other. + Signature 'new (): any' has no corresponding signature in 'Base' tests/cases/compiler/intTypeCheck.ts(187,5): error TS2322: Type '() => void' is not assignable to type 'i7'. + Signature 'new (): any' has no corresponding signature in '() => void' tests/cases/compiler/intTypeCheck.ts(190,5): error TS2322: Type 'boolean' is not assignable to type 'i7'. + Signature 'new (): any' has no corresponding signature in 'Boolean' tests/cases/compiler/intTypeCheck.ts(190,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(190,22): error TS2304: Cannot find name 'i7'. tests/cases/compiler/intTypeCheck.ts(191,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -216,15 +235,18 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit var obj12: i2 = {}; ~~~~~ !!! error TS2322: Type '{}' is not assignable to type 'i2'. +!!! error TS2322: Signature '(): any' has no corresponding signature in '{}' var obj13: i2 = new Object(); ~~~~~ !!! error TS2322: Type 'Object' is not assignable to type 'i2'. +!!! error TS2322: Signature '(): any' has no corresponding signature in 'Object' var obj14: i2 = new obj11; ~~~~~~~~~ !!! error TS2350: Only a void function can be called with the 'new' keyword. var obj15: i2 = new Base; ~~~~~ !!! error TS2322: Type 'Base' is not assignable to type 'i2'. +!!! error TS2322: Signature '(): any' has no corresponding signature in 'Base' var obj16: i2 = null; var obj17: i2 = function ():any { return 0; }; //var obj18: i2 = function foo() { }; @@ -232,6 +254,7 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit var obj20: i2 = new anyVar; ~~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i2'. +!!! error TS2322: Signature '(): any' has no corresponding signature in 'Boolean' ~ !!! error TS1109: Expression expected. ~~ @@ -246,22 +269,27 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit var obj23: i3 = {}; ~~~~~ !!! error TS2322: Type '{}' is not assignable to type 'i3'. +!!! error TS2322: Signature 'new (): any' has no corresponding signature in '{}' var obj24: i3 = new Object(); ~~~~~ !!! error TS2322: Type 'Object' is not assignable to type 'i3'. +!!! error TS2322: Signature 'new (): any' has no corresponding signature in 'Object' var obj25: i3 = new obj22; var obj26: i3 = new Base; ~~~~~ !!! error TS2322: Type 'Base' is not assignable to type 'i3'. +!!! error TS2322: Signature 'new (): any' has no corresponding signature in 'Base' var obj27: i3 = null; var obj28: i3 = function () { }; ~~~~~ !!! error TS2322: Type '() => void' is not assignable to type 'i3'. +!!! error TS2322: Signature 'new (): any' has no corresponding signature in '() => void' //var obj29: i3 = function foo() { }; var obj30: i3 = anyVar; var obj31: i3 = new anyVar; ~~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i3'. +!!! error TS2322: Signature 'new (): any' has no corresponding signature in 'Boolean' ~ !!! error TS1109: Expression expected. ~~ @@ -338,25 +366,30 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit var obj56: i6 = {}; ~~~~~ !!! error TS2322: Type '{}' is not assignable to type 'i6'. +!!! error TS2322: Signature '(): any' has no corresponding signature in '{}' var obj57: i6 = new Object(); ~~~~~ !!! error TS2322: Type 'Object' is not assignable to type 'i6'. +!!! error TS2322: Signature '(): any' has no corresponding signature in 'Object' var obj58: i6 = new obj55; ~~~~~~~~~ !!! error TS2350: Only a void function can be called with the 'new' keyword. var obj59: i6 = new Base; ~~~~~ !!! error TS2322: Type 'Base' is not assignable to type 'i6'. +!!! error TS2322: Signature '(): any' has no corresponding signature in 'Base' var obj60: i6 = null; var obj61: i6 = function () { }; ~~~~~ !!! error TS2322: Type '() => void' is not assignable to type 'i6'. -!!! error TS2322: Type 'void' is not assignable to type 'number'. +!!! error TS2322: Signature '(): number' has no corresponding signature in '() => void' +!!! error TS2322: Type 'void' is not assignable to type 'number'. //var obj62: i6 = function foo() { }; var obj63: i6 = anyVar; var obj64: i6 = new anyVar; ~~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i6'. +!!! error TS2322: Signature '(): any' has no corresponding signature in 'Boolean' ~ !!! error TS1109: Expression expected. ~~ @@ -371,22 +404,27 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit var obj67: i7 = {}; ~~~~~ !!! error TS2322: Type '{}' is not assignable to type 'i7'. +!!! error TS2322: Signature 'new (): any' has no corresponding signature in '{}' var obj68: i7 = new Object(); ~~~~~ !!! error TS2322: Type 'Object' is not assignable to type 'i7'. +!!! error TS2322: Signature 'new (): any' has no corresponding signature in 'Object' var obj69: i7 = new obj66; var obj70: i7 = new Base; ~~~~~~~~~~~~ !!! error TS2352: Neither type 'Base' nor type 'i7' is assignable to the other. +!!! error TS2352: Signature 'new (): any' has no corresponding signature in 'Base' var obj71: i7 = null; var obj72: i7 = function () { }; ~~~~~ !!! error TS2322: Type '() => void' is not assignable to type 'i7'. +!!! error TS2322: Signature 'new (): any' has no corresponding signature in '() => void' //var obj73: i7 = function foo() { }; var obj74: i7 = anyVar; var obj75: i7 = new anyVar; ~~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i7'. +!!! error TS2322: Signature 'new (): any' has no corresponding signature in 'Boolean' ~ !!! error TS1109: Expression expected. ~~ diff --git a/tests/baselines/reference/interfaceAssignmentCompat.errors.txt b/tests/baselines/reference/interfaceAssignmentCompat.errors.txt index 237358b42de..a1198d9fd37 100644 --- a/tests/baselines/reference/interfaceAssignmentCompat.errors.txt +++ b/tests/baselines/reference/interfaceAssignmentCompat.errors.txt @@ -1,7 +1,8 @@ tests/cases/compiler/interfaceAssignmentCompat.ts(32,18): error TS2345: Argument of type '(a: IFrenchEye, b: IFrenchEye) => number' is not assignable to parameter of type '(a: IEye, b: IEye) => number'. - Types of parameters 'a' and 'a' are incompatible. - Type 'IFrenchEye' is not assignable to type 'IEye'. - Property 'color' is missing in type 'IFrenchEye'. + Signature '(a: IEye, b: IEye): number' has no corresponding signature in '(a: IFrenchEye, b: IFrenchEye) => number' + Types of parameters 'a' and 'a' are incompatible. + Type 'IFrenchEye' is not assignable to type 'IEye'. + Property 'color' is missing in type 'IFrenchEye'. tests/cases/compiler/interfaceAssignmentCompat.ts(37,29): error TS2339: Property '_map' does not exist on type 'typeof Color'. tests/cases/compiler/interfaceAssignmentCompat.ts(42,13): error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye'. Property 'coleur' is missing in type 'IEye'. @@ -44,9 +45,10 @@ tests/cases/compiler/interfaceAssignmentCompat.ts(44,9): error TS2322: Type 'IEy x=x.sort(CompareYeux); // parameter mismatch ~~~~~~~~~~~ !!! error TS2345: Argument of type '(a: IFrenchEye, b: IFrenchEye) => number' is not assignable to parameter of type '(a: IEye, b: IEye) => number'. -!!! error TS2345: Types of parameters 'a' and 'a' are incompatible. -!!! error TS2345: Type 'IFrenchEye' is not assignable to type 'IEye'. -!!! error TS2345: Property 'color' is missing in type 'IFrenchEye'. +!!! error TS2345: Signature '(a: IEye, b: IEye): number' has no corresponding signature in '(a: IFrenchEye, b: IFrenchEye) => number' +!!! error TS2345: Types of parameters 'a' and 'a' are incompatible. +!!! error TS2345: Type 'IFrenchEye' is not assignable to type 'IEye'. +!!! error TS2345: Property 'color' is missing in type 'IFrenchEye'. // type of z inferred from specialized array type var z=x.sort(CompareEyes); // ok diff --git a/tests/baselines/reference/interfaceImplementation1.errors.txt b/tests/baselines/reference/interfaceImplementation1.errors.txt index 45b011c6929..826e5650c83 100644 --- a/tests/baselines/reference/interfaceImplementation1.errors.txt +++ b/tests/baselines/reference/interfaceImplementation1.errors.txt @@ -3,6 +3,7 @@ tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2420: Class 'C1' tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2420: Class 'C1' incorrectly implements interface 'I2'. Property 'iFn' is private in type 'C1' but not in type 'I2'. tests/cases/compiler/interfaceImplementation1.ts(34,5): error TS2322: Type '() => C2' is not assignable to type 'I4'. + Signature 'new (): I3' has no corresponding signature in '() => C2' ==== tests/cases/compiler/interfaceImplementation1.ts (3 errors) ==== @@ -48,6 +49,7 @@ tests/cases/compiler/interfaceImplementation1.ts(34,5): error TS2322: Type '() = var a:I4 = function(){ ~ !!! error TS2322: Type '() => C2' is not assignable to type 'I4'. +!!! error TS2322: Signature 'new (): I3' has no corresponding signature in '() => C2' return new C2(); } new a(); diff --git a/tests/baselines/reference/interfaceImplementation7.errors.txt b/tests/baselines/reference/interfaceImplementation7.errors.txt index b297015dfbe..531398ba532 100644 --- a/tests/baselines/reference/interfaceImplementation7.errors.txt +++ b/tests/baselines/reference/interfaceImplementation7.errors.txt @@ -3,8 +3,9 @@ tests/cases/compiler/interfaceImplementation7.ts(4,11): error TS2320: Interface tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2420: Class 'C1' incorrectly implements interface 'i4'. Types of property 'name' are incompatible. Type '() => string' is not assignable to type '() => { s: string; n: number; }'. - Type 'string' is not assignable to type '{ s: string; n: number; }'. - Property 's' is missing in type 'String'. + Signature '(): { s: string; n: number; }' has no corresponding signature in '() => string' + Type 'string' is not assignable to type '{ s: string; n: number; }'. + Property 's' is missing in type 'String'. ==== tests/cases/compiler/interfaceImplementation7.ts (2 errors) ==== @@ -22,8 +23,9 @@ tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2420: Class 'C1' !!! error TS2420: Class 'C1' incorrectly implements interface 'i4'. !!! error TS2420: Types of property 'name' are incompatible. !!! error TS2420: Type '() => string' is not assignable to type '() => { s: string; n: number; }'. -!!! error TS2420: Type 'string' is not assignable to type '{ s: string; n: number; }'. -!!! error TS2420: Property 's' is missing in type 'String'. +!!! error TS2420: Signature '(): { s: string; n: number; }' has no corresponding signature in '() => string' +!!! error TS2420: Type 'string' is not assignable to type '{ s: string; n: number; }'. +!!! error TS2420: Property 's' is missing in type 'String'. public name(): string { return ""; } } \ No newline at end of file diff --git a/tests/baselines/reference/invalidBooleanAssignments.errors.txt b/tests/baselines/reference/invalidBooleanAssignments.errors.txt index 84ced226113..ddedc16f28d 100644 --- a/tests/baselines/reference/invalidBooleanAssignments.errors.txt +++ b/tests/baselines/reference/invalidBooleanAssignments.errors.txt @@ -7,6 +7,7 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(12 tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(15,5): error TS2322: Type 'boolean' is not assignable to type 'I'. Property 'bar' is missing in type 'Boolean'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(17,5): error TS2322: Type 'boolean' is not assignable to type '() => string'. + Signature '(): string' has no corresponding signature in 'Boolean' tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(21,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(24,5): error TS2322: Type 'boolean' is not assignable to type 'T'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26,1): error TS2364: Invalid left-hand side of assignment expression. @@ -46,6 +47,7 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26 var h: { (): string } = x; ~ !!! error TS2322: Type 'boolean' is not assignable to type '() => string'. +!!! error TS2322: Signature '(): string' has no corresponding signature in 'Boolean' var h2: { toString(): string } = x; // no error module M { export var a = 1; } diff --git a/tests/baselines/reference/iteratorSpreadInArray9.errors.txt b/tests/baselines/reference/iteratorSpreadInArray9.errors.txt index 90b8bdbeb46..cc32db8a373 100644 --- a/tests/baselines/reference/iteratorSpreadInArray9.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInArray9.errors.txt @@ -1,11 +1,13 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts(1,17): error TS2322: Type 'SymbolIterator' is not assignable to type 'Iterable'. Types of property '[Symbol.iterator]' are incompatible. Type '() => SymbolIterator' is not assignable to type '() => Iterator'. - Type 'SymbolIterator' is not assignable to type 'Iterator'. - Types of property 'next' are incompatible. - Type '() => { value: symbol; }' is not assignable to type '(value?: any) => IteratorResult'. - Type '{ value: symbol; }' is not assignable to type 'IteratorResult'. - Property 'done' is missing in type '{ value: symbol; }'. + Signature '(): Iterator' has no corresponding signature in '() => SymbolIterator' + Type 'SymbolIterator' is not assignable to type 'Iterator'. + Types of property 'next' are incompatible. + Type '() => { value: symbol; }' is not assignable to type '(value?: any) => IteratorResult'. + Signature '(value?: any): IteratorResult' has no corresponding signature in '() => { value: symbol; }' + Type '{ value: symbol; }' is not assignable to type 'IteratorResult'. + Property 'done' is missing in type '{ value: symbol; }'. ==== tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts (1 errors) ==== @@ -14,11 +16,13 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts(1,17): error TS2322 !!! error TS2322: Type 'SymbolIterator' is not assignable to type 'Iterable'. !!! error TS2322: Types of property '[Symbol.iterator]' are incompatible. !!! error TS2322: Type '() => SymbolIterator' is not assignable to type '() => Iterator'. -!!! error TS2322: Type 'SymbolIterator' is not assignable to type 'Iterator'. -!!! error TS2322: Types of property 'next' are incompatible. -!!! error TS2322: Type '() => { value: symbol; }' is not assignable to type '(value?: any) => IteratorResult'. -!!! error TS2322: Type '{ value: symbol; }' is not assignable to type 'IteratorResult'. -!!! error TS2322: Property 'done' is missing in type '{ value: symbol; }'. +!!! error TS2322: Signature '(): Iterator' has no corresponding signature in '() => SymbolIterator' +!!! error TS2322: Type 'SymbolIterator' is not assignable to type 'Iterator'. +!!! error TS2322: Types of property 'next' are incompatible. +!!! error TS2322: Type '() => { value: symbol; }' is not assignable to type '(value?: any) => IteratorResult'. +!!! error TS2322: Signature '(value?: any): IteratorResult' has no corresponding signature in '() => { value: symbol; }' +!!! error TS2322: Type '{ value: symbol; }' is not assignable to type 'IteratorResult'. +!!! error TS2322: Property 'done' is missing in type '{ value: symbol; }'. class SymbolIterator { next() { diff --git a/tests/baselines/reference/lambdaArgCrash.errors.txt b/tests/baselines/reference/lambdaArgCrash.errors.txt index bf1c4dd01bd..658534334f5 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: any) => void' is not assignable to parameter of type '() => any'. + Signature '(): any' has no corresponding signature in '(items: any) => void' ==== 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: any) => void' is not assignable to parameter of type '() => any'. +!!! error TS2345: Signature '(): any' has no corresponding signature in '(items: any) => void' } diff --git a/tests/baselines/reference/multipleInheritance.errors.txt b/tests/baselines/reference/multipleInheritance.errors.txt index 19ef1e755e3..def2fcbd813 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(34,7): error TS2415: Class 'Baad' incorrectly extends base class 'Good'. Types of property 'g' are incompatible. Type '(n: number) => number' is not assignable to type '() => number'. + Signature '(): number' has no corresponding signature in '(n: number) => number' 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. @@ -49,6 +50,7 @@ tests/cases/compiler/multipleInheritance.ts(35,12): error TS2425: Class 'Good' d !!! error TS2415: Class 'Baad' incorrectly extends base class 'Good'. !!! error TS2415: Types of property 'g' are incompatible. !!! error TS2415: Type '(n: number) => number' is not assignable to type '() => number'. +!!! error TS2415: Signature '(): number' has no corresponding signature in '(n: number) => number' public f(): number { return 0; } ~ !!! error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt index c4ee3ea17b2..6bc3ec86f72 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt @@ -1,15 +1,18 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(7,1): error TS2322: Type 'I' is not assignable to type 'Object'. Types of property 'toString' are incompatible. Type '() => void' is not assignable to type '() => string'. - Type 'void' is not assignable to type 'string'. + Signature '(): string' has no corresponding signature in '() => void' + Type 'void' is not assignable to type 'string'. tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(14,1): error TS2322: Type 'C' is not assignable to type 'Object'. Types of property 'toString' are incompatible. Type '() => void' is not assignable to type '() => string'. - Type 'void' is not assignable to type 'string'. + Signature '(): string' has no corresponding signature in '() => void' + Type 'void' is not assignable to type 'string'. tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(20,1): error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'. Types of property 'toString' are incompatible. Type '() => void' is not assignable to type '() => string'. - Type 'void' is not assignable to type 'string'. + Signature '(): string' has no corresponding signature in '() => void' + Type 'void' is not assignable to type 'string'. ==== tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts (3 errors) ==== @@ -24,7 +27,8 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC !!! error TS2322: Type 'I' is not assignable to type 'Object'. !!! error TS2322: Types of property 'toString' are incompatible. !!! error TS2322: Type '() => void' is not assignable to type '() => string'. -!!! error TS2322: Type 'void' is not assignable to type 'string'. +!!! error TS2322: Signature '(): string' has no corresponding signature in '() => void' +!!! error TS2322: Type 'void' is not assignable to type 'string'. i = o; // ok class C { @@ -36,7 +40,8 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC !!! error TS2322: Type 'C' is not assignable to type 'Object'. !!! error TS2322: Types of property 'toString' are incompatible. !!! error TS2322: Type '() => void' is not assignable to type '() => string'. -!!! error TS2322: Type 'void' is not assignable to type 'string'. +!!! error TS2322: Signature '(): string' has no corresponding signature in '() => void' +!!! error TS2322: Type 'void' is not assignable to type 'string'. c = o; // ok var a = { @@ -47,5 +52,6 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC !!! error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'. !!! error TS2322: Types of property 'toString' are incompatible. !!! error TS2322: Type '() => void' is not assignable to type '() => string'. -!!! error TS2322: Type 'void' is not assignable to type 'string'. +!!! error TS2322: Signature '(): string' has no corresponding signature in '() => void' +!!! error TS2322: Type 'void' is not assignable to type 'string'. a = o; // ok \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt index a88796b390e..174707a8d22 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt @@ -1,23 +1,28 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(7,1): error TS2322: Type 'I' is not assignable to type 'Object'. Types of property 'toString' are incompatible. Type '() => number' is not assignable to type '() => string'. - Type 'number' is not assignable to type 'string'. + Signature '(): string' has no corresponding signature in '() => number' + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'. Types of property 'toString' are incompatible. Type '() => string' is not assignable to type '() => number'. - Type 'string' is not assignable to type 'number'. + Signature '(): number' has no corresponding signature in '() => string' + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(14,1): error TS2322: Type 'C' is not assignable to type 'Object'. Types of property 'toString' are incompatible. Type '() => number' is not assignable to type '() => string'. - Type 'number' is not assignable to type 'string'. + Signature '(): string' has no corresponding signature in '() => number' + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(15,1): error TS2322: Type 'Object' is not assignable to type 'C'. Types of property 'toString' are incompatible. Type '() => string' is not assignable to type '() => number'. - Type 'string' is not assignable to type 'number'. + Signature '(): number' has no corresponding signature in '() => string' + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(20,1): error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'. Types of property 'toString' are incompatible. Type '() => void' is not assignable to type '() => string'. - Type 'void' is not assignable to type 'string'. + Signature '(): string' has no corresponding signature in '() => void' + Type 'void' is not assignable to type 'string'. ==== tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts (5 errors) ==== @@ -32,13 +37,15 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC !!! error TS2322: Type 'I' is not assignable to type 'Object'. !!! error TS2322: Types of property 'toString' are incompatible. !!! error TS2322: Type '() => number' is not assignable to type '() => string'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature '(): string' has no corresponding signature in '() => number' +!!! error TS2322: Type 'number' is not assignable to type 'string'. i = o; // error ~ !!! error TS2322: Type 'Object' is not assignable to type 'I'. !!! error TS2322: Types of property 'toString' are incompatible. !!! error TS2322: Type '() => string' is not assignable to type '() => number'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(): number' has no corresponding signature in '() => string' +!!! error TS2322: Type 'string' is not assignable to type 'number'. class C { toString(): number { return 1; } @@ -49,13 +56,15 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC !!! error TS2322: Type 'C' is not assignable to type 'Object'. !!! error TS2322: Types of property 'toString' are incompatible. !!! error TS2322: Type '() => number' is not assignable to type '() => string'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature '(): string' has no corresponding signature in '() => number' +!!! error TS2322: Type 'number' is not assignable to type 'string'. c = o; // error ~ !!! error TS2322: Type 'Object' is not assignable to type 'C'. !!! error TS2322: Types of property 'toString' are incompatible. !!! error TS2322: Type '() => string' is not assignable to type '() => number'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(): number' has no corresponding signature in '() => string' +!!! error TS2322: Type 'string' is not assignable to type 'number'. var a = { toString: () => { } @@ -65,5 +74,6 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC !!! error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'. !!! error TS2322: Types of property 'toString' are incompatible. !!! error TS2322: Type '() => void' is not assignable to type '() => string'. -!!! error TS2322: Type 'void' is not assignable to type 'string'. +!!! error TS2322: Signature '(): string' has no corresponding signature in '() => void' +!!! error TS2322: Type 'void' is not assignable to type 'string'. a = o; // ok \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt index 30b40f431a7..6767d053498 100644 --- a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt +++ b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt @@ -1,5 +1,7 @@ tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'. + Signature '(): void' has no corresponding signature in 'Object' tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts(14,1): error TS2322: Type 'Object' is not assignable to type '() => void'. + Signature '(): void' has no corresponding signature in 'Object' ==== tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts (2 errors) ==== @@ -13,6 +15,7 @@ tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOf i = f; ~ !!! error TS2322: Type 'Object' is not assignable to type 'I'. +!!! error TS2322: Signature '(): void' has no corresponding signature in 'Object' var a: { (): void @@ -20,4 +23,5 @@ tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOf f = a; a = f; ~ -!!! error TS2322: Type 'Object' is not assignable to type '() => void'. \ No newline at end of file +!!! error TS2322: Type 'Object' is not assignable to type '() => void'. +!!! error TS2322: Signature '(): void' has no corresponding signature in 'Object' \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt index 0faba936715..92fdf725efe 100644 --- a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt +++ b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt @@ -1,5 +1,7 @@ tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'. + Signature 'new (): any' has no corresponding signature in 'Object' tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts(14,1): error TS2322: Type 'Object' is not assignable to type 'new () => any'. + Signature 'new (): any' has no corresponding signature in 'Object' ==== tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts (2 errors) ==== @@ -13,6 +15,7 @@ tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMemb i = f; ~ !!! error TS2322: Type 'Object' is not assignable to type 'I'. +!!! error TS2322: Signature 'new (): any' has no corresponding signature in 'Object' var a: { new(): any @@ -20,4 +23,5 @@ tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMemb f = a; a = f; ~ -!!! error TS2322: Type 'Object' is not assignable to type 'new () => any'. \ No newline at end of file +!!! error TS2322: Type 'Object' is not assignable to type 'new () => any'. +!!! error TS2322: Signature 'new (): any' has no corresponding signature in 'Object' \ No newline at end of file diff --git a/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt b/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt index 52fb45e40d2..43d7b633052 100644 --- a/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt +++ b/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt @@ -1,8 +1,10 @@ tests/cases/compiler/optionalFunctionArgAssignability.ts(7,1): error TS2322: Type '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' is not assignable to type '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise'. - Types of parameters 'onFulFill' and 'onFulfill' are incompatible. - Type '(value: number) => any' is not assignable to type '(value: string) => any'. - Types of parameters 'value' and 'value' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U): Promise' has no corresponding signature in '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' + Types of parameters 'onFulFill' and 'onFulfill' are incompatible. + Type '(value: number) => any' is not assignable to type '(value: string) => any'. + Signature '(value: string): any' has no corresponding signature in '(value: number) => any' + Types of parameters 'value' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/optionalFunctionArgAssignability.ts (1 errors) ==== @@ -15,8 +17,10 @@ tests/cases/compiler/optionalFunctionArgAssignability.ts(7,1): error TS2322: Typ a = b; // error because number is not assignable to string ~ !!! error TS2322: Type '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' is not assignable to type '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise'. -!!! error TS2322: Types of parameters 'onFulFill' and 'onFulfill' are incompatible. -!!! error TS2322: Type '(value: number) => any' is not assignable to type '(value: string) => any'. -!!! error TS2322: Types of parameters 'value' and 'value' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Signature '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U): Promise' has no corresponding signature in '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' +!!! error TS2322: Types of parameters 'onFulFill' and 'onFulfill' are incompatible. +!!! error TS2322: Type '(value: number) => any' is not assignable to type '(value: string) => any'. +!!! error TS2322: Signature '(value: string): any' has no corresponding signature in '(value: number) => any' +!!! error TS2322: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt b/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt index de02509d124..4d8f23385fd 100644 --- a/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt +++ b/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/optionalParamAssignmentCompat.ts(10,5): error TS2322: Type '(p1?: string) => I1' is not assignable to type 'I1'. - Types of parameters 'p1' and 'p1' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(p1: number, p2: string): void' has no corresponding signature in '(p1?: string) => I1' + Types of parameters 'p1' and 'p1' are incompatible. + Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/optionalParamAssignmentCompat.ts (1 errors) ==== @@ -16,6 +17,7 @@ tests/cases/compiler/optionalParamAssignmentCompat.ts(10,5): error TS2322: Type var d: I1 = i2.m1; // should error ~ !!! error TS2322: Type '(p1?: string) => I1' is not assignable to type 'I1'. -!!! error TS2322: Types of parameters 'p1' and 'p1' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(p1: number, p2: string): void' has no corresponding signature in '(p1?: string) => I1' +!!! error TS2322: Types of parameters 'p1' and 'p1' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalParamTypeComparison.errors.txt b/tests/baselines/reference/optionalParamTypeComparison.errors.txt index 98a07570c65..8e3237a80b1 100644 --- a/tests/baselines/reference/optionalParamTypeComparison.errors.txt +++ b/tests/baselines/reference/optionalParamTypeComparison.errors.txt @@ -1,9 +1,11 @@ tests/cases/compiler/optionalParamTypeComparison.ts(4,1): error TS2322: Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void'. - Types of parameters 'b' and 'n' are incompatible. - Type 'boolean' is not assignable to type 'number'. + Signature '(s: string, n?: number): void' has no corresponding signature in '(s: string, b?: boolean) => void' + Types of parameters 'b' and 'n' are incompatible. + Type 'boolean' is not assignable to type 'number'. tests/cases/compiler/optionalParamTypeComparison.ts(5,1): error TS2322: Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void'. - Types of parameters 'n' and 'b' are incompatible. - Type 'number' is not assignable to type 'boolean'. + Signature '(s: string, b?: boolean): void' has no corresponding signature in '(s: string, n?: number) => void' + Types of parameters 'n' and 'b' are incompatible. + Type 'number' is not assignable to type 'boolean'. ==== tests/cases/compiler/optionalParamTypeComparison.ts (2 errors) ==== @@ -13,10 +15,12 @@ tests/cases/compiler/optionalParamTypeComparison.ts(5,1): error TS2322: Type '(s f = g; ~ !!! error TS2322: Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void'. -!!! error TS2322: Types of parameters 'b' and 'n' are incompatible. -!!! error TS2322: Type 'boolean' is not assignable to type 'number'. +!!! error TS2322: Signature '(s: string, n?: number): void' has no corresponding signature in '(s: string, b?: boolean) => void' +!!! error TS2322: Types of parameters 'b' and 'n' are incompatible. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. g = f; ~ !!! error TS2322: Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void'. -!!! error TS2322: Types of parameters 'n' and 'b' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2322: Signature '(s: string, b?: boolean): void' has no corresponding signature in '(s: string, n?: number) => void' +!!! error TS2322: Types of parameters 'n' and 'b' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstInheritance2.errors.txt b/tests/baselines/reference/overloadOnConstInheritance2.errors.txt index 4870106f474..3b8d8c80e58 100644 --- a/tests/baselines/reference/overloadOnConstInheritance2.errors.txt +++ b/tests/baselines/reference/overloadOnConstInheritance2.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/overloadOnConstInheritance2.ts(5,11): error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'. Types of property 'addEventListener' are incompatible. Type '(x: "bar") => string' is not assignable to type '{ (x: string): any; (x: "foo"): string; }'. + Signature '(x: string): any' has no corresponding signature in '(x: "bar") => string' tests/cases/compiler/overloadOnConstInheritance2.ts(6,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. @@ -14,6 +15,7 @@ tests/cases/compiler/overloadOnConstInheritance2.ts(6,5): error TS2382: Speciali !!! error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'addEventListener' are incompatible. !!! error TS2430: Type '(x: "bar") => string' is not assignable to type '{ (x: string): any; (x: "foo"): string; }'. +!!! error TS2430: Signature '(x: string): any' has no corresponding signature in '(x: "bar") => string' addEventListener(x: 'bar'): string; // shouldn't need to redeclare the string overload ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. diff --git a/tests/baselines/reference/overloadOnConstInheritance3.errors.txt b/tests/baselines/reference/overloadOnConstInheritance3.errors.txt index b338f9795d7..062db72ac51 100644 --- a/tests/baselines/reference/overloadOnConstInheritance3.errors.txt +++ b/tests/baselines/reference/overloadOnConstInheritance3.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/overloadOnConstInheritance3.ts(4,11): error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'. Types of property 'addEventListener' are incompatible. Type '{ (x: "bar"): string; (x: "foo"): string; }' is not assignable to type '(x: string) => any'. + Signature '(x: string): any' has no corresponding signature in '{ (x: "bar"): string; (x: "foo"): string; }' tests/cases/compiler/overloadOnConstInheritance3.ts(6,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. tests/cases/compiler/overloadOnConstInheritance3.ts(7,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. @@ -14,6 +15,7 @@ tests/cases/compiler/overloadOnConstInheritance3.ts(7,5): error TS2382: Speciali !!! error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'addEventListener' are incompatible. !!! error TS2430: Type '{ (x: "bar"): string; (x: "foo"): string; }' is not assignable to type '(x: string) => any'. +!!! error TS2430: Signature '(x: string): any' has no corresponding signature in '{ (x: "bar"): string; (x: "foo"): string; }' // shouldn't need to redeclare the string overload addEventListener(x: 'bar'): string; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/overloadResolutionOverCTLambda.errors.txt b/tests/baselines/reference/overloadResolutionOverCTLambda.errors.txt index 9fc11b681c7..54e43e0b248 100644 --- a/tests/baselines/reference/overloadResolutionOverCTLambda.errors.txt +++ b/tests/baselines/reference/overloadResolutionOverCTLambda.errors.txt @@ -1,5 +1,6 @@ tests/cases/compiler/overloadResolutionOverCTLambda.ts(2,5): error TS2345: Argument of type '(a: number) => number' is not assignable to parameter of type '(item: number) => boolean'. - Type 'number' is not assignable to type 'boolean'. + Signature '(item: number): boolean' has no corresponding signature in '(a: number) => number' + Type 'number' is not assignable to type 'boolean'. ==== tests/cases/compiler/overloadResolutionOverCTLambda.ts (1 errors) ==== @@ -7,4 +8,5 @@ tests/cases/compiler/overloadResolutionOverCTLambda.ts(2,5): error TS2345: Argum foo(a => a); // can not convert (number)=>bool to (number)=>number ~~~~~~ !!! error TS2345: Argument of type '(a: number) => number' is not assignable to parameter of type '(item: number) => boolean'. -!!! error TS2345: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2345: Signature '(item: number): boolean' has no corresponding signature in '(a: number) => number' +!!! error TS2345: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt index 45c9f99b691..9658555f35b 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -4,9 +4,10 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,37): tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,38): error TS2344: Type 'D' does not satisfy the constraint 'A'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,27): error TS2345: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. - Types of parameters 'x' and 'x' are incompatible. - Type 'D' is not assignable to type 'B'. - Property 'x' is missing in type 'D'. + Signature '(x: B): any' has no corresponding signature in '(x: D) => G' + Types of parameters 'x' and 'x' are incompatible. + Type 'D' is not assignable to type 'B'. + Property 'x' is missing in type 'D'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): error TS2344: Type 'D' does not satisfy the constraint 'A'. @@ -48,7 +49,8 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): }); ~ !!! error TS2345: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. -!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2345: Type 'D' is not assignable to type 'B'. -!!! error TS2345: Property 'x' is missing in type 'D'. +!!! error TS2345: Signature '(x: B): any' has no corresponding signature in '(x: D) => G' +!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2345: Type 'D' is not assignable to type 'B'. +!!! error TS2345: Property 'x' is missing in type 'D'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt index daf057c9ebd..edc11299c9e 100644 --- a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt @@ -1,10 +1,12 @@ tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,6): error TS2345: Argument of type '(s: string) => {}' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'. - Type '{}' is not assignable to type '{ a: number; b: number; }'. - Property 'a' is missing in type '{}'. + Signature '(s: string): { a: number; b: number; }' has no corresponding signature in '(s: string) => {}' + Type '{}' is not assignable to type '{ a: number; b: number; }'. + Property 'a' is missing in type '{}'. tests/cases/compiler/overloadsWithProvisionalErrors.ts(7,17): error TS2304: Cannot find name 'blah'. tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,6): error TS2345: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'. - Type '{ a: any; }' is not assignable to type '{ a: number; b: number; }'. - Property 'b' is missing in type '{ a: any; }'. + Signature '(s: string): { a: number; b: number; }' has no corresponding signature in '(s: string) => { a: any; }' + Type '{ a: any; }' is not assignable to type '{ a: number; b: number; }'. + Property 'b' is missing in type '{ a: any; }'. tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cannot find name 'blah'. @@ -17,15 +19,17 @@ tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cann func(s => ({})); // Error for no applicable overload (object type is missing a and b) ~~~~~~~~~ !!! error TS2345: Argument of type '(s: string) => {}' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'. -!!! error TS2345: Type '{}' is not assignable to type '{ a: number; b: number; }'. -!!! error TS2345: Property 'a' is missing in type '{}'. +!!! error TS2345: Signature '(s: string): { a: number; b: number; }' has no corresponding signature in '(s: string) => {}' +!!! error TS2345: Type '{}' is not assignable to type '{ a: number; b: number; }'. +!!! error TS2345: Property 'a' is missing in type '{}'. func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) ~~~~ !!! error TS2304: Cannot find name 'blah'. func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway ~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'. -!!! error TS2345: Type '{ a: any; }' is not assignable to type '{ a: number; b: number; }'. -!!! error TS2345: Property 'b' is missing in type '{ a: any; }'. +!!! error TS2345: Signature '(s: string): { a: number; b: number; }' has no corresponding signature in '(s: string) => { a: any; }' +!!! error TS2345: Type '{ a: any; }' is not assignable to type '{ a: number; b: number; }'. +!!! error TS2345: Property 'b' is missing in type '{ a: any; }'. ~~~~ !!! error TS2304: Cannot find name 'blah'. \ No newline at end of file diff --git a/tests/baselines/reference/parseTypes.errors.txt b/tests/baselines/reference/parseTypes.errors.txt index baa5aaff738..c141b59e993 100644 --- a/tests/baselines/reference/parseTypes.errors.txt +++ b/tests/baselines/reference/parseTypes.errors.txt @@ -1,8 +1,11 @@ tests/cases/compiler/parseTypes.ts(9,1): error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. + Signature '(): number' has no corresponding signature in '(s: string) => void' tests/cases/compiler/parseTypes.ts(10,1): error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. + Signature '(): number' has no corresponding signature in '(s: string) => void' tests/cases/compiler/parseTypes.ts(11,1): error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'. Index signature is missing in type '(s: string) => void'. tests/cases/compiler/parseTypes.ts(12,1): error TS2322: Type '(s: string) => void' is not assignable to type 'new () => number'. + Signature 'new (): number' has no corresponding signature in '(s: string) => void' ==== tests/cases/compiler/parseTypes.ts (4 errors) ==== @@ -17,9 +20,11 @@ tests/cases/compiler/parseTypes.ts(12,1): error TS2322: Type '(s: string) => voi y=g; ~ !!! error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. +!!! error TS2322: Signature '(): number' has no corresponding signature in '(s: string) => void' x=g; ~ !!! error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. +!!! error TS2322: Signature '(): number' has no corresponding signature in '(s: string) => void' w=g; ~ !!! error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'. @@ -27,4 +32,5 @@ tests/cases/compiler/parseTypes.ts(12,1): error TS2322: Type '(s: string) => voi z=g; ~ !!! error TS2322: Type '(s: string) => void' is not assignable to type 'new () => number'. +!!! error TS2322: Signature 'new (): number' has no corresponding signature in '(s: string) => void' \ No newline at end of file diff --git a/tests/baselines/reference/parser536727.errors.txt b/tests/baselines/reference/parser536727.errors.txt index 4204e62c93b..70841efd89f 100644 --- a/tests/baselines/reference/parser536727.errors.txt +++ b/tests/baselines/reference/parser536727.errors.txt @@ -1,7 +1,9 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser536727.ts(7,5): error TS2345: Argument of type '() => (x: string) => string' is not assignable to parameter of type '(x: string) => string'. - Type '(x: string) => string' is not assignable to type 'string'. + Signature '(x: string): string' has no corresponding signature in '() => (x: string) => string' + Type '(x: string) => string' is not assignable to type 'string'. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser536727.ts(8,5): error TS2345: Argument of type '() => (x: string) => string' is not assignable to parameter of type '(x: string) => string'. - Type '(x: string) => string' is not assignable to type 'string'. + Signature '(x: string): string' has no corresponding signature in '() => (x: string) => string' + Type '(x: string) => string' is not assignable to type 'string'. ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser536727.ts (2 errors) ==== @@ -14,9 +16,11 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser536727.ts(8,5): foo(() => g); ~~~~~~~ !!! error TS2345: Argument of type '() => (x: string) => string' is not assignable to parameter of type '(x: string) => string'. -!!! error TS2345: Type '(x: string) => string' is not assignable to type 'string'. +!!! error TS2345: Signature '(x: string): string' has no corresponding signature in '() => (x: string) => string' +!!! error TS2345: Type '(x: string) => string' is not assignable to type 'string'. foo(x); ~ !!! error TS2345: Argument of type '() => (x: string) => string' is not assignable to parameter of type '(x: string) => string'. -!!! error TS2345: Type '(x: string) => string' is not assignable to type 'string'. +!!! error TS2345: Signature '(x: string): string' has no corresponding signature in '() => (x: string) => string' +!!! error TS2345: Type '(x: string) => string' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/parserAutomaticSemicolonInsertion1.errors.txt b/tests/baselines/reference/parserAutomaticSemicolonInsertion1.errors.txt index ee17b6f82aa..5eebe963b90 100644 --- a/tests/baselines/reference/parserAutomaticSemicolonInsertion1.errors.txt +++ b/tests/baselines/reference/parserAutomaticSemicolonInsertion1.errors.txt @@ -1,5 +1,7 @@ tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'. + Signature '(): void' has no corresponding signature in 'Object' tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts(14,1): error TS2322: Type 'Object' is not assignable to type '() => void'. + Signature '(): void' has no corresponding signature in 'Object' ==== tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts (2 errors) ==== @@ -13,6 +15,7 @@ tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAut i = o; ~ !!! error TS2322: Type 'Object' is not assignable to type 'I'. +!!! error TS2322: Signature '(): void' has no corresponding signature in 'Object' var a: { (): void @@ -21,4 +24,5 @@ tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAut a = o; ~ !!! error TS2322: Type 'Object' is not assignable to type '() => void'. +!!! error TS2322: Signature '(): void' has no corresponding signature in 'Object' \ No newline at end of file diff --git a/tests/baselines/reference/promiseChaining1.errors.txt b/tests/baselines/reference/promiseChaining1.errors.txt index bd3e52fcc1c..da593b4086c 100644 --- a/tests/baselines/reference/promiseChaining1.errors.txt +++ b/tests/baselines/reference/promiseChaining1.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/promiseChaining1.ts(7,50): error TS2345: Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'. - Type 'string' is not assignable to type 'Function'. - Property 'apply' is missing in type 'String'. + Signature '(x: S): Function' has no corresponding signature in '(x: S) => string' + Type 'string' is not assignable to type 'Function'. + Property 'apply' is missing in type 'String'. ==== tests/cases/compiler/promiseChaining1.ts (1 errors) ==== @@ -13,8 +14,9 @@ tests/cases/compiler/promiseChaining1.ts(7,50): error TS2345: Argument of type ' var z = this.then(x => result)/*S*/.then(x => "abc")/*Function*/.then(x => x.length)/*number*/; // Should error on "abc" because it is not a Function ~~~~~~~~~~ !!! error TS2345: Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'. -!!! error TS2345: Type 'string' is not assignable to type 'Function'. -!!! error TS2345: Property 'apply' is missing in type 'String'. +!!! error TS2345: Signature '(x: S): Function' has no corresponding signature in '(x: S) => string' +!!! error TS2345: Type 'string' is not assignable to type 'Function'. +!!! error TS2345: Property 'apply' is missing in type 'String'. return new Chain2(result); } } \ No newline at end of file diff --git a/tests/baselines/reference/promiseChaining2.errors.txt b/tests/baselines/reference/promiseChaining2.errors.txt index f12baebd4dc..acdaad94bef 100644 --- a/tests/baselines/reference/promiseChaining2.errors.txt +++ b/tests/baselines/reference/promiseChaining2.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/promiseChaining2.ts(7,45): error TS2345: Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'. - Type 'string' is not assignable to type 'Function'. - Property 'apply' is missing in type 'String'. + Signature '(x: S): Function' has no corresponding signature in '(x: S) => string' + Type 'string' is not assignable to type 'Function'. + Property 'apply' is missing in type 'String'. ==== tests/cases/compiler/promiseChaining2.ts (1 errors) ==== @@ -13,8 +14,9 @@ tests/cases/compiler/promiseChaining2.ts(7,45): error TS2345: Argument of type ' var z = this.then(x => result).then(x => "abc").then(x => x.length); ~~~~~~~~~~ !!! error TS2345: Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'. -!!! error TS2345: Type 'string' is not assignable to type 'Function'. -!!! error TS2345: Property 'apply' is missing in type 'String'. +!!! error TS2345: Signature '(x: S): Function' has no corresponding signature in '(x: S) => string' +!!! error TS2345: Type 'string' is not assignable to type 'Function'. +!!! error TS2345: Property 'apply' is missing in type 'String'. return new Chain2(result); } } \ No newline at end of file diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index a74938f5dd9..0787189e2e0 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -1,50 +1,75 @@ tests/cases/compiler/promisePermutations.ts(74,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'number' is not assignable to type 'IPromise'. - Property 'then' is missing in type 'Number'. + Signature '(value: IPromise): IPromise' has no corresponding signature in '(x: number) => IPromise' + Types of parameters 'x' and 'value' are incompatible. + Type 'number' is not assignable to type 'IPromise'. + Property 'then' is missing in type 'Number'. tests/cases/compiler/promisePermutations.ts(79,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, y?: string) => IPromise' + Types of parameters 'x' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(82,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, y?: string) => IPromise' + Types of parameters 'x' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(83,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(value: string): Promise' has no corresponding signature in '(x: number, y?: string) => Promise' + Types of parameters 'x' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(84,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, y?: string) => Promise' + Types of parameters 'x' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(88,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: string) => string) => IPromise' tests/cases/compiler/promisePermutations.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: string) => string) => IPromise' tests/cases/compiler/promisePermutations.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. + Signature '(value: string): Promise' has no corresponding signature in '(x: number, cb: (a: string) => string) => Promise' tests/cases/compiler/promisePermutations.ts(93,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: string) => string) => Promise' tests/cases/compiler/promisePermutations.ts(97,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: T) => T) => IPromise' tests/cases/compiler/promisePermutations.ts(100,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: T) => T) => IPromise' tests/cases/compiler/promisePermutations.ts(101,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. + Signature '(value: string): Promise' has no corresponding signature in '(x: number, cb: (a: T) => T) => Promise' tests/cases/compiler/promisePermutations.ts(102,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: T) => T) => Promise' tests/cases/compiler/promisePermutations.ts(106,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'cb' and 'value' are incompatible. - Type '(a: T) => T' is not assignable to type 'string'. + Signature '(value: string): IPromise' has no corresponding signature in '(cb: (a: T) => T) => IPromise' + Types of parameters 'cb' and 'value' are incompatible. + Type '(a: T) => T' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(109,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'cb' and 'value' are incompatible. - Type '(a: T) => T' is not assignable to type 'string'. + Signature '(value: string): IPromise' has no corresponding signature in '(cb: (a: T) => T) => IPromise' + Types of parameters 'cb' and 'value' are incompatible. + Type '(a: T) => T' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(110,19): error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. - Types of parameters 'cb' and 'value' are incompatible. - Type '(a: T) => T' is not assignable to type 'string'. + Signature '(value: string): Promise' has no corresponding signature in '(cb: (a: T) => T) => Promise' + Types of parameters 'cb' and 'value' are incompatible. + Type '(a: T) => T' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(111,19): error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'cb' and 'value' are incompatible. - Type '(a: T) => T' is not assignable to type 'string'. + Signature '(value: string): IPromise' has no corresponding signature in '(cb: (a: T) => T) => Promise' + Types of parameters 'cb' and 'value' are incompatible. + Type '(a: T) => T' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(117,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. + Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: T) => T) => IPromise' tests/cases/compiler/promisePermutations.ts(120,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. + Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: T) => T) => IPromise' tests/cases/compiler/promisePermutations.ts(121,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. + Signature '(value: number): Promise' has no corresponding signature in '(x: T, cb: (a: T) => T) => Promise' tests/cases/compiler/promisePermutations.ts(122,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. + Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: T) => T) => Promise' tests/cases/compiler/promisePermutations.ts(126,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. + Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: U) => U) => IPromise' tests/cases/compiler/promisePermutations.ts(129,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations.ts(132,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. + Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: U) => U) => IPromise' tests/cases/compiler/promisePermutations.ts(133,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. + Signature '(value: number): Promise' has no corresponding signature in '(x: T, cb: (a: U) => U) => Promise' tests/cases/compiler/promisePermutations.ts(134,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. + Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: U) => U) => Promise' tests/cases/compiler/promisePermutations.ts(137,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Type 'string' is not assignable to type 'number'. @@ -55,27 +80,35 @@ tests/cases/compiler/promisePermutations.ts(152,12): error TS2453: The type argu Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Types of property 'then' are incompatible. Type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }' is not assignable to type '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. - Types of parameters 'success' and 'success' are incompatible. - Type '(value: string) => IPromise' is not assignable to type '(value: number) => Promise'. - Types of parameters 'value' and 'value' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise' has no corresponding signature in '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }' + Types of parameters 'success' and 'success' are incompatible. + Type '(value: string) => IPromise' is not assignable to type '(value: number) => Promise'. + Signature '(value: number): Promise' has no corresponding signature in '(value: string) => IPromise' + Types of parameters 'value' and 'value' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations.ts(156,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. - Type 'IPromise' is not assignable to type 'IPromise'. - Type 'number' is not assignable to type 'string'. + Signature '(value: number): IPromise' has no corresponding signature in '{ (x: number): IPromise; (x: string): IPromise; }' + Type 'IPromise' is not assignable to type 'IPromise'. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(158,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. - Type 'IPromise' is not assignable to type 'IPromise'. - Type 'number' is not assignable to type 'string'. + Signature '(value: number): IPromise' has no corresponding signature in '{ (x: number): IPromise; (x: string): IPromise; }' + Type 'IPromise' is not assignable to type 'IPromise'. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(159,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. + Signature '(value: number): Promise' has no corresponding signature in '{ (x: number): Promise; (x: string): Promise; }' + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. - Type 'Promise' is not assignable to type 'IPromise'. - Types of property 'then' are incompatible. - Type '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. - Types of parameters 'success' and 'success' are incompatible. - Type '(value: number) => Promise' is not assignable to type '(value: string) => IPromise'. - Types of parameters 'value' and 'value' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(value: number): IPromise' has no corresponding signature in '{ (x: number): Promise; (x: string): Promise; }' + Type 'Promise' is not assignable to type 'IPromise'. + Types of property 'then' are incompatible. + Type '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. + Signature '(success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise' has no corresponding signature in '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' + Types of parameters 'success' and 'success' are incompatible. + Type '(value: number) => Promise' is not assignable to type '(value: string) => IPromise'. + Signature '(value: string): IPromise' has no corresponding signature in '(value: number) => Promise' + Types of parameters 'value' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/promisePermutations.ts (33 errors) ==== @@ -155,9 +188,10 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'IPromise'. -!!! error TS2345: Property 'then' is missing in type 'Number'. +!!! error TS2345: Signature '(value: IPromise): IPromise' has no corresponding signature in '(x: number) => IPromise' +!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'IPromise'. +!!! error TS2345: Property 'then' is missing in type 'Number'. var r4: IPromise; var sIPromise: (x: any) => IPromise; @@ -165,84 +199,100 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, y?: string) => IPromise' +!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, y?: string) => IPromise' +!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): Promise' has no corresponding signature in '(x: number, y?: string) => Promise' +!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, y?: string) => Promise' +!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: string) => string) => IPromise' var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: string) => 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: Signature '(value: string): Promise' has no corresponding signature in '(x: number, cb: (a: string) => 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: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: string) => string) => Promise' var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: T) => T) => IPromise' var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: T) => T) => 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: Signature '(value: string): Promise' has no corresponding signature in '(x: number, cb: (a: T) => T) => 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: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: T) => T) => Promise' var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(cb: (a: T) => T) => IPromise' +!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(cb: (a: T) => T) => IPromise' +!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): Promise' has no corresponding signature in '(cb: (a: T) => T) => Promise' +!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(cb: (a: T) => T) => Promise' +!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -251,23 +301,28 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t 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: Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: T) => T) => IPromise' var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2345: Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: T) => T) => 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: Signature '(value: number): Promise' has no corresponding signature in '(x: T, cb: (a: T) => T) => 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: Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: T) => T) => Promise' var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2345: Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: U) => U) => IPromise' var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok @@ -280,12 +335,15 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t 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: Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: U) => U) => 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: Signature '(value: number): Promise' has no corresponding signature in '(x: T, cb: (a: U) => U) => 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: Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: U) => U) => Promise' var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error @@ -317,39 +375,47 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t !!! error TS2453: Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Types of property 'then' are incompatible. !!! error TS2453: Type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }' is not assignable to type '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. -!!! error TS2453: Types of parameters 'success' and 'success' are incompatible. -!!! error TS2453: Type '(value: string) => IPromise' is not assignable to type '(value: number) => Promise'. -!!! error TS2453: Types of parameters 'value' and 'value' are incompatible. -!!! error TS2453: Type 'string' is not assignable to type 'number'. +!!! error TS2453: Signature '(success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise' has no corresponding signature in '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }' +!!! error TS2453: Types of parameters 'success' and 'success' are incompatible. +!!! error TS2453: Type '(value: string) => IPromise' is not assignable to type '(value: number) => Promise'. +!!! error TS2453: Signature '(value: number): Promise' has no corresponding signature in '(value: string) => IPromise' +!!! error TS2453: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2453: Type 'string' is not assignable to type 'number'. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: number): IPromise' has no corresponding signature in '{ (x: number): IPromise; (x: string): IPromise; }' +!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: number): IPromise' has no corresponding signature in '{ (x: number): IPromise; (x: string): IPromise; }' +!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: number): Promise' has no corresponding signature in '{ (x: number): Promise; (x: string): Promise; }' +!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'IPromise'. -!!! error TS2345: Types of property 'then' are incompatible. -!!! error TS2345: Type '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. -!!! error TS2345: Types of parameters 'success' and 'success' are incompatible. -!!! error TS2345: Type '(value: number) => Promise' is not assignable to type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'value' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: number): IPromise' has no corresponding signature in '{ (x: number): Promise; (x: string): Promise; }' +!!! error TS2345: Type 'Promise' is not assignable to type 'IPromise'. +!!! error TS2345: Types of property 'then' are incompatible. +!!! error TS2345: Type '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. +!!! error TS2345: Signature '(success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise' has no corresponding signature in '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' +!!! error TS2345: Types of parameters 'success' and 'success' are incompatible. +!!! error TS2345: Type '(value: number) => Promise' is not assignable to type '(value: string) => IPromise'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(value: number) => Promise' +!!! error TS2345: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index 8afceeae0fd..054cdec66c9 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -1,50 +1,75 @@ tests/cases/compiler/promisePermutations2.ts(73,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'number' is not assignable to type 'IPromise'. - Property 'then' is missing in type 'Number'. + Signature '(value: IPromise): IPromise' has no corresponding signature in '(x: number) => IPromise' + Types of parameters 'x' and 'value' are incompatible. + Type 'number' is not assignable to type 'IPromise'. + Property 'then' is missing in type 'Number'. tests/cases/compiler/promisePermutations2.ts(78,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, y?: string) => IPromise' + Types of parameters 'x' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations2.ts(81,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, y?: string) => IPromise' + Types of parameters 'x' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations2.ts(82,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(value: string): Promise' has no corresponding signature in '(x: number, y?: string) => Promise' + Types of parameters 'x' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations2.ts(83,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, y?: string) => Promise' + Types of parameters 'x' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations2.ts(87,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: string) => 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'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: string) => 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'. + Signature '(value: string): Promise' has no corresponding signature in '(x: number, cb: (a: string) => 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'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: string) => string) => Promise' tests/cases/compiler/promisePermutations2.ts(96,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: T) => T) => 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'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: T) => T) => 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'. + Signature '(value: string): Promise' has no corresponding signature in '(x: number, cb: (a: T) => T) => 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'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: T) => T) => Promise' tests/cases/compiler/promisePermutations2.ts(105,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'cb' and 'value' are incompatible. - Type '(a: T) => T' is not assignable to type 'string'. + Signature '(value: string): IPromise' has no corresponding signature in '(cb: (a: T) => T) => IPromise' + Types of parameters 'cb' and 'value' are incompatible. + Type '(a: T) => T' is not assignable to type 'string'. tests/cases/compiler/promisePermutations2.ts(108,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'cb' and 'value' are incompatible. - Type '(a: T) => T' is not assignable to type 'string'. + Signature '(value: string): IPromise' has no corresponding signature in '(cb: (a: T) => T) => IPromise' + Types of parameters 'cb' and 'value' are incompatible. + Type '(a: T) => T' is not assignable to type 'string'. tests/cases/compiler/promisePermutations2.ts(109,19): error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. - Types of parameters 'cb' and 'value' are incompatible. - Type '(a: T) => T' is not assignable to type 'string'. + Signature '(value: string): Promise' has no corresponding signature in '(cb: (a: T) => T) => Promise' + Types of parameters 'cb' and 'value' are incompatible. + Type '(a: T) => T' is not assignable to type 'string'. tests/cases/compiler/promisePermutations2.ts(110,19): error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'cb' and 'value' are incompatible. - Type '(a: T) => T' is not assignable to type 'string'. + Signature '(value: string): IPromise' has no corresponding signature in '(cb: (a: T) => T) => Promise' + Types of parameters 'cb' and 'value' are incompatible. + Type '(a: T) => T' is not assignable to type 'string'. tests/cases/compiler/promisePermutations2.ts(116,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. + Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: T) => T) => 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'. + Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: T) => T) => 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'. + Signature '(value: number): Promise' has no corresponding signature in '(x: T, cb: (a: T) => T) => 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'. + Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: T) => T) => Promise' tests/cases/compiler/promisePermutations2.ts(125,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. + Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: U) => U) => IPromise' tests/cases/compiler/promisePermutations2.ts(128,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Type 'string' is not assignable to type 'number'. tests/cases/compiler/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'. + Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: U) => U) => 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'. + Signature '(value: number): Promise' has no corresponding signature in '(x: T, cb: (a: U) => U) => 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'. + Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: U) => U) => Promise' tests/cases/compiler/promisePermutations2.ts(136,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Type 'string' is not assignable to type 'number'. @@ -55,27 +80,35 @@ tests/cases/compiler/promisePermutations2.ts(151,12): error TS2453: The type arg Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Types of property 'then' are incompatible. Type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }' is not assignable to type '(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => Promise'. - Types of parameters 'success' and 'success' are incompatible. - Type '(value: string) => IPromise' is not assignable to type '(value: number) => any'. - Types of parameters 'value' and 'value' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise' has no corresponding signature in '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }' + Types of parameters 'success' and 'success' are incompatible. + Type '(value: string) => IPromise' is not assignable to type '(value: number) => any'. + Signature '(value: number): any' has no corresponding signature in '(value: string) => IPromise' + Types of parameters 'value' and 'value' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations2.ts(155,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. - Type 'IPromise' is not assignable to type 'IPromise'. - Type 'number' is not assignable to type 'string'. + Signature '(value: number): IPromise' has no corresponding signature in '{ (x: number): IPromise; (x: string): IPromise; }' + Type 'IPromise' is not assignable to type 'IPromise'. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations2.ts(157,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. - Type 'IPromise' is not assignable to type 'IPromise'. - Type 'number' is not assignable to type 'string'. + Signature '(value: number): IPromise' has no corresponding signature in '{ (x: number): IPromise; (x: string): IPromise; }' + Type 'IPromise' is not assignable to type 'IPromise'. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations2.ts(158,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. + Signature '(value: number): Promise' has no corresponding signature in '{ (x: number): Promise; (x: string): Promise; }' + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. - Type 'Promise' is not assignable to type 'IPromise'. - Types of property 'then' are incompatible. - Type '(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => Promise' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. - Types of parameters 'success' and 'success' are incompatible. - Type '(value: number) => any' is not assignable to type '(value: string) => IPromise'. - Types of parameters 'value' and 'value' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(value: number): IPromise' has no corresponding signature in '{ (x: number): Promise; (x: string): Promise; }' + Type 'Promise' is not assignable to type 'IPromise'. + Types of property 'then' are incompatible. + Type '(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => Promise' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. + Signature '(success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise' has no corresponding signature in '(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => Promise' + Types of parameters 'success' and 'success' are incompatible. + Type '(value: number) => any' is not assignable to type '(value: string) => IPromise'. + Signature '(value: string): IPromise' has no corresponding signature in '(value: number) => any' + Types of parameters 'value' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/promisePermutations2.ts (33 errors) ==== @@ -154,9 +187,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); // Should error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'IPromise'. -!!! error TS2345: Property 'then' is missing in type 'Number'. +!!! error TS2345: Signature '(value: IPromise): IPromise' has no corresponding signature in '(x: number) => IPromise' +!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'IPromise'. +!!! error TS2345: Property 'then' is missing in type 'Number'. var r4: IPromise; var sIPromise: (x: any) => IPromise; @@ -164,84 +198,100 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, y?: string) => IPromise' +!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, y?: string) => IPromise' +!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): Promise' has no corresponding signature in '(x: number, y?: string) => Promise' +!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, y?: string) => Promise' +!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: string) => string) => IPromise' var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: string) => 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: Signature '(value: string): Promise' has no corresponding signature in '(x: number, cb: (a: string) => 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: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: string) => string) => Promise' var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: T) => T) => IPromise' var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: T) => T) => 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: Signature '(value: string): Promise' has no corresponding signature in '(x: number, cb: (a: T) => T) => 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: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: T) => T) => Promise' var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(cb: (a: T) => T) => IPromise' +!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(cb: (a: T) => T) => IPromise' +!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): Promise' has no corresponding signature in '(cb: (a: T) => T) => Promise' +!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(cb: (a: T) => T) => Promise' +!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -250,23 +300,28 @@ tests/cases/compiler/promisePermutations2.ts(159,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: Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: T) => T) => IPromise' var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2345: Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: T) => T) => 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: Signature '(value: number): Promise' has no corresponding signature in '(x: T, cb: (a: T) => T) => 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: Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: T) => T) => Promise' var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2345: Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: U) => U) => 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 @@ -279,12 +334,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: Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: U) => U) => 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: Signature '(value: number): Promise' has no corresponding signature in '(x: T, cb: (a: U) => U) => 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: Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: U) => U) => Promise' var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error @@ -316,39 +374,47 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of !!! error TS2453: Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Types of property 'then' are incompatible. !!! error TS2453: Type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }' is not assignable to type '(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => Promise'. -!!! error TS2453: Types of parameters 'success' and 'success' are incompatible. -!!! error TS2453: Type '(value: string) => IPromise' is not assignable to type '(value: number) => any'. -!!! error TS2453: Types of parameters 'value' and 'value' are incompatible. -!!! error TS2453: Type 'string' is not assignable to type 'number'. +!!! error TS2453: Signature '(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise' has no corresponding signature in '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }' +!!! error TS2453: Types of parameters 'success' and 'success' are incompatible. +!!! error TS2453: Type '(value: string) => IPromise' is not assignable to type '(value: number) => any'. +!!! error TS2453: Signature '(value: number): any' has no corresponding signature in '(value: string) => IPromise' +!!! error TS2453: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2453: Type 'string' is not assignable to type 'number'. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: number): IPromise' has no corresponding signature in '{ (x: number): IPromise; (x: string): IPromise; }' +!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: number): IPromise' has no corresponding signature in '{ (x: number): IPromise; (x: string): IPromise; }' +!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: number): Promise' has no corresponding signature in '{ (x: number): Promise; (x: string): Promise; }' +!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'IPromise'. -!!! error TS2345: Types of property 'then' are incompatible. -!!! error TS2345: Type '(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => Promise' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. -!!! error TS2345: Types of parameters 'success' and 'success' are incompatible. -!!! error TS2345: Type '(value: number) => any' is not assignable to type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'value' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: number): IPromise' has no corresponding signature in '{ (x: number): Promise; (x: string): Promise; }' +!!! error TS2345: Type 'Promise' is not assignable to type 'IPromise'. +!!! error TS2345: Types of property 'then' are incompatible. +!!! error TS2345: Type '(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => Promise' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. +!!! error TS2345: Signature '(success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise' has no corresponding signature in '(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => Promise' +!!! error TS2345: Types of parameters 'success' and 'success' are incompatible. +!!! error TS2345: Type '(value: number) => any' is not assignable to type '(value: string) => IPromise'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(value: number) => any' +!!! error TS2345: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index b17021a02b9..5d414cf4176 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -1,53 +1,79 @@ tests/cases/compiler/promisePermutations3.ts(68,69): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'number' is not assignable to type 'IPromise'. - Property 'then' is missing in type 'Number'. + Signature '(value: IPromise): IPromise' has no corresponding signature in '(x: number) => IPromise' + Types of parameters 'x' and 'value' are incompatible. + Type 'number' is not assignable to type 'IPromise'. + Property 'then' is missing in type 'Number'. tests/cases/compiler/promisePermutations3.ts(73,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'number' is not assignable to type 'IPromise'. + Signature '(value: IPromise): IPromise' has no corresponding signature in '(x: number) => IPromise' + Types of parameters 'x' and 'value' are incompatible. + Type 'number' is not assignable to type 'IPromise'. tests/cases/compiler/promisePermutations3.ts(78,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, y?: string) => IPromise' + Types of parameters 'x' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations3.ts(81,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, y?: string) => IPromise' + Types of parameters 'x' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations3.ts(82,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(value: string): Promise' has no corresponding signature in '(x: number, y?: string) => Promise' + Types of parameters 'x' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations3.ts(83,19): error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'x' and 'value' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, y?: string) => Promise' + Types of parameters 'x' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. 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'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: string) => string) => IPromise' tests/cases/compiler/promisePermutations3.ts(90,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: string) => string) => IPromise' tests/cases/compiler/promisePermutations3.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. + Signature '(value: string): Promise' has no corresponding signature in '(x: number, cb: (a: string) => string) => Promise' tests/cases/compiler/promisePermutations3.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: string) => string) => Promise' 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'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: T) => T) => IPromise' tests/cases/compiler/promisePermutations3.ts(99,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: T) => T) => IPromise' tests/cases/compiler/promisePermutations3.ts(100,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. + Signature '(value: string): Promise' has no corresponding signature in '(x: number, cb: (a: T) => T) => Promise' tests/cases/compiler/promisePermutations3.ts(101,19): error TS2345: Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. + Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: T) => T) => Promise' 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 '(a: T) => T' is not assignable to type 'string'. + Signature '(value: string): IPromise' has no corresponding signature in '(cb: (a: T) => T) => IPromise' + Types of parameters 'cb' and 'value' are incompatible. + Type '(a: T) => T' is not assignable to type 'string'. tests/cases/compiler/promisePermutations3.ts(108,19): error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'cb' and 'value' are incompatible. - Type '(a: T) => T' is not assignable to type 'string'. + Signature '(value: string): IPromise' has no corresponding signature in '(cb: (a: T) => T) => IPromise' + Types of parameters 'cb' and 'value' are incompatible. + Type '(a: T) => T' is not assignable to type 'string'. tests/cases/compiler/promisePermutations3.ts(109,19): error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. - Types of parameters 'cb' and 'value' are incompatible. - Type '(a: T) => T' is not assignable to type 'string'. + Signature '(value: string): Promise' has no corresponding signature in '(cb: (a: T) => T) => Promise' + Types of parameters 'cb' and 'value' are incompatible. + Type '(a: T) => T' is not assignable to type 'string'. tests/cases/compiler/promisePermutations3.ts(110,19): error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. - Types of parameters 'cb' and 'value' are incompatible. - Type '(a: T) => T' is not assignable to type 'string'. + Signature '(value: string): IPromise' has no corresponding signature in '(cb: (a: T) => T) => Promise' + Types of parameters 'cb' and 'value' are incompatible. + Type '(a: T) => T' is not assignable to type 'string'. 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'. + Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: T) => T) => IPromise' tests/cases/compiler/promisePermutations3.ts(119,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. + Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: T) => T) => IPromise' tests/cases/compiler/promisePermutations3.ts(120,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. + Signature '(value: number): Promise' has no corresponding signature in '(x: T, cb: (a: T) => T) => Promise' tests/cases/compiler/promisePermutations3.ts(121,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. + Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: T) => T) => Promise' 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'. + Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: U) => U) => IPromise' tests/cases/compiler/promisePermutations3.ts(128,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations3.ts(131,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. + Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: U) => U) => IPromise' tests/cases/compiler/promisePermutations3.ts(132,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. + Signature '(value: number): Promise' has no corresponding signature in '(x: T, cb: (a: U) => U) => Promise' tests/cases/compiler/promisePermutations3.ts(133,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. + Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: U) => U) => Promise' tests/cases/compiler/promisePermutations3.ts(136,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Type 'string' is not assignable to type 'number'. @@ -58,32 +84,42 @@ tests/cases/compiler/promisePermutations3.ts(151,12): error TS2453: The type arg Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Types of property 'then' are incompatible. Type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise' is not assignable to type '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. - Types of parameters 'success' and 'success' are incompatible. - Type '(value: string) => any' is not assignable to type '(value: number) => Promise'. - Types of parameters 'value' and 'value' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise' has no corresponding signature in '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise' + Types of parameters 'success' and 'success' are incompatible. + Type '(value: string) => any' is not assignable to type '(value: number) => Promise'. + Signature '(value: number): Promise' has no corresponding signature in '(value: string) => any' + Types of parameters 'value' and 'value' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations3.ts(155,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. - Type 'IPromise' is not assignable to type 'IPromise'. - Type 'number' is not assignable to type 'string'. + Signature '(value: number): IPromise' has no corresponding signature in '{ (x: number): IPromise; (x: string): IPromise; }' + Type 'IPromise' is not assignable to type 'IPromise'. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations3.ts(157,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. - Type 'IPromise' is not assignable to type 'IPromise'. - Type 'number' is not assignable to type 'string'. + Signature '(value: number): IPromise' has no corresponding signature in '{ (x: number): IPromise; (x: string): IPromise; }' + Type 'IPromise' is not assignable to type 'IPromise'. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations3.ts(158,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. + Signature '(value: number): Promise' has no corresponding signature in '{ (x: number): Promise; (x: string): Promise; }' + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations3.ts(159,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. - Type 'Promise' is not assignable to type 'IPromise'. - Types of property 'then' are incompatible. - Type '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. - Types of parameters 'success' and 'success' are incompatible. - Type '(value: number) => Promise' is not assignable to type '(value: string) => any'. - Types of parameters 'value' and 'value' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(value: number): IPromise' has no corresponding signature in '{ (x: number): Promise; (x: string): Promise; }' + Type 'Promise' is not assignable to type 'IPromise'. + Types of property 'then' are incompatible. + Type '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. + Signature '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise' has no corresponding signature in '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' + Types of parameters 'success' and 'success' are incompatible. + Type '(value: number) => Promise' is not assignable to type '(value: string) => any'. + Signature '(value: string): any' has no corresponding signature in '(value: number) => Promise' + Types of parameters 'value' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of type '{ (x: T): IPromise; (x: T, y: T): Promise; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise'. - Type 'IPromise' is not assignable to type 'Promise'. - Types of property 'then' are incompatible. - Type '(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise' is not assignable to type '{ (success?: (value: any) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: any) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: any) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. - Type 'IPromise' is not assignable to type 'Promise'. + Signature '(value: (x: any) => any): Promise' has no corresponding signature in '{ (x: T): IPromise; (x: T, y: T): Promise; }' + Type 'IPromise' is not assignable to type 'Promise'. + Types of property 'then' are incompatible. + Type '(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise' is not assignable to type '{ (success?: (value: any) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: any) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: any) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. + Signature '(success?: (value: any) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise' has no corresponding signature in '(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise' + Type 'IPromise' is not assignable to type 'Promise'. ==== tests/cases/compiler/promisePermutations3.ts (35 errors) ==== @@ -157,9 +193,10 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var r3b = r3.then(testFunction3, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'IPromise'. -!!! error TS2345: Property 'then' is missing in type 'Number'. +!!! error TS2345: Signature '(value: IPromise): IPromise' has no corresponding signature in '(x: number) => IPromise' +!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'IPromise'. +!!! error TS2345: Property 'then' is missing in type 'Number'. var s3: Promise; var s3a = s3.then(testFunction3, testFunction3, testFunction3); var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); @@ -167,8 +204,9 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'IPromise'. +!!! error TS2345: Signature '(value: IPromise): IPromise' has no corresponding signature in '(x: number) => IPromise' +!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'IPromise'. var r4: IPromise; var sIPromise: (x: any) => IPromise; @@ -176,84 +214,100 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, y?: string) => IPromise' +!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, y?: string) => IPromise' +!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): Promise' has no corresponding signature in '(x: number, y?: string) => Promise' +!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, y?: string) => Promise' +!!! error TS2345: Types of parameters 'x' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: string) => string) => IPromise' var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: string) => 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: Signature '(value: string): Promise' has no corresponding signature in '(x: number, cb: (a: string) => 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: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: string) => string) => Promise' var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: T) => T) => IPromise' var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: T) => T) => 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: Signature '(value: string): Promise' has no corresponding signature in '(x: number, cb: (a: T) => T) => 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: Signature '(value: string): IPromise' has no corresponding signature in '(x: number, cb: (a: T) => T) => Promise' var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(cb: (a: T) => T) => IPromise' +!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(cb: (a: T) => T) => IPromise' +!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): Promise' has no corresponding signature in '(cb: (a: T) => T) => Promise' +!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. -!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. -!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: string): IPromise' has no corresponding signature in '(cb: (a: T) => T) => Promise' +!!! error TS2345: Types of parameters 'cb' and 'value' are incompatible. +!!! error TS2345: Type '(a: T) => T' is not assignable to type 'string'. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; @@ -262,23 +316,28 @@ 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: Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: T) => T) => IPromise' var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2345: Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: T) => T) => 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: Signature '(value: number): Promise' has no corresponding signature in '(x: T, cb: (a: T) => T) => 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: Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: T) => T) => Promise' var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. +!!! error TS2345: Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: U) => U) => 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 @@ -291,12 +350,15 @@ tests/cases/compiler/promisePermutations3.ts(165,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: Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: U) => U) => 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: Signature '(value: number): Promise' has no corresponding signature in '(x: T, cb: (a: U) => U) => 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: Signature '(value: number): IPromise' has no corresponding signature in '(x: T, cb: (a: U) => U) => Promise' var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error @@ -328,39 +390,47 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! error TS2453: Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Types of property 'then' are incompatible. !!! error TS2453: Type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise' is not assignable to type '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. -!!! error TS2453: Types of parameters 'success' and 'success' are incompatible. -!!! error TS2453: Type '(value: string) => any' is not assignable to type '(value: number) => Promise'. -!!! error TS2453: Types of parameters 'value' and 'value' are incompatible. -!!! error TS2453: Type 'string' is not assignable to type 'number'. +!!! error TS2453: Signature '(success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise' has no corresponding signature in '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise' +!!! error TS2453: Types of parameters 'success' and 'success' are incompatible. +!!! error TS2453: Type '(value: string) => any' is not assignable to type '(value: number) => Promise'. +!!! error TS2453: Signature '(value: number): Promise' has no corresponding signature in '(value: string) => any' +!!! error TS2453: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2453: Type 'string' is not assignable to type 'number'. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: number): IPromise' has no corresponding signature in '{ (x: number): IPromise; (x: string): IPromise; }' +!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: number): IPromise' has no corresponding signature in '{ (x: number): IPromise; (x: string): IPromise; }' +!!! error TS2345: Type 'IPromise' is not assignable to type 'IPromise'. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: number): Promise' has no corresponding signature in '{ (x: number): Promise; (x: string): Promise; }' +!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: Type 'Promise' is not assignable to type 'IPromise'. -!!! error TS2345: Types of property 'then' are incompatible. -!!! error TS2345: Type '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. -!!! error TS2345: Types of parameters 'success' and 'success' are incompatible. -!!! error TS2345: Type '(value: number) => Promise' is not assignable to type '(value: string) => any'. -!!! error TS2345: Types of parameters 'value' and 'value' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Signature '(value: number): IPromise' has no corresponding signature in '{ (x: number): Promise; (x: string): Promise; }' +!!! error TS2345: Type 'Promise' is not assignable to type 'IPromise'. +!!! error TS2345: Types of property 'then' are incompatible. +!!! error TS2345: Type '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. +!!! error TS2345: Signature '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise' has no corresponding signature in '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' +!!! error TS2345: Types of parameters 'success' and 'success' are incompatible. +!!! error TS2345: Type '(value: number) => Promise' is not assignable to type '(value: string) => any'. +!!! error TS2345: Signature '(value: string): any' has no corresponding signature in '(value: number) => Promise' +!!! error TS2345: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok @@ -369,8 +439,10 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: T): IPromise; (x: T, y: T): Promise; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'Promise'. -!!! error TS2345: Types of property 'then' are incompatible. -!!! error TS2345: Type '(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise' is not assignable to type '{ (success?: (value: any) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: any) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: any) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'Promise'. +!!! error TS2345: Signature '(value: (x: any) => any): Promise' has no corresponding signature in '{ (x: T): IPromise; (x: T, y: T): Promise; }' +!!! error TS2345: Type 'IPromise' is not assignable to type 'Promise'. +!!! error TS2345: Types of property 'then' are incompatible. +!!! error TS2345: Type '(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise' is not assignable to type '{ (success?: (value: any) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: any) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: any) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. +!!! error TS2345: Signature '(success?: (value: any) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise' has no corresponding signature in '(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise' +!!! error TS2345: Type 'IPromise' is not assignable to type 'Promise'. var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok \ No newline at end of file diff --git a/tests/baselines/reference/propertyAssignment.errors.txt b/tests/baselines/reference/propertyAssignment.errors.txt index 47359caf9c2..ae65ed9b73a 100644 --- a/tests/baselines/reference/propertyAssignment.errors.txt +++ b/tests/baselines/reference/propertyAssignment.errors.txt @@ -1,7 +1,9 @@ tests/cases/compiler/propertyAssignment.ts(6,13): error TS1170: A computed property name in a type literal must directly refer to a built-in symbol. tests/cases/compiler/propertyAssignment.ts(6,14): error TS2304: Cannot find name 'index'. tests/cases/compiler/propertyAssignment.ts(14,1): error TS2322: Type '{ x: number; }' is not assignable to type 'new () => any'. + Signature 'new (): any' has no corresponding signature in '{ x: number; }' tests/cases/compiler/propertyAssignment.ts(16,1): error TS2322: Type '{ x: number; }' is not assignable to type '() => void'. + Signature '(): void' has no corresponding signature in '{ x: number; }' ==== tests/cases/compiler/propertyAssignment.ts (4 errors) ==== @@ -25,7 +27,9 @@ tests/cases/compiler/propertyAssignment.ts(16,1): error TS2322: Type '{ x: numbe foo1 = bar1; // should be an error ~~~~ !!! error TS2322: Type '{ x: number; }' is not assignable to type 'new () => any'. +!!! error TS2322: Signature 'new (): any' has no corresponding signature in '{ x: number; }' foo2 = bar2; foo3 = bar3; // should be an error ~~~~ -!!! error TS2322: Type '{ x: number; }' is not assignable to type '() => void'. \ No newline at end of file +!!! error TS2322: Type '{ x: number; }' is not assignable to type '() => void'. +!!! error TS2322: Signature '(): void' has no corresponding signature in '{ x: number; }' \ No newline at end of file diff --git a/tests/baselines/reference/qualify.errors.txt b/tests/baselines/reference/qualify.errors.txt index c7679a0a0f8..822b329b757 100644 --- a/tests/baselines/reference/qualify.errors.txt +++ b/tests/baselines/reference/qualify.errors.txt @@ -7,7 +7,9 @@ tests/cases/compiler/qualify.ts(45,13): error TS2322: Type 'I4' is not assignabl tests/cases/compiler/qualify.ts(46,13): error TS2322: Type 'I4' is not assignable to type 'I3[]'. Property 'length' is missing in type 'I4'. tests/cases/compiler/qualify.ts(47,13): error TS2322: Type 'I4' is not assignable to type '() => I3'. + Signature '(): I3' has no corresponding signature in 'I4' tests/cases/compiler/qualify.ts(48,13): error TS2322: Type 'I4' is not assignable to type '(k: I3) => void'. + Signature '(k: I3): void' has no corresponding signature in 'I4' tests/cases/compiler/qualify.ts(49,13): error TS2322: Type 'I4' is not assignable to type '{ k: I3; }'. Property 'k' is missing in type 'I4'. tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable to type 'T.I'. @@ -76,9 +78,11 @@ tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable var v4:()=>K1.I3=v1; ~~ !!! error TS2322: Type 'I4' is not assignable to type '() => I3'. +!!! error TS2322: Signature '(): I3' has no corresponding signature in 'I4' var v5:(k:K1.I3)=>void=v1; ~~ !!! error TS2322: Type 'I4' is not assignable to type '(k: I3) => void'. +!!! error TS2322: Signature '(k: I3): void' has no corresponding signature in 'I4' var v6:{k:K1.I3;}=v1; ~~ !!! error TS2322: Type 'I4' is not assignable to type '{ k: I3; }'. diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt index 8d5303c0669..9bc82f92ff3 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.errors.txt +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -1,23 +1,30 @@ tests/cases/compiler/recursiveFunctionTypes.ts(1,35): error TS2322: Type 'number' is not assignable to type '() => typeof fn'. + Signature '(): () => typeof fn' has no corresponding signature in 'Number' tests/cases/compiler/recursiveFunctionTypes.ts(3,5): error TS2322: Type '() => typeof fn' is not assignable to type 'number'. tests/cases/compiler/recursiveFunctionTypes.ts(4,5): error TS2322: Type '() => typeof fn' is not assignable to type '() => number'. - Type '() => typeof fn' is not assignable to type 'number'. + Signature '(): number' has no corresponding signature in '() => typeof fn' + Type '() => typeof fn' is not assignable to type 'number'. tests/cases/compiler/recursiveFunctionTypes.ts(11,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/compiler/recursiveFunctionTypes.ts(12,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/compiler/recursiveFunctionTypes.ts(17,5): error TS2322: Type '() => I' is not assignable to type 'number'. tests/cases/compiler/recursiveFunctionTypes.ts(22,5): error TS2345: Argument of type 'number' is not assignable to parameter of type '(t: typeof g) => void'. + Signature '(t: (t: typeof g) => void): void' has no corresponding signature in 'Number' tests/cases/compiler/recursiveFunctionTypes.ts(25,1): error TS2322: Type 'number' is not assignable to type '() => any'. + Signature '(): () => any' has no corresponding signature in 'Number' tests/cases/compiler/recursiveFunctionTypes.ts(30,10): error TS2394: Overload signature is not compatible with function implementation. tests/cases/compiler/recursiveFunctionTypes.ts(33,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/recursiveFunctionTypes.ts(34,4): error TS2345: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. + Signature '(): { (): typeof f6; (a: typeof f6): () => number; }' has no corresponding signature in 'String' tests/cases/compiler/recursiveFunctionTypes.ts(42,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. + Signature '(): { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }' has no corresponding signature in 'String' ==== tests/cases/compiler/recursiveFunctionTypes.ts (13 errors) ==== function fn(): typeof fn { return 1; } ~ !!! error TS2322: Type 'number' is not assignable to type '() => typeof fn'. +!!! error TS2322: Signature '(): () => typeof fn' has no corresponding signature in 'Number' var x: number = fn; // error ~ @@ -25,7 +32,8 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of var y: () => number = fn; // ok ~ !!! error TS2322: Type '() => typeof fn' is not assignable to type '() => number'. -!!! error TS2322: Type '() => typeof fn' is not assignable to type 'number'. +!!! error TS2322: Signature '(): number' has no corresponding signature in '() => typeof fn' +!!! error TS2322: Type '() => typeof fn' is not assignable to type 'number'. var f: () => typeof g; var g: () => typeof f; @@ -52,11 +60,13 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of C.g(3); // error ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type '(t: typeof g) => void'. +!!! error TS2345: Signature '(t: (t: typeof g) => void): void' has no corresponding signature in 'Number' var f4: () => typeof f4; f4 = 3; // error ~~ !!! error TS2322: Type 'number' is not assignable to type '() => any'. +!!! error TS2322: Signature '(): () => any' has no corresponding signature in 'Number' function f5() { return f5; } @@ -72,6 +82,7 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of f6(""); // ok (function takes an any param) ~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. +!!! error TS2345: Signature '(): { (): typeof f6; (a: typeof f6): () => number; }' has no corresponding signature in 'String' f6(); // ok declare function f7(): typeof f7; @@ -85,4 +96,5 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of f7(""); // ok (function takes an any param) ~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. +!!! error TS2345: Signature '(): { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }' has no corresponding signature in 'String' f7(); // ok \ No newline at end of file diff --git a/tests/baselines/reference/requiredInitializedParameter2.errors.txt b/tests/baselines/reference/requiredInitializedParameter2.errors.txt index 5dcec536e1b..493f9e49f23 100644 --- a/tests/baselines/reference/requiredInitializedParameter2.errors.txt +++ b/tests/baselines/reference/requiredInitializedParameter2.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/requiredInitializedParameter2.ts(5,7): error TS2420: Class 'C1' incorrectly implements interface 'I1'. Types of property 'method' are incompatible. Type '(a: number, b: any) => void' is not assignable to type '() => any'. + Signature '(): any' has no corresponding signature in '(a: number, b: any) => void' ==== tests/cases/compiler/requiredInitializedParameter2.ts (1 errors) ==== @@ -13,5 +14,6 @@ tests/cases/compiler/requiredInitializedParameter2.ts(5,7): error TS2420: Class !!! error TS2420: Class 'C1' incorrectly implements interface 'I1'. !!! error TS2420: Types of property 'method' are incompatible. !!! error TS2420: Type '(a: number, b: any) => void' is not assignable to type '() => any'. +!!! error TS2420: Signature '(): any' has no corresponding signature in '(a: number, b: any) => void' method(a = 0, b) { } } \ No newline at end of file diff --git a/tests/baselines/reference/restArgAssignmentCompat.errors.txt b/tests/baselines/reference/restArgAssignmentCompat.errors.txt index 2ea07395099..cf6c70b58f3 100644 --- a/tests/baselines/reference/restArgAssignmentCompat.errors.txt +++ b/tests/baselines/reference/restArgAssignmentCompat.errors.txt @@ -1,7 +1,8 @@ tests/cases/compiler/restArgAssignmentCompat.ts(7,1): error TS2322: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void'. - Types of parameters 'x' and 'x' are incompatible. - Type 'number' is not assignable to type 'number[]'. - Property 'length' is missing in type 'Number'. + Signature '(x: number[], y: string): void' has no corresponding signature in '(...x: number[]) => void' + Types of parameters 'x' and 'x' are incompatible. + Type 'number' is not assignable to type 'number[]'. + Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/restArgAssignmentCompat.ts (1 errors) ==== @@ -14,8 +15,9 @@ tests/cases/compiler/restArgAssignmentCompat.ts(7,1): error TS2322: Type '(...x: n = f; ~ !!! error TS2322: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'number[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. +!!! error TS2322: Signature '(x: number[], y: string): void' has no corresponding signature in '(...x: number[]) => void' +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'number[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. n([4], 'foo'); \ No newline at end of file diff --git a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt index db23c2a19f6..f490027f870 100644 --- a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt +++ b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt @@ -1,5 +1,6 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/staticMemberAssignsToConstructorFunctionMembers.ts(7,9): error TS2322: Type '() => void' is not assignable to type '(x: number) => number'. - Type 'void' is not assignable to type 'number'. + Signature '(x: number): number' has no corresponding signature in '() => void' + Type 'void' is not assignable to type 'number'. ==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/staticMemberAssignsToConstructorFunctionMembers.ts (1 errors) ==== @@ -12,7 +13,8 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclara C.bar = () => { } // error ~~~~~ !!! error TS2322: Type '() => void' is not assignable to type '(x: number) => number'. -!!! error TS2322: Type 'void' is not assignable to type 'number'. +!!! error TS2322: Signature '(x: number): number' has no corresponding signature in '() => void' +!!! error TS2322: Type 'void' is not assignable to type 'number'. C.bar = (x) => x; // ok C.bar = (x: number) => 1; // ok return 1; diff --git a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.errors.txt b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.errors.txt index ed6450ad329..aee87f77764 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.errors.txt +++ b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.errors.txt @@ -1,5 +1,6 @@ tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterConstraint02.ts(6,13): error TS2345: Argument of type '(y: "foo" | "bar") => string' is not assignable to parameter of type '(x: "foo") => "foo"'. - Type 'string' is not assignable to type '"foo"'. + Signature '(x: "foo"): "foo"' has no corresponding signature in '(y: "foo" | "bar") => string' + Type 'string' is not assignable to type '"foo"'. ==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterConstraint02.ts (1 errors) ==== @@ -11,5 +12,6 @@ tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterCon let f = foo((y: "foo" | "bar") => y === "foo" ? y : "foo"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(y: "foo" | "bar") => string' is not assignable to parameter of type '(x: "foo") => "foo"'. -!!! error TS2345: Type 'string' is not assignable to type '"foo"'. +!!! error TS2345: Signature '(x: "foo"): "foo"' has no corresponding signature in '(y: "foo" | "bar") => string' +!!! error TS2345: Type 'string' is not assignable to type '"foo"'. let fResult = f("foo"); \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithCallSignaturesA.errors.txt b/tests/baselines/reference/subtypingWithCallSignaturesA.errors.txt index 3821c707f4b..24caddf4849 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesA.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesA.errors.txt @@ -1,5 +1,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesA.ts(2,15): error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => number'. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): number' has no corresponding signature in '(x: number) => string' + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesA.ts (1 errors) ==== @@ -7,4 +8,5 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW var r5 = foo3((x: number) => ''); // error ~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => number'. -!!! error TS2345: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2345: Signature '(x: number): number' has no corresponding signature in '(x: number) => string' +!!! error TS2345: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt index b5d23da2241..1ae866d4722 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'. + Signature '(): number' has no corresponding signature in '(x: number) => 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'. + Signature '(x: number): number' has no corresponding signature in '(x: number, y: 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: Signature '(): number' has no corresponding signature in '(x: number) => 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: Signature '(x: number): number' has no corresponding signature in '(x: number, y: number) => number' a3: (x: number, y: number) => number; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithCallSignaturesWithRestParameters.errors.txt b/tests/baselines/reference/subtypingWithCallSignaturesWithRestParameters.errors.txt index f4a141ff390..aee119d6f73 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesWithRestParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesWithRestParameters.errors.txt @@ -1,58 +1,69 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(18,11): error TS2430: Interface 'I1C' incorrectly extends interface 'Base'. Types of property 'a' are incompatible. Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. - Types of parameters 'args' and 'args' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(...args: number[]): number' has no corresponding signature in '(...args: string[]) => number' + Types of parameters 'args' and 'args' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(34,11): error TS2430: Interface 'I3B' incorrectly extends interface 'Base'. Types of property 'a' are incompatible. Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. - Types of parameters 'x' and 'args' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(...args: number[]): number' has no corresponding signature in '(x?: string) => number' + Types of parameters 'x' and 'args' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(60,11): error TS2430: Interface 'I6C' incorrectly extends interface 'Base'. Types of property 'a2' are incompatible. Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. - Types of parameters 'args' and 'z' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number, ...z: number[]): number' has no corresponding signature in '(x: number, ...args: string[]) => number' + Types of parameters 'args' and 'z' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(90,11): error TS2430: Interface 'I10B' incorrectly extends interface 'Base'. Types of property 'a3' are incompatible. Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. - Types of parameters 'y' and 'y' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, y?: number, z?: number) => number' + Types of parameters 'y' and 'y' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(94,11): error TS2430: Interface 'I10C' incorrectly extends interface 'Base'. Types of property 'a3' are incompatible. Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. - Types of parameters 'z' and 'y' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, ...z: number[]) => number' + Types of parameters 'z' and 'y' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(98,11): error TS2430: Interface 'I10D' incorrectly extends interface 'Base'. Types of property 'a3' are incompatible. Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: string, y?: string, z?: string) => number' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(102,11): error TS2430: Interface 'I10E' incorrectly extends interface 'Base'. Types of property 'a3' are incompatible. Type '(x: number, ...z: string[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. - Types of parameters 'z' and 'z' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, ...z: string[]) => number' + Types of parameters 'z' and 'z' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(110,11): error TS2430: Interface 'I12' incorrectly extends interface 'Base'. Types of property 'a4' are incompatible. Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. - Types of parameters 'y' and 'y' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x?: number, y?: number) => number' + Types of parameters 'y' and 'y' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(118,11): error TS2430: Interface 'I14' incorrectly extends interface 'Base'. Types of property 'a4' are incompatible. Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. - Types of parameters 'y' and 'y' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, y?: number) => number' + Types of parameters 'y' and 'y' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(126,11): error TS2430: Interface 'I16' incorrectly extends interface 'Base'. Types of property 'a4' are incompatible. Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. - Types of parameters 'args' and 'z' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, ...args: string[]) => number' + Types of parameters 'args' and 'z' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(130,11): error TS2430: Interface 'I17' incorrectly extends interface 'Base'. Types of property 'a4' are incompatible. Type '(...args: number[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. - Types of parameters 'args' and 'y' are incompatible. - Type 'number' is not assignable to type 'string'. + Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(...args: number[]) => number' + Types of parameters 'args' and 'y' are incompatible. + Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts (11 errors) ==== @@ -78,8 +89,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I1C' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. -!!! error TS2430: Types of parameters 'args' and 'args' are incompatible. -!!! error TS2430: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Signature '(...args: number[]): number' has no corresponding signature in '(...args: string[]) => number' +!!! error TS2430: Types of parameters 'args' and 'args' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. a: (...args: string[]) => number; // error, type mismatch } @@ -100,8 +112,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I3B' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. -!!! error TS2430: Types of parameters 'x' and 'args' are incompatible. -!!! error TS2430: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Signature '(...args: number[]): number' has no corresponding signature in '(x?: string) => number' +!!! error TS2430: Types of parameters 'x' and 'args' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. a: (x?: string) => number; // error, incompatible type } @@ -132,8 +145,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I6C' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a2' are incompatible. !!! error TS2430: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. -!!! error TS2430: Types of parameters 'args' and 'z' are incompatible. -!!! error TS2430: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Signature '(x: number, ...z: number[]): number' has no corresponding signature in '(x: number, ...args: string[]) => number' +!!! error TS2430: Types of parameters 'args' and 'z' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. a2: (x: number, ...args: string[]) => number; // error } @@ -168,8 +182,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10B' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. -!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2430: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, y?: number, z?: number) => number' +!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a3: (x: number, y?: number, z?: number) => number; // error } @@ -178,8 +193,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10C' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. -!!! error TS2430: Types of parameters 'z' and 'y' are incompatible. -!!! error TS2430: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, ...z: number[]) => number' +!!! error TS2430: Types of parameters 'z' and 'y' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a3: (x: number, ...z: number[]) => number; // error } @@ -188,8 +204,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10D' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. -!!! error TS2430: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2430: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: string, y?: string, z?: string) => number' +!!! error TS2430: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. a3: (x: string, y?: string, z?: string) => number; // error, incompatible types } @@ -198,8 +215,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I10E' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a3' are incompatible. !!! error TS2430: Type '(x: number, ...z: string[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. -!!! error TS2430: Types of parameters 'z' and 'z' are incompatible. -!!! error TS2430: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, ...z: string[]) => number' +!!! error TS2430: Types of parameters 'z' and 'z' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. a3: (x: number, ...z: string[]) => number; // error } @@ -212,8 +230,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I12' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a4' are incompatible. !!! error TS2430: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. -!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2430: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x?: number, y?: number) => number' +!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a4: (x?: number, y?: number) => number; // error, type mismatch } @@ -226,8 +245,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I14' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a4' are incompatible. !!! error TS2430: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. -!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2430: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, y?: number) => number' +!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a4: (x: number, y?: number) => number; // error, second param has type mismatch } @@ -240,8 +260,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I16' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a4' are incompatible. !!! error TS2430: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. -!!! error TS2430: Types of parameters 'args' and 'z' are incompatible. -!!! error TS2430: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, ...args: string[]) => number' +!!! error TS2430: Types of parameters 'args' and 'z' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. a4: (x: number, ...args: string[]) => number; // error, rest param has type mismatch } @@ -250,8 +271,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I17' incorrectly extends interface 'Base'. !!! error TS2430: Types of property 'a4' are incompatible. !!! error TS2430: Type '(...args: number[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. -!!! error TS2430: Types of parameters 'args' and 'y' are incompatible. -!!! error TS2430: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(...args: number[]) => number' +!!! error TS2430: Types of parameters 'args' and 'y' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a4: (...args: number[]) => number; // error } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt b/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt index da742fcd69c..54eec881c14 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt @@ -1,7 +1,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithSpecializedSignatures.ts(70,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. Type '(x: string) => string' is not assignable to type '{ (x: "a"): number; (x: string): number; }'. - Type 'string' is not assignable to type 'number'. + Signature '(x: string): number' has no corresponding signature in '(x: string) => string' + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithSpecializedSignatures.ts (1 errors) ==== @@ -79,7 +80,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type '(x: string) => string' is not assignable to type '{ (x: "a"): number; (x: string): number; }'. -!!! error TS2430: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Signature '(x: string): number' has no corresponding signature in '(x: string) => string' +!!! error TS2430: Type 'string' is not assignable to type 'number'. // N's a: (x: string) => string; // error because base returns non-void; } diff --git a/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt index e041b1cdce0..a30feba51c9 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'. + Signature 'new (): number' has no corresponding signature in 'new (x: number) => 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'. + Signature 'new (x: number): number' has no corresponding signature in 'new (x: number, y: 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: Signature 'new (): number' has no corresponding signature in 'new (x: number) => 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: Signature 'new (x: number): number' has no corresponding signature in 'new (x: number, y: number) => number' a3: new (x: number, y: number) => number; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt b/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt index 8a885a2455f..fd9e6faa9ec 100644 --- a/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt +++ b/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt @@ -1,7 +1,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithSpecializedSignatures.ts(70,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. Type 'new (x: string) => string' is not assignable to type '{ new (x: "a"): number; new (x: string): number; }'. - Type 'string' is not assignable to type 'number'. + Signature 'new (x: string): number' has no corresponding signature in 'new (x: string) => string' + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithSpecializedSignatures.ts (1 errors) ==== @@ -79,7 +80,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. !!! error TS2430: Types of property 'a' are incompatible. !!! error TS2430: Type 'new (x: string) => string' is not assignable to type '{ new (x: "a"): number; new (x: string): number; }'. -!!! error TS2430: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Signature 'new (x: string): number' has no corresponding signature in 'new (x: string) => string' +!!! error TS2430: Type 'string' is not assignable to type 'number'. // N's a: new (x: string) => string; // error because base returns non-void; } diff --git a/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt index e8f50236cba..316b5713835 100644 --- a/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt @@ -1,21 +1,27 @@ 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'. + Signature '(): T' has no corresponding signature in '(x: T) => 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'. + Signature '(x: T): T' has no corresponding signature in '(x: T, y: T) => T' 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'. + Signature '(): T' has no corresponding signature in '(x: T) => T' 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'. + Signature '(x: T): T' has no corresponding signature in '(x: T, y: T) => T' 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'. + Signature '(): T' has no corresponding signature in '(x: T) => 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'. + Signature '(x: T): T' has no corresponding signature in '(x: T, y: T) => T' ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts (6 errors) ==== @@ -43,6 +49,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: Signature '(): T' has no corresponding signature in '(x: T) => T' a: (x: T) => T; // error, too many required params } @@ -77,6 +84,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: Signature '(x: T): T' has no corresponding signature in '(x: T, y: T) => T' a3: (x: T, y: T) => T; // error, too many required params } @@ -139,6 +147,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: Signature '(): T' has no corresponding signature in '(x: T) => T' a: (x: T) => T; } @@ -173,6 +182,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: Signature '(x: T): T' has no corresponding signature in '(x: T, y: T) => T' a3: (x: T, y: T) => T; } @@ -235,6 +245,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: Signature '(): T' has no corresponding signature in '(x: T) => T' a: (x: T) => T; // error, not identical and contextual signature instatiation can't make inference from T to T } @@ -269,6 +280,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: Signature '(x: T): T' has no corresponding signature in '(x: T, y: 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 27066058238..66dd34f9cb6 100644 --- a/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt @@ -1,21 +1,27 @@ 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'. + Signature 'new (): T' has no corresponding signature in 'new (x: T) => 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'. + Signature 'new (x: T): T' has no corresponding signature in 'new (x: T, y: T) => T' 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'. + Signature 'new (): T' has no corresponding signature in 'new (x: T) => T' 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'. + Signature 'new (x: T): T' has no corresponding signature in 'new (x: T, y: T) => T' 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'. + Signature 'new (): T' has no corresponding signature in 'new (x: T) => 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'. + Signature 'new (x: T): T' has no corresponding signature in 'new (x: T, y: T) => T' ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts (6 errors) ==== @@ -43,6 +49,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: Signature 'new (): T' has no corresponding signature in 'new (x: T) => T' a: new (x: T) => T; // error, too many required params } @@ -77,6 +84,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: Signature 'new (x: T): T' has no corresponding signature in 'new (x: T, y: T) => T' a3: new (x: T, y: T) => T; // error, too many required params } @@ -139,6 +147,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: Signature 'new (): T' has no corresponding signature in 'new (x: T) => T' a: new (x: T) => T; } @@ -173,6 +182,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: Signature 'new (x: T): T' has no corresponding signature in 'new (x: T, y: T) => T' a3: new (x: T, y: T) => T; } @@ -235,6 +245,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: Signature 'new (): T' has no corresponding signature in 'new (x: T) => T' a: new (x: T) => T; // error, not identical and contextual signature instatiation can't make inference from T to T } @@ -269,6 +280,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: Signature 'new (x: T): T' has no corresponding signature in 'new (x: T, y: T) => T' a3: new (x: T, y: T) => T; // error, too many required params } diff --git a/tests/baselines/reference/symbolProperty24.errors.txt b/tests/baselines/reference/symbolProperty24.errors.txt index 25cba184e25..58ff17544f9 100644 --- a/tests/baselines/reference/symbolProperty24.errors.txt +++ b/tests/baselines/reference/symbolProperty24.errors.txt @@ -1,7 +1,8 @@ tests/cases/conformance/es6/Symbols/symbolProperty24.ts(5,7): error TS2420: Class 'C' incorrectly implements interface 'I'. Types of property '[Symbol.toPrimitive]' are incompatible. Type '() => string' is not assignable to type '() => boolean'. - Type 'string' is not assignable to type 'boolean'. + Signature '(): boolean' has no corresponding signature in '() => string' + Type 'string' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/Symbols/symbolProperty24.ts (1 errors) ==== @@ -14,7 +15,8 @@ tests/cases/conformance/es6/Symbols/symbolProperty24.ts(5,7): error TS2420: Clas !!! error TS2420: Class 'C' incorrectly implements interface 'I'. !!! error TS2420: Types of property '[Symbol.toPrimitive]' are incompatible. !!! error TS2420: Type '() => string' is not assignable to type '() => boolean'. -!!! error TS2420: Type 'string' is not assignable to type 'boolean'. +!!! error TS2420: Signature '(): boolean' has no corresponding signature in '() => string' +!!! error TS2420: Type 'string' is not assignable to type 'boolean'. [Symbol.toPrimitive]() { return ""; } diff --git a/tests/baselines/reference/targetTypeVoidFunc.errors.txt b/tests/baselines/reference/targetTypeVoidFunc.errors.txt index f9434c1d630..daa25885729 100644 --- a/tests/baselines/reference/targetTypeVoidFunc.errors.txt +++ b/tests/baselines/reference/targetTypeVoidFunc.errors.txt @@ -1,4 +1,5 @@ tests/cases/compiler/targetTypeVoidFunc.ts(2,12): error TS2322: Type '() => void' is not assignable to type 'new () => number'. + Signature 'new (): number' has no corresponding signature in '() => void' ==== tests/cases/compiler/targetTypeVoidFunc.ts (1 errors) ==== @@ -6,6 +7,7 @@ tests/cases/compiler/targetTypeVoidFunc.ts(2,12): error TS2322: Type '() => void return function () { return; } ~~~~~~~~ !!! error TS2322: Type '() => void' is not assignable to type 'new () => number'. +!!! error TS2322: Signature 'new (): number' has no corresponding signature in '() => void' }; var x = f1(); diff --git a/tests/baselines/reference/tupleTypes.errors.txt b/tests/baselines/reference/tupleTypes.errors.txt index 8f418f98157..c1ef7f59454 100644 --- a/tests/baselines/reference/tupleTypes.errors.txt +++ b/tests/baselines/reference/tupleTypes.errors.txt @@ -10,13 +10,15 @@ tests/cases/compiler/tupleTypes.ts(41,1): error TS2322: Type 'undefined[]' is no tests/cases/compiler/tupleTypes.ts(47,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]'. Types of property 'pop' are incompatible. Type '() => number | string' is not assignable to type '() => number'. - Type 'number | string' is not assignable to type 'number'. - Type 'string' is not assignable to type 'number'. + Signature '(): number' has no corresponding signature in '() => number | string' + Type 'number | string' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/tupleTypes.ts(49,1): error TS2322: Type '[number, {}]' is not assignable to type 'number[]'. Types of property 'pop' are incompatible. Type '() => number | {}' is not assignable to type '() => number'. - Type 'number | {}' is not assignable to type 'number'. - Type '{}' is not assignable to type 'number'. + Signature '(): number' has no corresponding signature in '() => number | {}' + Type 'number | {}' is not assignable to type 'number'. + Type '{}' is not assignable to type 'number'. tests/cases/compiler/tupleTypes.ts(50,1): error TS2322: Type '[number, number]' is not assignable to type '[number, string]'. Types of property '1' are incompatible. Type 'number' is not assignable to type 'string'. @@ -91,16 +93,18 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n !!! error TS2322: Type '[number, string]' is not assignable to type 'number[]'. !!! error TS2322: Types of property 'pop' are incompatible. !!! error TS2322: Type '() => number | string' is not assignable to type '() => number'. -!!! error TS2322: Type 'number | string' is not assignable to type 'number'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Signature '(): number' has no corresponding signature in '() => number | string' +!!! error TS2322: Type 'number | string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = a2; a = a3; // Error ~ !!! error TS2322: Type '[number, {}]' is not assignable to type 'number[]'. !!! error TS2322: Types of property 'pop' are incompatible. !!! error TS2322: Type '() => number | {}' is not assignable to type '() => number'. -!!! error TS2322: Type 'number | {}' is not assignable to type 'number'. -!!! error TS2322: Type '{}' is not assignable to type 'number'. +!!! error TS2322: Signature '(): number' has no corresponding signature in '() => number | {}' +!!! error TS2322: Type 'number | {}' is not assignable to type 'number'. +!!! error TS2322: Type '{}' is not assignable to type 'number'. a1 = a2; // Error ~~ !!! error TS2322: Type '[number, number]' is not assignable to type '[number, string]'. diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt index d058426b9c9..ecfb70a7776 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt @@ -1,14 +1,17 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(25,35): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(51,19): error TS2304: Cannot find name 'Window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(61,39): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x: string) => string' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(71,39): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x: string) => string' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(81,45): error TS2345: Argument of type '(n: string) => string' is not assignable to parameter of type '(b: number) => number'. - Types of parameters 'n' and 'b' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(b: number): number' has no corresponding signature in '(n: string) => string' + Types of parameters 'n' and 'b' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(106,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(118,9): error TS2304: Cannot find name 'Window'. @@ -89,8 +92,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct new someGenerics4('', (x: string) => ''); // Error ~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. -!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2345: Signature '(x: number): void' has no corresponding signature in '(x: string) => string' +!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'number'. new someGenerics4(null, null); // 2 parameter generic call with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type @@ -103,8 +107,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct new someGenerics5('', (x: string) => ''); // Error ~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. -!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2345: Signature '(x: number): void' has no corresponding signature in '(x: string) => string' +!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'number'. new someGenerics5(null, null); // Generic call with multiple arguments of function types that each have parameters of the same generic type @@ -117,8 +122,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct new someGenerics6((n: number) => n, (n: string) => n, (n: number) => n); // Error ~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(n: string) => string' is not assignable to parameter of type '(b: number) => number'. -!!! error TS2345: Types of parameters 'n' and 'b' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2345: Signature '(b: number): number' has no corresponding signature in '(n: string) => string' +!!! error TS2345: Types of parameters 'n' and 'b' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'number'. new someGenerics6((n: number) => n, (n: number) => n, (n: number) => n); // Generic call with multiple arguments of function types that each have parameters of different generic type diff --git a/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt b/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt index 9bd25dda4e6..dd9e29b7c31 100644 --- a/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt @@ -1,13 +1,16 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts(3,31): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts(7,35): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x: string) => string' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts(11,35): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x: string) => string' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts(15,41): error TS2345: Argument of type '(n: string) => string' is not assignable to parameter of type '(b: number) => number'. - Types of parameters 'n' and 'b' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(b: number): number' has no corresponding signature in '(n: string) => string' + Types of parameters 'n' and 'b' are incompatible. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts (4 errors) ==== @@ -22,22 +25,25 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts someGenerics4('', (x: string) => ''); // Error ~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. -!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2345: Signature '(x: number): void' has no corresponding signature in '(x: string) => string' +!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'number'. // 2 parameter generic call with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type function someGenerics5(n: T, f: (x: U) => void) { } someGenerics5('', (x: string) => ''); // Error ~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. -!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2345: Signature '(x: number): void' has no corresponding signature in '(x: string) => string' +!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'number'. // Generic call with multiple arguments of function types that each have parameters of the same generic type function someGenerics6(a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { } someGenerics6((n: number) => n, (n: string) => n, (n: number) => n); // Error ~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(n: string) => string' is not assignable to parameter of type '(b: number) => number'. -!!! error TS2345: Types of parameters 'n' and 'b' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2345: Signature '(b: number): number' has no corresponding signature in '(n: string) => string' +!!! error TS2345: Types of parameters 'n' and 'b' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.errors.txt index eb74ff0ade0..e949a0a2fd8 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.errors.txt @@ -1,6 +1,7 @@ tests/cases/conformance/es6/classExpressions/typeArgumentInferenceWithClassExpression2.ts(6,5): error TS2345: Argument of type 'typeof (Anonymous class)' is not assignable to parameter of type 'typeof (Anonymous class)'. - Type '(Anonymous class)' is not assignable to type 'foo<{}>.(Anonymous class)'. - Property 'prop' is missing in type '(Anonymous class)'. + Signature 'new (): foo<{}>.(Anonymous class)' has no corresponding signature in 'typeof (Anonymous class)' + Type '(Anonymous class)' is not assignable to type 'foo<{}>.(Anonymous class)'. + Property 'prop' is missing in type '(Anonymous class)'. ==== tests/cases/conformance/es6/classExpressions/typeArgumentInferenceWithClassExpression2.ts (1 errors) ==== @@ -12,5 +13,6 @@ tests/cases/conformance/es6/classExpressions/typeArgumentInferenceWithClassExpre foo(class { static prop = "hello" }).length; ~~~~~ !!! error TS2345: Argument of type 'typeof (Anonymous class)' is not assignable to parameter of type 'typeof (Anonymous class)'. -!!! error TS2345: Type '(Anonymous class)' is not assignable to type 'foo<{}>.(Anonymous class)'. -!!! error TS2345: Property 'prop' is missing in type '(Anonymous class)'. \ No newline at end of file +!!! error TS2345: Signature 'new (): foo<{}>.(Anonymous class)' has no corresponding signature in 'typeof (Anonymous class)' +!!! error TS2345: Type '(Anonymous class)' is not assignable to type 'foo<{}>.(Anonymous class)'. +!!! error TS2345: Property 'prop' is missing in type '(Anonymous class)'. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt index 0c1e8cc4e97..3f0390ec46a 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt @@ -4,15 +4,18 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(32,34): error TS2304: Cannot find name 'Window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(34,15): error TS2304: Cannot find name 'Window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(41,35): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x: string) => string' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(48,35): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. - Types of parameters 'x' and 'x' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(x: number): void' has no corresponding signature in '(x: string) => string' + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(49,15): error TS2344: Type 'string' does not satisfy the constraint 'number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(55,41): error TS2345: Argument of type '(n: string) => string' is not assignable to parameter of type '(b: number) => number'. - Types of parameters 'n' and 'b' are incompatible. - Type 'string' is not assignable to type 'number'. + Signature '(b: number): number' has no corresponding signature in '(n: string) => string' + Types of parameters 'n' and 'b' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(66,31): error TS2345: Argument of type '(a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) => void' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(73,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. @@ -80,8 +83,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst someGenerics4('', (x: string) => ''); // Error ~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. -!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2345: Signature '(x: number): void' has no corresponding signature in '(x: string) => string' +!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'number'. someGenerics4(null, null); // 2 parameter generic call with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type @@ -91,8 +95,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst someGenerics5('', (x: string) => ''); // Error ~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. -!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2345: Signature '(x: number): void' has no corresponding signature in '(x: string) => string' +!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'number'. someGenerics5(null, null); // Error ~~~~~~ !!! error TS2344: Type 'string' does not satisfy the constraint 'number'. @@ -104,8 +109,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst someGenerics6((n: number) => n, (n: string) => n, (n: number) => n); // Error ~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(n: string) => string' is not assignable to parameter of type '(b: number) => number'. -!!! error TS2345: Types of parameters 'n' and 'b' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2345: Signature '(b: number): number' has no corresponding signature in '(n: string) => string' +!!! error TS2345: Types of parameters 'n' and 'b' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'number'. someGenerics6((n: number) => n, (n: number) => n, (n: number) => n); // Generic call with multiple arguments of function types that each have parameters of different generic type diff --git a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt index 92d9d21f0cc..fb17775bc31 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt +++ b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt @@ -14,14 +14,18 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(60,7): tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(65,7): error TS2339: Property 'propB' does not exist on type 'A'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(70,7): error TS2339: Property 'propB' does not exist on type 'A'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(75,46): error TS2345: Argument of type '(p1: any) => p1 is C' is not assignable to parameter of type '(p1: any) => p1 is B'. - Type predicate 'p1 is C' is not assignable to 'p1 is B'. - Type 'C' is not assignable to type 'B'. + Signature '(p1: any): p1 is B' has no corresponding signature in '(p1: any) => p1 is C' + Type predicate 'p1 is C' is not assignable to 'p1 is B'. + Type 'C' is not assignable to type 'B'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(79,1): error TS2322: Type '(p1: any, p2: any) => boolean' is not assignable to type '(p1: any, p2: any) => p1 is A'. - Signature '(p1: any, p2: any): boolean' must have a type predicate. + Signature '(p1: any, p2: any): p1 is A' has no corresponding signature in '(p1: any, p2: any) => boolean' + Signature '(p1: any, p2: any): boolean' must have a type predicate. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(85,1): error TS2322: Type '(p1: any, p2: any) => p2 is A' is not assignable to type '(p1: any, p2: any) => p1 is A'. - Type predicate 'p2 is A' is not assignable to 'p1 is A'. - Parameter 'p2' is not in the same position as parameter 'p1'. + Signature '(p1: any, p2: any): p1 is A' has no corresponding signature in '(p1: any, p2: any) => p2 is A' + 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(91,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'. + Signature '(p1: any, p2: any): p1 is A' has no corresponding signature in '(p1: any, p2: any, p3: any) => p1 is A' tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(96,9): error TS1228: A type predicate is only allowed in return type position for functions and methods. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(97,16): error TS1228: A type predicate is only allowed in return type position for functions and methods. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(98,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. @@ -147,15 +151,17 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(137,39 acceptingDifferentSignatureTypeGuardFunction(isC); ~~~ !!! error TS2345: Argument of type '(p1: any) => p1 is C' is not assignable to parameter of type '(p1: any) => p1 is B'. -!!! error TS2345: Type predicate 'p1 is C' is not assignable to 'p1 is B'. -!!! error TS2345: Type 'C' is not assignable to type 'B'. +!!! error TS2345: Signature '(p1: any): p1 is B' has no corresponding signature in '(p1: any) => p1 is C' +!!! error TS2345: Type predicate 'p1 is C' is not assignable to 'p1 is B'. +!!! error TS2345: Type 'C' is not assignable to type 'B'. // Boolean not assignable to type guard var assign1: (p1, p2) => p1 is A; assign1 = function(p1, p2): boolean { ~~~~~~~ !!! error TS2322: Type '(p1: any, p2: any) => boolean' is not assignable to type '(p1: any, p2: any) => p1 is A'. -!!! error TS2322: Signature '(p1: any, p2: any): boolean' must have a type predicate. +!!! error TS2322: Signature '(p1: any, p2: any): p1 is A' has no corresponding signature in '(p1: any, p2: any) => boolean' +!!! error TS2322: Signature '(p1: any, p2: any): boolean' must have a type predicate. return true; }; @@ -164,8 +170,9 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(137,39 assign2 = function(p1, p2): p2 is A { ~~~~~~~ !!! error TS2322: Type '(p1: any, p2: any) => p2 is A' is not assignable to type '(p1: any, p2: any) => p1 is A'. -!!! error TS2322: Type predicate 'p2 is A' is not assignable to 'p1 is A'. -!!! error TS2322: Parameter 'p2' is not in the same position as parameter 'p1'. +!!! error TS2322: Signature '(p1: any, p2: any): p1 is A' has no corresponding signature in '(p1: any, p2: any) => p2 is A' +!!! error TS2322: Type predicate 'p2 is A' is not assignable to 'p1 is A'. +!!! error TS2322: Parameter 'p2' is not in the same position as parameter 'p1'. return true; }; @@ -174,6 +181,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(137,39 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: Signature '(p1: any, p2: any): p1 is A' has no corresponding signature in '(p1: any, p2: any, p3: any) => p1 is A' return true; }; diff --git a/tests/baselines/reference/typeName1.errors.txt b/tests/baselines/reference/typeName1.errors.txt index 84c8be360bd..e77e7c58535 100644 --- a/tests/baselines/reference/typeName1.errors.txt +++ b/tests/baselines/reference/typeName1.errors.txt @@ -3,6 +3,7 @@ tests/cases/compiler/typeName1.ts(9,5): error TS2322: Type 'number' is not assig tests/cases/compiler/typeName1.ts(10,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }'. Property 'f' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(11,5): error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. + Signature '(s: string): number' has no corresponding signature in 'Number' tests/cases/compiler/typeName1.ts(12,5): error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. Property 'x' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(13,5): error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. @@ -10,6 +11,7 @@ tests/cases/compiler/typeName1.ts(13,5): error TS2322: Type 'number' is not assi tests/cases/compiler/typeName1.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. Property 'z' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(15,5): error TS2322: Type 'number' is not assignable to type '(s: string) => boolean'. + Signature '(s: string): boolean' has no corresponding signature in 'Number' tests/cases/compiler/typeName1.ts(16,5): error TS2322: Type 'number' is not assignable to type '{ (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }'. Property 'z' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(16,10): error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. @@ -49,6 +51,7 @@ tests/cases/compiler/typeName1.ts(23,5): error TS2322: Type 'typeof C' is not as var x3:{ (s:string):number;(n:number):string; }=3; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. +!!! error TS2322: Signature '(s: string): number' has no corresponding signature in 'Number' var x4:{ x;y;z:number;f(n:number):string;f(s:string):number; }=3; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. @@ -64,6 +67,7 @@ tests/cases/compiler/typeName1.ts(23,5): error TS2322: Type 'typeof C' is not as var x7:(s:string)=>boolean=3; ~~ !!! error TS2322: Type 'number' is not assignable to type '(s: string) => boolean'. +!!! error TS2322: Signature '(s: string): boolean' has no corresponding signature in 'Number' var x8:{ z:I;[s:string]:{ x; y; };[n:number]:{x; y;};():boolean; }=3; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }'. diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt index f47266f2850..789820116ba 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt @@ -1,9 +1,11 @@ tests/cases/compiler/typeParameterArgumentEquivalence.ts(4,5): error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: number) => boolean'. - Types of parameters 'item' and 'item' are incompatible. - Type 'T' is not assignable to type 'number'. + Signature '(item: number): boolean' has no corresponding signature in '(item: T) => boolean' + Types of parameters 'item' and 'item' are incompatible. + Type 'T' is not assignable to type 'number'. tests/cases/compiler/typeParameterArgumentEquivalence.ts(5,5): error TS2322: Type '(item: number) => boolean' is not assignable to type '(item: T) => boolean'. - Types of parameters 'item' and 'item' are incompatible. - Type 'number' is not assignable to type 'T'. + Signature '(item: T): boolean' has no corresponding signature in '(item: number) => boolean' + Types of parameters 'item' and 'item' are incompatible. + Type 'number' is not assignable to type 'T'. ==== tests/cases/compiler/typeParameterArgumentEquivalence.ts (2 errors) ==== @@ -13,12 +15,14 @@ tests/cases/compiler/typeParameterArgumentEquivalence.ts(5,5): error TS2322: Typ x = y; // Should be an error ~ !!! error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: number) => boolean'. -!!! error TS2322: Types of parameters 'item' and 'item' are incompatible. -!!! error TS2322: Type 'T' is not assignable to type 'number'. +!!! error TS2322: Signature '(item: number): boolean' has no corresponding signature in '(item: T) => boolean' +!!! error TS2322: Types of parameters 'item' and 'item' are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'number'. y = x; // Shound be an error ~ !!! error TS2322: Type '(item: number) => boolean' is not assignable to type '(item: T) => boolean'. -!!! error TS2322: Types of parameters 'item' and 'item' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'T'. +!!! error TS2322: Signature '(item: T): boolean' has no corresponding signature in '(item: number) => boolean' +!!! error TS2322: Types of parameters 'item' and 'item' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence2.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence2.errors.txt index 2aa8d77ba6d..a50fd533ae6 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence2.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence2.errors.txt @@ -1,9 +1,11 @@ tests/cases/compiler/typeParameterArgumentEquivalence2.ts(4,5): error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: U) => boolean'. - Types of parameters 'item' and 'item' are incompatible. - Type 'T' is not assignable to type 'U'. + Signature '(item: U): boolean' has no corresponding signature in '(item: T) => boolean' + Types of parameters 'item' and 'item' are incompatible. + Type 'T' is not assignable to type 'U'. tests/cases/compiler/typeParameterArgumentEquivalence2.ts(5,5): error TS2322: Type '(item: U) => boolean' is not assignable to type '(item: T) => boolean'. - Types of parameters 'item' and 'item' are incompatible. - Type 'U' is not assignable to type 'T'. + Signature '(item: T): boolean' has no corresponding signature in '(item: U) => boolean' + Types of parameters 'item' and 'item' are incompatible. + Type 'U' is not assignable to type 'T'. ==== tests/cases/compiler/typeParameterArgumentEquivalence2.ts (2 errors) ==== @@ -13,12 +15,14 @@ tests/cases/compiler/typeParameterArgumentEquivalence2.ts(5,5): error TS2322: Ty x = y; // Should be an error ~ !!! error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: U) => boolean'. -!!! error TS2322: Types of parameters 'item' and 'item' are incompatible. -!!! error TS2322: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Signature '(item: U): boolean' has no corresponding signature in '(item: T) => boolean' +!!! error TS2322: Types of parameters 'item' and 'item' are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'U'. y = x; // Shound be an error ~ !!! error TS2322: Type '(item: U) => boolean' is not assignable to type '(item: T) => boolean'. -!!! error TS2322: Types of parameters 'item' and 'item' are incompatible. -!!! error TS2322: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Signature '(item: T): boolean' has no corresponding signature in '(item: U) => boolean' +!!! error TS2322: Types of parameters 'item' and 'item' are incompatible. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence3.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence3.errors.txt index 1f126d7c00d..50e33c7afa4 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence3.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence3.errors.txt @@ -1,7 +1,9 @@ tests/cases/compiler/typeParameterArgumentEquivalence3.ts(4,5): error TS2322: Type '(item: any) => boolean' is not assignable to type '(item: any) => T'. - Type 'boolean' is not assignable to type 'T'. + Signature '(item: any): T' has no corresponding signature in '(item: any) => boolean' + Type 'boolean' is not assignable to type 'T'. tests/cases/compiler/typeParameterArgumentEquivalence3.ts(5,5): error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => boolean'. - Type 'T' is not assignable to type 'boolean'. + Signature '(item: any): boolean' has no corresponding signature in '(item: any) => T' + Type 'T' is not assignable to type 'boolean'. ==== tests/cases/compiler/typeParameterArgumentEquivalence3.ts (2 errors) ==== @@ -11,10 +13,12 @@ tests/cases/compiler/typeParameterArgumentEquivalence3.ts(5,5): error TS2322: Ty x = y; // Should be an error ~ !!! error TS2322: Type '(item: any) => boolean' is not assignable to type '(item: any) => T'. -!!! error TS2322: Type 'boolean' is not assignable to type 'T'. +!!! error TS2322: Signature '(item: any): T' has no corresponding signature in '(item: any) => boolean' +!!! error TS2322: Type 'boolean' is not assignable to type 'T'. y = x; // Shound be an error ~ !!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => boolean'. -!!! error TS2322: Type 'T' is not assignable to type 'boolean'. +!!! error TS2322: Signature '(item: any): boolean' has no corresponding signature in '(item: any) => T' +!!! error TS2322: Type 'T' is not assignable to type 'boolean'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence4.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence4.errors.txt index c7b19e8725c..68ab8dc28df 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence4.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence4.errors.txt @@ -1,7 +1,9 @@ tests/cases/compiler/typeParameterArgumentEquivalence4.ts(4,5): error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U'. - Type 'T' is not assignable to type 'U'. + Signature '(item: any): U' has no corresponding signature in '(item: any) => T' + Type 'T' is not assignable to type 'U'. tests/cases/compiler/typeParameterArgumentEquivalence4.ts(5,5): error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T'. - Type 'U' is not assignable to type 'T'. + Signature '(item: any): T' has no corresponding signature in '(item: any) => U' + Type 'U' is not assignable to type 'T'. ==== tests/cases/compiler/typeParameterArgumentEquivalence4.ts (2 errors) ==== @@ -11,10 +13,12 @@ tests/cases/compiler/typeParameterArgumentEquivalence4.ts(5,5): error TS2322: Ty x = y; // Should be an error ~ !!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U'. -!!! error TS2322: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Signature '(item: any): U' has no corresponding signature in '(item: any) => T' +!!! error TS2322: Type 'T' is not assignable to type 'U'. y = x; // Shound be an error ~ !!! error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T'. -!!! error TS2322: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Signature '(item: any): T' has no corresponding signature in '(item: any) => U' +!!! error TS2322: Type 'U' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence5.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence5.errors.txt index 82290733a9e..8e1ac388a82 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence5.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence5.errors.txt @@ -1,9 +1,13 @@ tests/cases/compiler/typeParameterArgumentEquivalence5.ts(4,5): error TS2322: Type '() => (item: any) => T' is not assignable to type '() => (item: any) => U'. - Type '(item: any) => T' is not assignable to type '(item: any) => U'. - Type 'T' is not assignable to type 'U'. + Signature '(): (item: any) => U' has no corresponding signature in '() => (item: any) => T' + Type '(item: any) => T' is not assignable to type '(item: any) => U'. + Signature '(item: any): U' has no corresponding signature in '(item: any) => T' + Type 'T' is not assignable to type 'U'. tests/cases/compiler/typeParameterArgumentEquivalence5.ts(5,5): error TS2322: Type '() => (item: any) => U' is not assignable to type '() => (item: any) => T'. - Type '(item: any) => U' is not assignable to type '(item: any) => T'. - Type 'U' is not assignable to type 'T'. + Signature '(): (item: any) => T' has no corresponding signature in '() => (item: any) => U' + Type '(item: any) => U' is not assignable to type '(item: any) => T'. + Signature '(item: any): T' has no corresponding signature in '(item: any) => U' + Type 'U' is not assignable to type 'T'. ==== tests/cases/compiler/typeParameterArgumentEquivalence5.ts (2 errors) ==== @@ -13,12 +17,16 @@ tests/cases/compiler/typeParameterArgumentEquivalence5.ts(5,5): error TS2322: Ty x = y; // Should be an error ~ !!! error TS2322: Type '() => (item: any) => T' is not assignable to type '() => (item: any) => U'. -!!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U'. -!!! error TS2322: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Signature '(): (item: any) => U' has no corresponding signature in '() => (item: any) => T' +!!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U'. +!!! error TS2322: Signature '(item: any): U' has no corresponding signature in '(item: any) => T' +!!! error TS2322: Type 'T' is not assignable to type 'U'. y = x; // Shound be an error ~ !!! error TS2322: Type '() => (item: any) => U' is not assignable to type '() => (item: any) => T'. -!!! error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T'. -!!! error TS2322: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Signature '(): (item: any) => T' has no corresponding signature in '() => (item: any) => U' +!!! error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T'. +!!! error TS2322: Signature '(item: any): T' has no corresponding signature in '(item: any) => U' +!!! error TS2322: Type 'U' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments2.errors.txt b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments2.errors.txt index 5a6047222ee..8d926a14378 100644 --- a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments2.errors.txt +++ b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments2.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/typeParameterFixingWithContextSensitiveArguments2.ts(7,25): error TS2345: Argument of type '(x: A) => A' is not assignable to parameter of type '(x: A) => B'. - Type 'A' is not assignable to type 'B'. - Property 'b' is missing in type 'A'. + Signature '(x: A): B' has no corresponding signature in '(x: A) => A' + Type 'A' is not assignable to type 'B'. + Property 'b' is missing in type 'A'. ==== tests/cases/compiler/typeParameterFixingWithContextSensitiveArguments2.ts (1 errors) ==== @@ -13,5 +14,6 @@ tests/cases/compiler/typeParameterFixingWithContextSensitiveArguments2.ts(7,25): var d = f(a, b, x => x, x => x); // A => A not assignable to A => B ~~~~~~ !!! error TS2345: Argument of type '(x: A) => A' is not assignable to parameter of type '(x: A) => B'. -!!! error TS2345: Type 'A' is not assignable to type 'B'. -!!! error TS2345: Property 'b' is missing in type 'A'. \ No newline at end of file +!!! error TS2345: Signature '(x: A): B' has no corresponding signature in '(x: A) => A' +!!! error TS2345: Type 'A' is not assignable to type 'B'. +!!! error TS2345: Property 'b' is missing in type 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments3.errors.txt b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments3.errors.txt index cd0801f7ba9..c93aa87f44b 100644 --- a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments3.errors.txt +++ b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments3.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/typeParameterFixingWithContextSensitiveArguments3.ts(7,29): error TS2345: Argument of type '(t2: A) => A' is not assignable to parameter of type '(t2: A) => B'. - Type 'A' is not assignable to type 'B'. - Property 'b' is missing in type 'A'. + Signature '(t2: A): B' has no corresponding signature in '(t2: A) => A' + Type 'A' is not assignable to type 'B'. + Property 'b' is missing in type 'A'. ==== tests/cases/compiler/typeParameterFixingWithContextSensitiveArguments3.ts (1 errors) ==== @@ -13,5 +14,6 @@ tests/cases/compiler/typeParameterFixingWithContextSensitiveArguments3.ts(7,29): var d = f(a, b, u2 => u2.b, t2 => t2); ~~~~~~~~ !!! error TS2345: Argument of type '(t2: A) => A' is not assignable to parameter of type '(t2: A) => B'. -!!! error TS2345: Type 'A' is not assignable to type 'B'. -!!! error TS2345: Property 'b' is missing in type 'A'. \ No newline at end of file +!!! error TS2345: Signature '(t2: A): B' has no corresponding signature in '(t2: A) => A' +!!! error TS2345: Type 'A' is not assignable to type 'B'. +!!! error TS2345: Property 'b' is missing in type 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/typesWithPrivateConstructor.errors.txt b/tests/baselines/reference/typesWithPrivateConstructor.errors.txt index 2440e51cd39..d2a4e766ebc 100644 --- a/tests/baselines/reference/typesWithPrivateConstructor.errors.txt +++ b/tests/baselines/reference/typesWithPrivateConstructor.errors.txt @@ -1,5 +1,6 @@ tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(4,5): error TS1089: 'private' modifier cannot appear on a constructor declaration. tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(8,5): error TS2322: Type 'Function' is not assignable to type '() => void'. + Signature '(): void' has no corresponding signature in 'Function' tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(11,5): error TS1089: 'private' modifier cannot appear on a constructor declaration. tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(12,5): error TS1089: 'private' modifier cannot appear on a constructor declaration. tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(15,10): error TS2346: Supplied parameters do not match any signature of call target. @@ -18,6 +19,7 @@ tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(15,10): err var r: () => void = c.constructor; ~ !!! error TS2322: Type 'Function' is not assignable to type '() => void'. +!!! error TS2322: Signature '(): void' has no corresponding signature in 'Function' class C2 { private constructor(x: number); diff --git a/tests/baselines/reference/typesWithPublicConstructor.errors.txt b/tests/baselines/reference/typesWithPublicConstructor.errors.txt index a3d66c3520a..6aa06afcdab 100644 --- a/tests/baselines/reference/typesWithPublicConstructor.errors.txt +++ b/tests/baselines/reference/typesWithPublicConstructor.errors.txt @@ -1,4 +1,5 @@ tests/cases/conformance/types/members/typesWithPublicConstructor.ts(8,5): error TS2322: Type 'Function' is not assignable to type '() => void'. + Signature '(): void' has no corresponding signature in 'Function' tests/cases/conformance/types/members/typesWithPublicConstructor.ts(15,10): error TS2346: Supplied parameters do not match any signature of call target. @@ -13,6 +14,7 @@ tests/cases/conformance/types/members/typesWithPublicConstructor.ts(15,10): erro var r: () => void = c.constructor; ~ !!! error TS2322: Type 'Function' is not assignable to type '() => void'. +!!! error TS2322: Signature '(): void' has no corresponding signature in 'Function' class C2 { public constructor(x: number); diff --git a/tests/baselines/reference/undeclaredModuleError.errors.txt b/tests/baselines/reference/undeclaredModuleError.errors.txt index 74e36318595..3c1f930856c 100644 --- a/tests/baselines/reference/undeclaredModuleError.errors.txt +++ b/tests/baselines/reference/undeclaredModuleError.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/undeclaredModuleError.ts(1,21): error TS2307: Cannot find module 'fs'. tests/cases/compiler/undeclaredModuleError.ts(8,29): error TS2345: Argument of type '() => void' is not assignable to parameter of type '(stat: any, name: string) => boolean'. - Type 'void' is not assignable to type 'boolean'. + Signature '(stat: any, name: string): boolean' has no corresponding signature in '() => void' + Type 'void' is not assignable to type 'boolean'. tests/cases/compiler/undeclaredModuleError.ts(11,41): error TS2304: Cannot find name 'IDoNotExist'. @@ -19,7 +20,8 @@ tests/cases/compiler/undeclaredModuleError.ts(11,41): error TS2304: Cannot find } , (error: Error, files: {}[]) => { ~~~~~~~~~ !!! error TS2345: Argument of type '() => void' is not assignable to parameter of type '(stat: any, name: string) => boolean'. -!!! error TS2345: Type 'void' is not assignable to type 'boolean'. +!!! error TS2345: Signature '(stat: any, name: string): boolean' has no corresponding signature in '() => void' +!!! error TS2345: Type 'void' is not assignable to type 'boolean'. files.forEach((file) => { var fullPath = join(IDoNotExist); ~~~~~~~~~~~