From f42841c846b4d8acb510ea4c8ef3b89b0d8390de Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 25 Nov 2015 10:29:13 -0800 Subject: [PATCH] Only report errors from the first failure Accept the new baselines based on this change. Gets rid of a lot of redundant errors. --- src/compiler/checker.ts | 2 +- ...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 +- ...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 +++---- ...tCompatWithConstructSignatures4.errors.txt | 86 +++---- ...ignaturesWithOptionalParameters.errors.txt | 10 - ...ignaturesWithOptionalParameters.errors.txt | 12 - .../assignmentCompatWithOverloads.errors.txt | 32 +-- .../asyncFunctionDeclaration15_es6.errors.txt | 20 +- .../reference/booleanAssignment.errors.txt | 18 +- ...atureAssignabilityInInheritance.errors.txt | 6 +- ...tureAssignabilityInInheritance3.errors.txt | 38 ++- .../reference/castingTuple.errors.txt | 10 +- ...ConstrainedToOtherTypeParameter.errors.txt | 10 +- ...onstrainedToOtherTypeParameter2.errors.txt | 12 +- .../classSideInheritance3.errors.txt | 4 - ...onalOperatorWithoutIdenticalBCT.errors.txt | 18 +- ...atureAssignabilityInInheritance.errors.txt | 6 +- ...tureAssignabilityInInheritance3.errors.txt | 38 ++- .../contextualTypeWithTuple.errors.txt | 24 +- ...lTypeWithUnionTypeObjectLiteral.errors.txt | 10 +- .../reference/contextualTyping24.errors.txt | 14 +- .../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/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 | 18 +- tests/baselines/reference/for-of31.errors.txt | 24 +- ...functionConstraintSatisfaction2.errors.txt | 12 +- ...tionExpressionContextualTyping2.errors.txt | 6 +- ...ctionSignatureAssignmentCompat1.errors.txt | 10 +- .../reference/generatorTypeCheck25.errors.txt | 46 ++-- .../reference/generatorTypeCheck8.errors.txt | 10 +- ...AssignmentCompatWithInterfaces1.errors.txt | 10 +- ...edMethodWithOverloadedArguments.errors.txt | 40 ++- ...lWithConstructorTypedArguments5.errors.txt | 4 - ...lWithGenericSignatureArguments2.errors.txt | 38 ++- ...lWithGenericSignatureArguments3.errors.txt | 6 +- ...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 | 24 +- .../reference/inheritance.errors.txt | 2 - ...nheritedModuleMembersForClodule.errors.txt | 6 +- ...ceMemberAssignsToClassPrototype.errors.txt | 6 +- .../reference/intTypeCheck.errors.txt | 6 +- .../interfaceAssignmentCompat.errors.txt | 14 +- .../interfaceImplementation7.errors.txt | 10 +- .../iteratorSpreadInArray9.errors.txt | 24 +- .../reference/lambdaArgCrash.errors.txt | 2 - .../reference/multipleInheritance.errors.txt | 2 - ...MembersOfObjectAssignmentCompat.errors.txt | 18 +- ...embersOfObjectAssignmentCompat2.errors.txt | 30 +-- ...ptionalFunctionArgAssignability.errors.txt | 20 +- .../optionalParamAssignmentCompat.errors.txt | 10 +- .../optionalParamTypeComparison.errors.txt | 20 +- .../overloadResolutionOverCTLambda.errors.txt | 6 +- ...nWithConstraintCheckingDeferred.errors.txt | 14 +- .../overloadsWithProvisionalErrors.errors.txt | 20 +- .../baselines/reference/parseTypes.errors.txt | 4 - .../reference/parser536727.errors.txt | 12 +- .../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 ++++++------------ .../recursiveFunctionTypes.errors.txt | 6 +- .../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 +- .../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 +- ...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 +- .../undeclaredModuleError.errors.txt | 6 +- 121 files changed, 987 insertions(+), 1695 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 81e1a14bdf6..d490004ae76 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5453,7 +5453,7 @@ namespace ts { localErrors = false; } } - if (reportErrors) { + if (localErrors) { reportError(Diagnostics.Signature_0_has_no_corresponding_signature_in_1, signatureToString(t, /*enclosingDeclaration*/ undefined, /*flags*/ undefined, kind), typeToString(source)); diff --git a/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt b/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt index be20b673287..4b6255688f8 100644 --- a/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt +++ b/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt @@ -1,7 +1,6 @@ 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) ==== @@ -14,7 +13,6 @@ 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 a766bab8a96..d60f0b7d03c 100644 --- a/tests/baselines/reference/arityAndOrderCompatibility01.errors.txt +++ b/tests/baselines/reference/arityAndOrderCompatibility01.errors.txt @@ -29,15 +29,13 @@ 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'. - 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'. + 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'. - 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'. + 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]'. @@ -122,17 +120,15 @@ 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: 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'. +!!! 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: 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'. +!!! 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 b7ea49c7283..72ba1411320 100644 --- a/tests/baselines/reference/arrayLiteralExpressionContextualTyping.errors.txt +++ b/tests/baselines/reference/arrayLiteralExpressionContextualTyping.errors.txt @@ -1,9 +1,8 @@ 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'. - 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'. + 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[]'. @@ -21,9 +20,8 @@ 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: 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'. +!!! 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 a3d3611cf55..637fb3e3bc4 100644 --- a/tests/baselines/reference/arrayLiterals3.errors.txt +++ b/tests/baselines/reference/arrayLiterals3.errors.txt @@ -6,9 +6,8 @@ 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'. - 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'. + 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]'. @@ -16,11 +15,10 @@ 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'. - 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'. + 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) ==== @@ -52,9 +50,8 @@ 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: 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'. +!!! 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 @@ -82,9 +79,8 @@ 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: 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'. +!!! 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 6c52114625b..c53b407b5cf 100644 --- a/tests/baselines/reference/asOperatorContextualType.errors.txt +++ b/tests/baselines/reference/asOperatorContextualType.errors.txt @@ -1,6 +1,5 @@ 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. - Signature '(x: number): string' has no corresponding signature in '(v: number) => number' - Type 'number' is not assignable to type 'string'. + Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/expressions/asOperator/asOperatorContextualType.ts (1 errors) ==== @@ -8,5 +7,4 @@ 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: 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 +!!! 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 f20050a5b9e..c03eab60c74 100644 --- a/tests/baselines/reference/assignFromBooleanInterface2.errors.txt +++ b/tests/baselines/reference/assignFromBooleanInterface2.errors.txt @@ -1,8 +1,7 @@ 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'. - Signature '(): boolean' has no corresponding signature in '() => Object' - Type 'Object' is not assignable to type 'boolean'. + 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'. @@ -26,8 +25,7 @@ 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: Signature '(): boolean' has no corresponding signature in '() => Object' -!!! error TS2322: Type 'Object' is not assignable to type 'boolean'. +!!! error TS2322: Type 'Object' is not assignable to type 'boolean'. b = a; b = x; diff --git a/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt b/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt index 16fff660c1d..c7552c3fdb2 100644 --- a/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt +++ b/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt @@ -1,9 +1,8 @@ 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'. - 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'. + 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 '{}[]'. @@ -30,9 +29,8 @@ 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: 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'. +!!! 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 f8b1a1094e2..1b5e3d80259 100644 --- a/tests/baselines/reference/assignmentCompatBug5.errors.txt +++ b/tests/baselines/reference/assignmentCompatBug5.errors.txt @@ -3,12 +3,10 @@ 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'. - 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'. + 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'. - Signature '(n: number): number' has no corresponding signature in '(n: number) => void' - Type 'void' is not assignable to type 'number'. + Type 'void' is not assignable to type 'number'. ==== tests/cases/compiler/assignmentCompatBug5.ts (4 errors) ==== @@ -28,13 +26,11 @@ 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: 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'. +!!! 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: Signature '(n: number): number' has no corresponding signature in '(n: number) => void' -!!! error TS2345: Type 'void' is not assignable to type 'number'. +!!! 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 194b1834a61..6a221ef144e 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt @@ -1,35 +1,27 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(35,1): error TS2322: Type 'S2' is not assignable to type 'T'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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) ==== @@ -70,49 +62,41 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme t = s2; ~ !!! error TS2322: Type 'S2' is not assignable to type 'T'. -!!! 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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 fdcc9fe6ec9..e67f0a930c2 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt @@ -9,15 +9,13 @@ 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'. - 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'. + 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'. - 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'. + 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'. @@ -25,15 +23,13 @@ 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'. - 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'. + 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'. - 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'. + 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; }'. @@ -99,17 +95,15 @@ 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: 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'. +!!! 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: 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'. +!!! 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'. @@ -123,17 +117,15 @@ 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: 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'. +!!! 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: 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'. +!!! 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 3620fb0e8c3..e00d1eea042 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt @@ -1,16 +1,13 @@ 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'. - 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'. + 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'. 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'. - 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'. + 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) ==== @@ -68,20 +65,17 @@ 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: 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'. +!!! 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'. 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: 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'. +!!! 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 504f6d70799..f89bbfa5798 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt @@ -1,17 +1,10 @@ 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) ==== @@ -33,22 +26,18 @@ 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 @@ -62,7 +51,6 @@ 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 @@ -71,7 +59,6 @@ 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 @@ -80,7 +67,6 @@ 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 e785ab663ca..8eec8503e70 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt @@ -1,39 +1,30 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(13,5): error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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) ==== @@ -52,18 +43,16 @@ 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: 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'. +!!! 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: 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'. +!!! 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; @@ -75,9 +64,8 @@ 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: 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'. +!!! 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 @@ -89,41 +77,35 @@ 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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 +!!! 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/assignmentCompatWithConstructSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt index 3a771411b53..8835b6280c4 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt @@ -1,34 +1,27 @@ 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'. - 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'. + 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'. 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'. - 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'. + 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[]; }'. - 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' + 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[]'. - 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'. + 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[]; }'. - 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' + 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[]'. - 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'. + 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) ==== @@ -86,20 +79,17 @@ 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: 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'. +!!! 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'. 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: 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'. +!!! 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; @@ -126,31 +116,27 @@ 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: 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' +!!! 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: 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'. +!!! 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: 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' +!!! 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: 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'. +!!! 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 4ba4ec9a3c3..df56af3ee98 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt @@ -1,13 +1,8 @@ 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) ==== @@ -29,16 +24,13 @@ 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 @@ -49,7 +41,6 @@ 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 @@ -60,7 +51,6 @@ 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 229ec114d39..a18da8fd8f7 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt @@ -1,15 +1,9 @@ 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) ==== @@ -29,7 +23,6 @@ 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 @@ -41,7 +34,6 @@ 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 @@ -86,11 +78,9 @@ 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; @@ -134,7 +124,6 @@ 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 @@ -146,7 +135,6 @@ 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 1def25bf372..3bea0c46716 100644 --- a/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt @@ -1,17 +1,13 @@ tests/cases/compiler/assignmentCompatWithOverloads.ts(17,1): error TS2322: Type '(x: string) => string' is not assignable to type '(s1: string) => number'. - Signature '(s1: string): number' has no corresponding signature in '(x: string) => string' - Type 'string' is not assignable to type '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'. - 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'. + 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'. + 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'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/assignmentCompatWithOverloads.ts (4 errors) ==== @@ -34,21 +30,18 @@ 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: Signature '(s1: string): number' has no corresponding signature in '(x: string) => string' -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! 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: 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'. +!!! 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: 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'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. class C { constructor(x: string); @@ -60,6 +53,5 @@ 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: 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 +!!! 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/asyncFunctionDeclaration15_es6.errors.txt b/tests/baselines/reference/asyncFunctionDeclaration15_es6.errors.txt index 8aa24d79ac0..bc1ef24127a 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration15_es6.errors.txt +++ b/tests/baselines/reference/asyncFunctionDeclaration15_es6.errors.txt @@ -3,12 +3,10 @@ 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. - 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'. + 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'. 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. @@ -34,12 +32,10 @@ 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: 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'. +!!! 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'. 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 b16cca5c1bb..454bd7ef707 100644 --- a/tests/baselines/reference/booleanAssignment.errors.txt +++ b/tests/baselines/reference/booleanAssignment.errors.txt @@ -1,18 +1,15 @@ 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'. - Signature '(): boolean' has no corresponding signature in '() => number' - Type 'number' is not assignable to type 'boolean'. + 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'. - Signature '(): boolean' has no corresponding signature in '() => string' - Type 'string' is not assignable to type 'boolean'. + 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'. - Signature '(): boolean' has no corresponding signature in '() => Object' - Type 'Object' is not assignable to type 'boolean'. + Type 'Object' is not assignable to type 'boolean'. ==== tests/cases/compiler/booleanAssignment.ts (3 errors) ==== @@ -22,22 +19,19 @@ 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: Signature '(): boolean' has no corresponding signature in '() => number' -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. +!!! 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: Signature '(): boolean' has no corresponding signature in '() => string' -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! 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: Signature '(): boolean' has no corresponding signature in '() => Object' -!!! error TS2322: Type 'Object' is not assignable to type 'boolean'. +!!! error TS2322: Type 'Object' is not assignable to type 'boolean'. var o = {}; o = b; // OK diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt index 3e66787b54d..d6efdd66868 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt @@ -1,8 +1,7 @@ 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'. - Signature '(x: number): number' has no corresponding signature in '(x: number) => string' - Type 'string' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance.ts (1 errors) ==== @@ -67,8 +66,7 @@ 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: Signature '(x: number): number' has no corresponding signature in '(x: number) => string' -!!! error TS2430: Type 'string' is not assignable to type 'number'. +!!! 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 b3bdb17ea71..7e9d75b1b41 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt @@ -1,20 +1,17 @@ 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[]'. - 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'. + 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'. - 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'. + 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'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts (2 errors) ==== @@ -73,9 +70,8 @@ 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: 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'. +!!! 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 } @@ -89,14 +85,12 @@ 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: 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'. +!!! 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'. 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 cdf40eeeff6..62a36c9c156 100644 --- a/tests/baselines/reference/castingTuple.errors.txt +++ b/tests/baselines/reference/castingTuple.errors.txt @@ -13,9 +13,8 @@ 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'. - 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'. + 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'. @@ -71,9 +70,8 @@ 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: 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'. +!!! 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 579f6c47138..181bfcc907d 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt @@ -1,7 +1,6 @@ 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'. - 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'. + Type 'B' is not assignable to type 'C'. + Property 'z' is missing in type 'B'. ==== tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts (1 errors) ==== @@ -26,6 +25,5 @@ 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: 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 +!!! 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 1de7ead6e04..8f5924586df 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt @@ -1,9 +1,7 @@ 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'. - Signature '(x: S): S' has no corresponding signature in '(ss: S) => T' - Type 'T' is not assignable to type 'S'. + 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'. - Signature '(x: S): S' has no corresponding signature in '(ss: S) => T' - Type 'T' is not assignable to type 'S'. + 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'. @@ -19,15 +17,13 @@ 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: Signature '(x: S): S' has no corresponding signature in '(ss: S) => T' -!!! error TS2345: Type 'T' is not assignable to type 'S'. +!!! 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: Signature '(x: S): S' has no corresponding signature in '(ss: S) => T' -!!! error TS2345: Type 'T' is not assignable to type 'S'. +!!! 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/classSideInheritance3.errors.txt b/tests/baselines/reference/classSideInheritance3.errors.txt index 4d6a5a9b018..c845defa5b8 100644 --- a/tests/baselines/reference/classSideInheritance3.errors.txt +++ b/tests/baselines/reference/classSideInheritance3.errors.txt @@ -1,7 +1,5 @@ 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) ==== @@ -23,9 +21,7 @@ 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 867a044420d..2fa13333058 100644 --- a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt @@ -6,16 +6,13 @@ 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'. - Signature '(t: X): number' has no corresponding signature in '(n: X) => string' - Type 'string' is not assignable to type 'number'. + 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'. - Signature '(t: X): string' has no corresponding signature in '(m: X) => number' - Type 'number' is not assignable to type 'string'. + 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'. - Signature '(t: X): boolean' has no corresponding signature in '(m: X) => number' - Type 'number' is not assignable to type 'boolean'. + Type 'number' is not assignable to type 'boolean'. ==== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts (5 errors) ==== @@ -49,19 +46,16 @@ 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: Signature '(t: X): number' has no corresponding signature in '(n: X) => string' -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! 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: Signature '(t: X): string' has no corresponding signature in '(m: X) => number' -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! 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: Signature '(t: X): boolean' has no corresponding signature in '(m: X) => number' -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. +!!! 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 178239b729e..51278fc3f44 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt @@ -1,8 +1,7 @@ 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'. - Signature 'new (x: number): number' has no corresponding signature in 'new (x: number) => string' - Type 'string' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance.ts (1 errors) ==== @@ -71,8 +70,7 @@ 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: Signature 'new (x: number): number' has no corresponding signature in 'new (x: number) => string' -!!! error TS2430: Type 'string' is not assignable to type 'number'. +!!! 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 5125fc27301..8d6273804f7 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt @@ -1,20 +1,17 @@ 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[]'. - 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'. + 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'. - 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'. + 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'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts (2 errors) ==== @@ -63,9 +60,8 @@ 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: 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'. +!!! 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 } @@ -79,14 +75,12 @@ 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: 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'. +!!! 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'. a8: new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch } diff --git a/tests/baselines/reference/contextualTypeWithTuple.errors.txt b/tests/baselines/reference/contextualTypeWithTuple.errors.txt index 249e96c8829..e447ed62b39 100644 --- a/tests/baselines/reference/contextualTypeWithTuple.errors.txt +++ b/tests/baselines/reference/contextualTypeWithTuple.errors.txt @@ -1,10 +1,9 @@ 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'. - 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'. + 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. @@ -15,9 +14,8 @@ 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'. - 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'. + 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]'. @@ -34,10 +32,9 @@ 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: 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'. +!!! 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 }]]; @@ -69,9 +66,8 @@ 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: 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'. +!!! 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 1e0865de8db..8be323f9af4 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt +++ b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt @@ -27,9 +27,8 @@ 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'. - 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'. + 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) ==== @@ -125,8 +124,7 @@ 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: 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'. +!!! 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 1d1fd191944..68cb8e3d853 100644 --- a/tests/baselines/reference/contextualTyping24.errors.txt +++ b/tests/baselines/reference/contextualTyping24.errors.txt @@ -1,15 +1,13 @@ tests/cases/compiler/contextualTyping24.ts(1,55): error TS2322: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): 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' + 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: 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 +!!! 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 3cf5e5aa9ff..e43624fbead 100644 --- a/tests/baselines/reference/contextualTyping39.errors.txt +++ b/tests/baselines/reference/contextualTyping39.errors.txt @@ -1,11 +1,9 @@ tests/cases/compiler/contextualTyping39.ts(1,11): error TS2352: Neither type '() => string' nor type '() => number' is assignable to the other. - Signature '(): number' has no corresponding signature in '() => string' - Type 'string' is not assignable to type 'number'. + 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: Signature '(): number' has no corresponding signature in '() => string' -!!! error TS2352: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! 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 a3e33f26ddd..1ed6da1b782 100644 --- a/tests/baselines/reference/contextualTyping41.errors.txt +++ b/tests/baselines/reference/contextualTyping41.errors.txt @@ -1,11 +1,9 @@ tests/cases/compiler/contextualTyping41.ts(1,11): error TS2352: Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other. - Signature '(): number' has no corresponding signature in '() => string' - Type 'string' is not assignable to type 'number'. + 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: Signature '(): number' has no corresponding signature in '() => string' -!!! error TS2352: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! 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 6fbf1b12967..08fe22c08e0 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt @@ -1,9 +1,8 @@ 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'. - 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'. + 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) ==== @@ -21,8 +20,7 @@ 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: 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'. +!!! 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 530993a7e23..a11f0009016 100644 --- a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt +++ b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt @@ -1,10 +1,8 @@ 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'. - 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'. + 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'. - Signature '(x: number): Date' has no corresponding signature in '(x: number) => string' - Type 'string' is not assignable to type 'Date'. + Type 'string' is not assignable to type 'Date'. ==== tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts (2 errors) ==== @@ -26,12 +24,10 @@ 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: 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'. +!!! 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: Signature '(x: number): Date' has no corresponding signature in '(x: number) => string' -!!! error TS2345: Type 'string' is not assignable to type 'Date'. +!!! 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 5f47163f13f..c6b620beb18 100644 --- a/tests/baselines/reference/derivedClassTransitivity.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity.errors.txt @@ -1,9 +1,8 @@ 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'. - 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'. + 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) ==== @@ -29,8 +28,7 @@ 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: 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'. +!!! 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 16aa54ef101..a8d2003c876 100644 --- a/tests/baselines/reference/derivedClassTransitivity2.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity2.errors.txt @@ -1,9 +1,8 @@ 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'. - 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'. + 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) ==== @@ -29,8 +28,7 @@ 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: 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'. +!!! 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 837c6db67c4..9d301255dfd 100644 --- a/tests/baselines/reference/derivedClassTransitivity3.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity3.errors.txt @@ -1,9 +1,8 @@ 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'. - 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'. + 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) ==== @@ -29,8 +28,7 @@ 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: 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'. +!!! 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 47d1d767fbd..c1a80e0a1d7 100644 --- a/tests/baselines/reference/derivedClassTransitivity4.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity4.errors.txt @@ -1,9 +1,8 @@ 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'. - 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'. + 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. @@ -30,9 +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: 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'. +!!! 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 6f088a12a9a..ae8fbe2ff5d 100644 --- a/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt +++ b/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt @@ -1,7 +1,6 @@ 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) ==== @@ -20,7 +19,6 @@ 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 a3311319960..c8037255a32 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt @@ -5,11 +5,10 @@ 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[][]'. - 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'. + 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; }'. @@ -48,10 +47,9 @@ 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'. - 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; }'. + 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'. @@ -77,11 +75,10 @@ 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: 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'. +!!! 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 @@ -182,10 +179,9 @@ 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: 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; }'. +!!! 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/errorElaboration.errors.txt b/tests/baselines/reference/errorElaboration.errors.txt index 42903f7fa04..94742d7d98b 100644 --- a/tests/baselines/reference/errorElaboration.errors.txt +++ b/tests/baselines/reference/errorElaboration.errors.txt @@ -1,8 +1,7 @@ tests/cases/compiler/errorElaboration.ts(12,5): error TS2345: Argument of type '() => Container>' is not assignable to parameter of type '() => Container>'. - 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'. + 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) ==== @@ -20,8 +19,7 @@ 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: 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'. +!!! 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 8fbd4052bf9..403e79b8742 100644 --- a/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt +++ b/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt @@ -1,6 +1,5 @@ tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(1,5): error TS2322: Type '() => void' is not assignable to type '() => boolean'. - Signature '(): boolean' has no corresponding signature in '() => void' - Type 'void' is not assignable to type 'boolean'. + 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. @@ -8,8 +7,7 @@ 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: Signature '(): boolean' has no corresponding signature in '() => void' -!!! error TS2322: Type 'void' is not assignable to type 'boolean'. +!!! 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 6cacd56eb17..12478442472 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt @@ -16,26 +16,21 @@ 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'. - 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'. + 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'. - 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'. + 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'. - Signature '(x: string): number' has no corresponding signature in '(x: string) => string' - Type 'string' is not assignable to type 'number'. + 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'. - 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'. + 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'. - Signature '(x: number): string' has no corresponding signature in '(x: number) => boolean' - Type 'boolean' is not assignable to type 'string'. + Type 'boolean' is not assignable to type 'string'. ==== tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts (15 errors) ==== @@ -113,36 +108,31 @@ 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: 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'. +!!! 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: 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'. +!!! 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: Signature '(x: string): number' has no corresponding signature in '(x: string) => string' -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! 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: 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'. +!!! 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: Signature '(x: number): string' has no corresponding signature in '(x: number) => boolean' -!!! 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 diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt b/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt index 448851640cd..a44c95377dc 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt @@ -1,8 +1,7 @@ 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'. - Signature '(): number' has no corresponding signature in '() => string' - Type 'string' is not assignable to type 'number'. + 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'. @@ -19,8 +18,7 @@ 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: Signature '(): number' has no corresponding signature in '() => string' -!!! error TS2420: Type 'string' is not assignable to type 'number'. +!!! 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 ca0c6bb9dca..e56b58a268d 100644 --- a/tests/baselines/reference/fixingTypeParametersRepeatedly2.errors.txt +++ b/tests/baselines/reference/fixingTypeParametersRepeatedly2.errors.txt @@ -1,10 +1,8 @@ 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'. - 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'. + 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'. - Signature '(p: Derived): Derived' has no corresponding signature in '(d: Derived) => Base' - Type 'Base' is not assignable to type 'Derived'. + Type 'Base' is not assignable to type 'Derived'. ==== tests/cases/compiler/fixingTypeParametersRepeatedly2.ts (2 errors) ==== @@ -21,9 +19,8 @@ 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: 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'. +!!! 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. @@ -32,5 +29,4 @@ 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: 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 +!!! 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 85c04fffdd0..24dcb4dee53 100644 --- a/tests/baselines/reference/for-of30.errors.txt +++ b/tests/baselines/reference/for-of30.errors.txt @@ -1,11 +1,10 @@ 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'. - 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' + 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) ==== @@ -14,11 +13,10 @@ 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: 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' +!!! 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 111235d2f57..6d5f6e816be 100644 --- a/tests/baselines/reference/for-of31.errors.txt +++ b/tests/baselines/reference/for-of31.errors.txt @@ -1,13 +1,11 @@ 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'. - 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; }'. + 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; }'. ==== tests/cases/conformance/es6/for-ofStatements/for-of31.ts (1 errors) ==== @@ -16,13 +14,11 @@ 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: 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; }'. +!!! 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; }'. class StringIterator { next() { diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt index baf2af9794b..bfcb8bc8a3b 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt +++ b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt @@ -5,15 +5,13 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain 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'. - 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'. + 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'. @@ -63,9 +61,8 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain 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: 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'. +!!! 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'. @@ -78,7 +75,6 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain var r11 = foo2((x: U, y: V) => x); ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: U, y: V) => U' is not assignable to parameter of type '(x: string) => string'. -!!! error TS2345: 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'. diff --git a/tests/baselines/reference/functionExpressionContextualTyping2.errors.txt b/tests/baselines/reference/functionExpressionContextualTyping2.errors.txt index 6ac40bcf2d9..6a3a7998f09 100644 --- a/tests/baselines/reference/functionExpressionContextualTyping2.errors.txt +++ b/tests/baselines/reference/functionExpressionContextualTyping2.errors.txt @@ -1,7 +1,6 @@ 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'. - Signature '(n: number, s: string): string' has no corresponding signature in '(foo: number, bar: string) => boolean' - Type 'boolean' is not assignable to type 'string'. + Type 'boolean' is not assignable to type 'string'. ==== tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping2.ts (1 errors) ==== @@ -19,5 +18,4 @@ 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: 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 +!!! 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 86f89e94b04..86c4728dda2 100644 --- a/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt +++ b/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/functionSignatureAssignmentCompat1.ts(10,5): error TS2322: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc'. - 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'. + Types of parameters 'delimiter' and 'eventEmitter' are incompatible. + Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/functionSignatureAssignmentCompat1.ts (1 errors) ==== @@ -17,7 +16,6 @@ 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: 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'. +!!! 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 65aa94001b5..8d414c7c471 100644 --- a/tests/baselines/reference/generatorTypeCheck25.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck25.errors.txt @@ -1,17 +1,14 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck25.ts(4,5): error TS2322: Type '() => IterableIterator' is not assignable to type '() => Iterable'. - 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'. + 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'. ==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck25.ts (1 errors) ==== @@ -21,19 +18,16 @@ 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: 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'. +!!! 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'. yield; yield new Bar; yield new Baz; diff --git a/tests/baselines/reference/generatorTypeCheck8.errors.txt b/tests/baselines/reference/generatorTypeCheck8.errors.txt index abd1db46bd1..cedfecda60b 100644 --- a/tests/baselines/reference/generatorTypeCheck8.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck8.errors.txt @@ -1,9 +1,8 @@ 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'. - 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'. + 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) ==== @@ -13,6 +12,5 @@ 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: 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 +!!! 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 3b52ed1e597..f335319cafd 100644 --- a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt +++ b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt @@ -3,9 +3,8 @@ 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'. - 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'. + 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'. @@ -36,9 +35,8 @@ 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: 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'. +!!! 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 a6c6de7ffa7..428ebecf5b0 100644 --- a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt +++ b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt @@ -1,19 +1,15 @@ 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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) ==== @@ -43,9 +39,8 @@ 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: 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'. +!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2345: Type 'number' is not assignable to type 'string'. } ////////////////////////////////////// @@ -77,9 +72,8 @@ 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: 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'. +!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2345: Type 'number' is not assignable to type 'string'. } ////////////////////////////////////// @@ -98,9 +92,8 @@ 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: 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'. +!!! error TS2345: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2345: Type 'number' is not assignable to type 'string'. } ////////////////////////////////////// @@ -119,8 +112,7 @@ 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: 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'. +!!! 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 451a9e2900d..a014ef85b6c 100644 --- a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt +++ b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt @@ -1,11 +1,9 @@ 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) ==== @@ -24,14 +22,12 @@ 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 4677d24164d..c264058ad9f 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt @@ -3,21 +3,18 @@ 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'. - 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'. + 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'. - Signature '(x: E): E' has no corresponding signature in '(x: E) => F' - Type 'F' is not assignable to type 'E'. + 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'. - 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'. + 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'. @@ -57,11 +54,10 @@ 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: 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'. +!!! 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 } @@ -76,8 +72,7 @@ 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: Signature '(x: E): E' has no corresponding signature in '(x: E) => F' -!!! error TS2345: Type 'F' is not assignable to type 'E'. +!!! error TS2345: Type 'F' is not assignable to type 'E'. } module TU { @@ -107,10 +102,9 @@ 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: 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: 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 cfee8e336b3..52c5e03912e 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.errors.txt +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.errors.txt @@ -1,7 +1,6 @@ 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'. - Signature '(y: string): string' has no corresponding signature in '(a: string) => boolean' - Type 'boolean' is not assignable to type 'string'. + 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' @@ -43,8 +42,7 @@ 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: Signature '(y: string): string' has no corresponding signature in '(a: string) => boolean' -!!! error TS2453: Type 'boolean' is not assignable to type 'string'. +!!! 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. diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt index 230311a6642..80bcf12494a 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt @@ -1,5 +1,4 @@ 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) ==== @@ -36,7 +35,6 @@ 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 0e2481feee8..32fe6a09344 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt @@ -1,5 +1,4 @@ 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) ==== @@ -33,7 +32,6 @@ 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 518a4714247..d03f8d5e68a 100644 --- a/tests/baselines/reference/genericCallWithTupleType.errors.txt +++ b/tests/baselines/reference/genericCallWithTupleType.errors.txt @@ -1,10 +1,9 @@ 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'. - 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'. + 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]'. @@ -34,10 +33,9 @@ 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: 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'. +!!! 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 3dcc1b3c873..d590f1030c3 100644 --- a/tests/baselines/reference/genericCombinators2.errors.txt +++ b/tests/baselines/reference/genericCombinators2.errors.txt @@ -1,10 +1,8 @@ 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'. - 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'. + 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'. - Signature '(x: number, y: string): Date' has no corresponding signature in '(x: number, y: string) => string' - Type 'string' is not assignable to type 'Date'. + Type 'string' is not assignable to type 'Date'. ==== tests/cases/compiler/genericCombinators2.ts (2 errors) ==== @@ -25,11 +23,9 @@ 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: 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'. +!!! 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: 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 +!!! 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 abfdf7a6640..ccaa839f9d0 100644 --- a/tests/baselines/reference/genericSpecializations3.errors.txt +++ b/tests/baselines/reference/genericSpecializations3.errors.txt @@ -1,21 +1,18 @@ 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/genericSpecializations3.ts (3 errors) ==== @@ -31,9 +28,8 @@ 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: 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'. +!!! 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; } } @@ -58,17 +54,15 @@ 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: 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'. +!!! 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: 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'. +!!! 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 72bdf8a23a6..eda4c83646c 100644 --- a/tests/baselines/reference/genericTypeAssertions2.errors.txt +++ b/tests/baselines/reference/genericTypeAssertions2.errors.txt @@ -1,9 +1,8 @@ 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'. - 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'. + 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. @@ -25,9 +24,8 @@ 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: 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'. +!!! 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 d8bd78992a7..0fe15afcf33 100644 --- a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt +++ b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt @@ -1,20 +1,18 @@ 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'. - 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'. - Signature '(a: { a: number; }): void' has no corresponding signature in '(a: { a: string; }) => void' - Types of parameters 'a' and 'a' are incompatible. + 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'. ==== tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts (2 errors) ==== @@ -26,12 +24,11 @@ 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: 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'. +!!! 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 }>(); @@ -40,9 +37,8 @@ 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: 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'. +!!! 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 93828628bd2..06bfa122901 100644 --- a/tests/baselines/reference/generics4.errors.txt +++ b/tests/baselines/reference/generics4.errors.txt @@ -2,8 +2,7 @@ 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'. - Signature '(): string' has no corresponding signature in '() => boolean' - Type 'boolean' is not assignable to type 'string'. + Type 'boolean' is not assignable to type 'string'. ==== tests/cases/compiler/generics4.ts (1 errors) ==== @@ -19,5 +18,4 @@ 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: Signature '(): string' has no corresponding signature in '() => boolean' -!!! error TS2322: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file +!!! 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 9699ab80862..7a128b87764 100644 --- a/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt +++ b/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt @@ -1,14 +1,12 @@ 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'. - 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'. + 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'. - Signature '(x: T): T' has no corresponding signature in '(x: Tstring) => number' - Type 'number' is not assignable to type 'T'. + Type 'number' is not assignable to type 'T'. ==== tests/cases/compiler/implementGenericWithMismatchedTypes.ts (2 errors) ==== @@ -23,9 +21,8 @@ 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: 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'. +!!! 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; } @@ -39,8 +36,7 @@ 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: Signature '(x: T): T' has no corresponding signature in '(x: Tstring) => number' -!!! error TS2420: Type 'number' is not assignable to type 'T'. +!!! 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 eddd01cc979..2d6af3a74e2 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -1,14 +1,12 @@ 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'. - Signature '(): number' has no corresponding signature in '() => string' - Type 'string' is not assignable to type 'number'. + 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'. - 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'. + 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'. @@ -19,8 +17,7 @@ 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'. - Signature '(s: string): number' has no corresponding signature in '() => string' - Type 'string' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/incompatibleTypes.ts(49,7): error TS2345: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. tests/cases/compiler/incompatibleTypes.ts(66,47): error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. @@ -28,7 +25,6 @@ tests/cases/compiler/incompatibleTypes.ts(66,47): error TS2322: Type '{ e: numbe 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) ==== @@ -41,8 +37,7 @@ 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: Signature '(): number' has no corresponding signature in '() => string' -!!! error TS2420: Type 'string' is not assignable to type 'number'. +!!! error TS2420: Type 'string' is not assignable to type 'number'. public p1() { return "s"; } @@ -57,9 +52,8 @@ 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: 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'. +!!! 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; } @@ -100,8 +94,7 @@ 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: Signature '(s: string): number' has no corresponding signature in '() => string' -!!! error TS2345: Type 'string' is not assignable to type 'number'. +!!! error TS2345: Type 'string' is not assignable to type 'number'. function of1(n: { a: { a: string; }; b: string; }): number; @@ -145,5 +138,4 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => var fp1: () =>any = a => 0; ~~~ !!! error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. -!!! error TS2322: 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 eef06b4c961..c667e8b001e 100644 --- a/tests/baselines/reference/inheritance.errors.txt +++ b/tests/baselines/reference/inheritance.errors.txt @@ -1,7 +1,6 @@ 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. @@ -40,7 +39,6 @@ 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/inheritedModuleMembersForClodule.errors.txt b/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt index 6c67e28e2f9..0b7e00d95ce 100644 --- a/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt +++ b/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt @@ -1,8 +1,7 @@ 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'. - Signature '(): string' has no corresponding signature in '() => number' - Type 'number' is not assignable to type 'string'. + Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/inheritedModuleMembersForClodule.ts (1 errors) ==== @@ -17,8 +16,7 @@ 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: Signature '(): string' has no corresponding signature in '() => number' -!!! error TS2417: Type 'number' is not assignable to type 'string'. +!!! 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 cca68d4ef96..080316f8daf 100644 --- a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt +++ b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt @@ -1,6 +1,5 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/instanceMemberAssignsToClassPrototype.ts(7,9): error TS2322: Type '() => void' is not assignable to type '(x: number) => number'. - Signature '(x: number): number' has no corresponding signature in '() => void' - Type 'void' is not assignable to type 'number'. + Type 'void' is not assignable to type 'number'. ==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/instanceMemberAssignsToClassPrototype.ts (1 errors) ==== @@ -13,8 +12,7 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclara C.prototype.bar = () => { } // error ~~~~~~~~~~~~~~~ !!! error TS2322: Type '() => void' is not assignable to type '(x: number) => number'. -!!! error TS2322: Signature '(x: number): number' has no corresponding signature in '() => void' -!!! error TS2322: Type 'void' is not assignable to type 'number'. +!!! 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 d9f3f021887..02592bedb69 100644 --- a/tests/baselines/reference/intTypeCheck.errors.txt +++ b/tests/baselines/reference/intTypeCheck.errors.txt @@ -66,8 +66,7 @@ tests/cases/compiler/intTypeCheck.ts(170,17): error TS2350: Only a void function 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'. - Signature '(): number' has no corresponding signature in '() => void' - Type 'void' is not assignable to type 'number'. + 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. @@ -382,8 +381,7 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit var obj61: i6 = function () { }; ~~~~~ !!! error TS2322: Type '() => void' is not assignable to type 'i6'. -!!! error TS2322: Signature '(): number' has no corresponding signature in '() => void' -!!! error TS2322: Type 'void' is not assignable to type 'number'. +!!! error TS2322: Type 'void' is not assignable to type 'number'. //var obj62: i6 = function foo() { }; var obj63: i6 = anyVar; var obj64: i6 = new anyVar; diff --git a/tests/baselines/reference/interfaceAssignmentCompat.errors.txt b/tests/baselines/reference/interfaceAssignmentCompat.errors.txt index a1198d9fd37..237358b42de 100644 --- a/tests/baselines/reference/interfaceAssignmentCompat.errors.txt +++ b/tests/baselines/reference/interfaceAssignmentCompat.errors.txt @@ -1,8 +1,7 @@ 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'. - 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'. + 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'. @@ -45,10 +44,9 @@ 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: 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'. +!!! 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/interfaceImplementation7.errors.txt b/tests/baselines/reference/interfaceImplementation7.errors.txt index 531398ba532..b297015dfbe 100644 --- a/tests/baselines/reference/interfaceImplementation7.errors.txt +++ b/tests/baselines/reference/interfaceImplementation7.errors.txt @@ -3,9 +3,8 @@ 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; }'. - 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'. + 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) ==== @@ -23,9 +22,8 @@ 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: 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'. +!!! 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/iteratorSpreadInArray9.errors.txt b/tests/baselines/reference/iteratorSpreadInArray9.errors.txt index cc32db8a373..90b8bdbeb46 100644 --- a/tests/baselines/reference/iteratorSpreadInArray9.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInArray9.errors.txt @@ -1,13 +1,11 @@ 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'. - 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; }'. + 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; }'. ==== tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts (1 errors) ==== @@ -16,13 +14,11 @@ 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: 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; }'. +!!! 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; }'. class SymbolIterator { next() { diff --git a/tests/baselines/reference/lambdaArgCrash.errors.txt b/tests/baselines/reference/lambdaArgCrash.errors.txt index 658534334f5..bf1c4dd01bd 100644 --- a/tests/baselines/reference/lambdaArgCrash.errors.txt +++ b/tests/baselines/reference/lambdaArgCrash.errors.txt @@ -1,6 +1,5 @@ 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) ==== @@ -37,7 +36,6 @@ 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 def2fcbd813..19ef1e755e3 100644 --- a/tests/baselines/reference/multipleInheritance.errors.txt +++ b/tests/baselines/reference/multipleInheritance.errors.txt @@ -3,7 +3,6 @@ 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. @@ -50,7 +49,6 @@ 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 6bc3ec86f72..c4ee3ea17b2 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt @@ -1,18 +1,15 @@ 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'. - Signature '(): string' has no corresponding signature in '() => void' - Type 'void' is not assignable to type 'string'. + 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'. - Signature '(): string' has no corresponding signature in '() => void' - Type 'void' is not assignable to type 'string'. + 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'. - Signature '(): string' has no corresponding signature in '() => void' - Type 'void' is not assignable to type 'string'. + Type 'void' is not assignable to type 'string'. ==== tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts (3 errors) ==== @@ -27,8 +24,7 @@ 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: Signature '(): string' has no corresponding signature in '() => void' -!!! error TS2322: Type 'void' is not assignable to type 'string'. +!!! error TS2322: Type 'void' is not assignable to type 'string'. i = o; // ok class C { @@ -40,8 +36,7 @@ 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: Signature '(): string' has no corresponding signature in '() => void' -!!! error TS2322: Type 'void' is not assignable to type 'string'. +!!! error TS2322: Type 'void' is not assignable to type 'string'. c = o; // ok var a = { @@ -52,6 +47,5 @@ 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: Signature '(): string' has no corresponding signature in '() => void' -!!! error TS2322: Type 'void' is not assignable to type 'string'. +!!! 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 174707a8d22..a88796b390e 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt @@ -1,28 +1,23 @@ 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'. - Signature '(): string' has no corresponding signature in '() => number' - Type 'number' is not assignable to type 'string'. + 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'. - Signature '(): number' has no corresponding signature in '() => string' - Type 'string' is not assignable to type 'number'. + 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'. - Signature '(): string' has no corresponding signature in '() => number' - Type 'number' is not assignable to type 'string'. + 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'. - Signature '(): number' has no corresponding signature in '() => string' - Type 'string' is not assignable to type 'number'. + 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'. - Signature '(): string' has no corresponding signature in '() => void' - Type 'void' is not assignable to type 'string'. + Type 'void' is not assignable to type 'string'. ==== tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts (5 errors) ==== @@ -37,15 +32,13 @@ 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: Signature '(): string' has no corresponding signature in '() => number' -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! 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: Signature '(): number' has no corresponding signature in '() => string' -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. class C { toString(): number { return 1; } @@ -56,15 +49,13 @@ 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: Signature '(): string' has no corresponding signature in '() => number' -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! 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: Signature '(): number' has no corresponding signature in '() => string' -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var a = { toString: () => { } @@ -74,6 +65,5 @@ 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: Signature '(): string' has no corresponding signature in '() => void' -!!! error TS2322: Type 'void' is not assignable to type 'string'. +!!! 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/optionalFunctionArgAssignability.errors.txt b/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt index 43d7b633052..52fb45e40d2 100644 --- a/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt +++ b/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt @@ -1,10 +1,8 @@ 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'. - 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'. + 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'. ==== tests/cases/compiler/optionalFunctionArgAssignability.ts (1 errors) ==== @@ -17,10 +15,8 @@ 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: 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'. +!!! 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'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt b/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt index 4d8f23385fd..de02509d124 100644 --- a/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt +++ b/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/optionalParamAssignmentCompat.ts(10,5): error TS2322: Type '(p1?: string) => I1' is not assignable to type 'I1'. - 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'. + Types of parameters 'p1' and 'p1' are incompatible. + Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/optionalParamAssignmentCompat.ts (1 errors) ==== @@ -17,7 +16,6 @@ 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: 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'. +!!! 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 8e3237a80b1..98a07570c65 100644 --- a/tests/baselines/reference/optionalParamTypeComparison.errors.txt +++ b/tests/baselines/reference/optionalParamTypeComparison.errors.txt @@ -1,11 +1,9 @@ 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'. - 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'. + 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'. - 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'. + Types of parameters 'n' and 'b' are incompatible. + Type 'number' is not assignable to type 'boolean'. ==== tests/cases/compiler/optionalParamTypeComparison.ts (2 errors) ==== @@ -15,12 +13,10 @@ 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: 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'. +!!! 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: 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 +!!! 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/overloadResolutionOverCTLambda.errors.txt b/tests/baselines/reference/overloadResolutionOverCTLambda.errors.txt index 54e43e0b248..9fc11b681c7 100644 --- a/tests/baselines/reference/overloadResolutionOverCTLambda.errors.txt +++ b/tests/baselines/reference/overloadResolutionOverCTLambda.errors.txt @@ -1,6 +1,5 @@ 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'. - Signature '(item: number): boolean' has no corresponding signature in '(a: number) => number' - Type 'number' is not assignable to type 'boolean'. + Type 'number' is not assignable to type 'boolean'. ==== tests/cases/compiler/overloadResolutionOverCTLambda.ts (1 errors) ==== @@ -8,5 +7,4 @@ 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: 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 +!!! 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 9658555f35b..45c9f99b691 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -4,10 +4,9 @@ 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'. - 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'. + 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'. @@ -49,8 +48,7 @@ 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: 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'. +!!! 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 edc11299c9e..daf057c9ebd 100644 --- a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt @@ -1,12 +1,10 @@ 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; }'. - 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 '{}'. + 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; }'. - 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; }'. + 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'. @@ -19,17 +17,15 @@ 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: 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 '{}'. +!!! 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: 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 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 c141b59e993..bc628ac485b 100644 --- a/tests/baselines/reference/parseTypes.errors.txt +++ b/tests/baselines/reference/parseTypes.errors.txt @@ -1,7 +1,5 @@ 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'. @@ -20,11 +18,9 @@ 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; }'. diff --git a/tests/baselines/reference/parser536727.errors.txt b/tests/baselines/reference/parser536727.errors.txt index 70841efd89f..4204e62c93b 100644 --- a/tests/baselines/reference/parser536727.errors.txt +++ b/tests/baselines/reference/parser536727.errors.txt @@ -1,9 +1,7 @@ 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'. - Signature '(x: string): string' has no corresponding signature in '() => (x: string) => string' - Type '(x: string) => string' is not assignable to type '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'. - Signature '(x: string): string' has no corresponding signature in '() => (x: string) => string' - Type '(x: string) => string' is not assignable to type 'string'. + Type '(x: string) => string' is not assignable to type 'string'. ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser536727.ts (2 errors) ==== @@ -16,11 +14,9 @@ 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: Signature '(x: string): string' has no corresponding signature in '() => (x: string) => string' -!!! error TS2345: Type '(x: string) => string' is not assignable to type '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: Signature '(x: string): string' has no corresponding signature in '() => (x: string) => string' -!!! error TS2345: Type '(x: string) => string' is not assignable to type '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/promiseChaining1.errors.txt b/tests/baselines/reference/promiseChaining1.errors.txt index da593b4086c..bd3e52fcc1c 100644 --- a/tests/baselines/reference/promiseChaining1.errors.txt +++ b/tests/baselines/reference/promiseChaining1.errors.txt @@ -1,7 +1,6 @@ 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'. - 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'. + Type 'string' is not assignable to type 'Function'. + Property 'apply' is missing in type 'String'. ==== tests/cases/compiler/promiseChaining1.ts (1 errors) ==== @@ -14,9 +13,8 @@ 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: 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'. +!!! 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 acdaad94bef..f12baebd4dc 100644 --- a/tests/baselines/reference/promiseChaining2.errors.txt +++ b/tests/baselines/reference/promiseChaining2.errors.txt @@ -1,7 +1,6 @@ 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'. - 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'. + Type 'string' is not assignable to type 'Function'. + Property 'apply' is missing in type 'String'. ==== tests/cases/compiler/promiseChaining2.ts (1 errors) ==== @@ -14,9 +13,8 @@ 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: 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'. +!!! 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 0787189e2e0..a74938f5dd9 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -1,75 +1,50 @@ 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. @@ -80,35 +55,27 @@ 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; }'. - 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'. + Types of parameters 'success' and 'success' are incompatible. + Type '(value: string) => IPromise' is not assignable to type '(value: number) => Promise'. + Types of parameters 'value' and 'value' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations.ts(156,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + Type 'Promise' is not assignable to type 'IPromise'. + Types of property 'then' are incompatible. + Type '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. + Types of parameters 'success' and 'success' are incompatible. + Type '(value: number) => Promise' is not assignable to type '(value: string) => IPromise'. + Types of parameters 'value' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/promisePermutations.ts (33 errors) ==== @@ -188,10 +155,9 @@ 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: 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'. +!!! 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; @@ -199,100 +165,84 @@ 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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; @@ -301,28 +251,23 @@ 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 @@ -335,15 +280,12 @@ 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 @@ -375,47 +317,39 @@ 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: 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'. +!!! error TS2453: Types of parameters 'success' and 'success' are incompatible. +!!! error TS2453: Type '(value: string) => IPromise' is not assignable to type '(value: number) => Promise'. +!!! error TS2453: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2453: Type 'string' is not assignable to type 'number'. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. -!!! error TS2345: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! error TS2345: Type 'Promise' is not assignable to type 'IPromise'. +!!! error TS2345: Types of property 'then' are incompatible. +!!! error TS2345: Type '{ (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; }'. +!!! error TS2345: Types of parameters 'success' and 'success' are incompatible. +!!! error TS2345: Type '(value: number) => Promise' is not assignable to type '(value: string) => IPromise'. +!!! error TS2345: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index 054cdec66c9..8afceeae0fd 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -1,75 +1,50 @@ 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. @@ -80,35 +55,27 @@ 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'. - 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'. + 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'. 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. ==== tests/cases/compiler/promisePermutations2.ts (33 errors) ==== @@ -187,10 +154,9 @@ 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: 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'. +!!! 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; @@ -198,100 +164,84 @@ 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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; @@ -300,28 +250,23 @@ 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 @@ -334,15 +279,12 @@ 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 @@ -374,47 +316,39 @@ 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: 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'. +!!! 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'. 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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'. 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 5d414cf4176..b17021a02b9 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -1,79 +1,53 @@ 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. @@ -84,42 +58,32 @@ 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; }'. - 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'. + 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'. 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. 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'. - 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'. + 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'. ==== tests/cases/compiler/promisePermutations3.ts (35 errors) ==== @@ -193,10 +157,9 @@ 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: 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'. +!!! 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); @@ -204,9 +167,8 @@ 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: 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: 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; @@ -214,100 +176,84 @@ 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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; @@ -316,28 +262,23 @@ 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 @@ -350,15 +291,12 @@ 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 @@ -390,47 +328,39 @@ 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: 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'. +!!! 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'. 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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'. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok @@ -439,10 +369,8 @@ 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: 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'. +!!! 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'. var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok \ No newline at end of file diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt index 9bc82f92ff3..4c1b392245f 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.errors.txt +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -2,8 +2,7 @@ tests/cases/compiler/recursiveFunctionTypes.ts(1,35): error TS2322: Type 'number 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'. - Signature '(): number' has no corresponding signature in '() => typeof fn' - Type '() => typeof fn' is not assignable to type 'number'. + 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'. @@ -32,8 +31,7 @@ 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: Signature '(): number' has no corresponding signature in '() => typeof fn' -!!! error TS2322: Type '() => typeof fn' is not assignable to type 'number'. +!!! error TS2322: Type '() => typeof fn' is not assignable to type 'number'. var f: () => typeof g; var g: () => typeof f; diff --git a/tests/baselines/reference/requiredInitializedParameter2.errors.txt b/tests/baselines/reference/requiredInitializedParameter2.errors.txt index 493f9e49f23..5dcec536e1b 100644 --- a/tests/baselines/reference/requiredInitializedParameter2.errors.txt +++ b/tests/baselines/reference/requiredInitializedParameter2.errors.txt @@ -1,7 +1,6 @@ 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) ==== @@ -14,6 +13,5 @@ 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 cf6c70b58f3..2ea07395099 100644 --- a/tests/baselines/reference/restArgAssignmentCompat.errors.txt +++ b/tests/baselines/reference/restArgAssignmentCompat.errors.txt @@ -1,8 +1,7 @@ tests/cases/compiler/restArgAssignmentCompat.ts(7,1): error TS2322: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void'. - 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'. + 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) ==== @@ -15,9 +14,8 @@ 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: 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'. +!!! 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 f490027f870..db23c2a19f6 100644 --- a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt +++ b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt @@ -1,6 +1,5 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/staticMemberAssignsToConstructorFunctionMembers.ts(7,9): error TS2322: Type '() => void' is not assignable to type '(x: number) => number'. - Signature '(x: number): number' has no corresponding signature in '() => void' - Type 'void' is not assignable to type 'number'. + Type 'void' is not assignable to type 'number'. ==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/staticMemberAssignsToConstructorFunctionMembers.ts (1 errors) ==== @@ -13,8 +12,7 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclara C.bar = () => { } // error ~~~~~ !!! error TS2322: Type '() => void' is not assignable to type '(x: number) => number'. -!!! error TS2322: Signature '(x: number): number' has no corresponding signature in '() => void' -!!! error TS2322: Type 'void' is not assignable to type 'number'. +!!! 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 aee87f77764..ed6450ad329 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.errors.txt +++ b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.errors.txt @@ -1,6 +1,5 @@ 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"'. - Signature '(x: "foo"): "foo"' has no corresponding signature in '(y: "foo" | "bar") => string' - Type 'string' is not assignable to type '"foo"'. + Type 'string' is not assignable to type '"foo"'. ==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterConstraint02.ts (1 errors) ==== @@ -12,6 +11,5 @@ 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: Signature '(x: "foo"): "foo"' has no corresponding signature in '(y: "foo" | "bar") => string' -!!! error TS2345: Type 'string' is not assignable to type '"foo"'. +!!! 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 24caddf4849..3821c707f4b 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesA.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesA.errors.txt @@ -1,6 +1,5 @@ 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'. - Signature '(x: number): number' has no corresponding signature in '(x: number) => string' - Type 'string' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesA.ts (1 errors) ==== @@ -8,5 +7,4 @@ 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: 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 +!!! 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 1ae866d4722..b5d23da2241 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt @@ -1,11 +1,9 @@ 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) ==== @@ -32,7 +30,6 @@ 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 } @@ -67,7 +64,6 @@ 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 aee119d6f73..f4a141ff390 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesWithRestParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesWithRestParameters.errors.txt @@ -1,69 +1,58 @@ 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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) ==== @@ -89,9 +78,8 @@ 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: 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'. +!!! 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 } @@ -112,9 +100,8 @@ 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: 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'. +!!! 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 } @@ -145,9 +132,8 @@ 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: 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'. +!!! 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 } @@ -182,9 +168,8 @@ 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: 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'. +!!! 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 } @@ -193,9 +178,8 @@ 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: 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'. +!!! 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 } @@ -204,9 +188,8 @@ 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: 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'. +!!! 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 } @@ -215,9 +198,8 @@ 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: 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'. +!!! 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 } @@ -230,9 +212,8 @@ 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: 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'. +!!! 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 } @@ -245,9 +226,8 @@ 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: 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'. +!!! 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 } @@ -260,9 +240,8 @@ 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: 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'. +!!! 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 } @@ -271,9 +250,8 @@ 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: 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'. +!!! 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 54eec881c14..da742fcd69c 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt @@ -1,8 +1,7 @@ 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; }'. - Signature '(x: string): number' has no corresponding signature in '(x: string) => string' - Type 'string' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithSpecializedSignatures.ts (1 errors) ==== @@ -80,8 +79,7 @@ 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: Signature '(x: string): number' has no corresponding signature in '(x: string) => string' -!!! error TS2430: Type 'string' is not assignable to type 'number'. +!!! 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 a30feba51c9..e041b1cdce0 100644 --- a/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt @@ -1,11 +1,9 @@ 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) ==== @@ -32,7 +30,6 @@ 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 } @@ -67,7 +64,6 @@ 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 fd9e6faa9ec..8a885a2455f 100644 --- a/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt +++ b/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt @@ -1,8 +1,7 @@ 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; }'. - Signature 'new (x: string): number' has no corresponding signature in 'new (x: string) => string' - Type 'string' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithSpecializedSignatures.ts (1 errors) ==== @@ -80,8 +79,7 @@ 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: Signature 'new (x: string): number' has no corresponding signature in 'new (x: string) => string' -!!! error TS2430: Type 'string' is not assignable to type 'number'. +!!! 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 316b5713835..e8f50236cba 100644 --- a/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt @@ -1,27 +1,21 @@ 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) ==== @@ -49,7 +43,6 @@ 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 } @@ -84,7 +77,6 @@ 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 } @@ -147,7 +139,6 @@ 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; } @@ -182,7 +173,6 @@ 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; } @@ -245,7 +235,6 @@ 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 } @@ -280,7 +269,6 @@ 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 66dd34f9cb6..27066058238 100644 --- a/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt @@ -1,27 +1,21 @@ 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) ==== @@ -49,7 +43,6 @@ 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 } @@ -84,7 +77,6 @@ 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 } @@ -147,7 +139,6 @@ 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; } @@ -182,7 +173,6 @@ 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; } @@ -245,7 +235,6 @@ 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 } @@ -280,7 +269,6 @@ 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 58ff17544f9..25cba184e25 100644 --- a/tests/baselines/reference/symbolProperty24.errors.txt +++ b/tests/baselines/reference/symbolProperty24.errors.txt @@ -1,8 +1,7 @@ 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'. - Signature '(): boolean' has no corresponding signature in '() => string' - Type 'string' is not assignable to type 'boolean'. + Type 'string' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/Symbols/symbolProperty24.ts (1 errors) ==== @@ -15,8 +14,7 @@ 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: Signature '(): boolean' has no corresponding signature in '() => string' -!!! error TS2420: Type 'string' is not assignable to type 'boolean'. +!!! error TS2420: Type 'string' is not assignable to type 'boolean'. [Symbol.toPrimitive]() { return ""; } diff --git a/tests/baselines/reference/tupleTypes.errors.txt b/tests/baselines/reference/tupleTypes.errors.txt index c1ef7f59454..8f418f98157 100644 --- a/tests/baselines/reference/tupleTypes.errors.txt +++ b/tests/baselines/reference/tupleTypes.errors.txt @@ -10,15 +10,13 @@ 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'. - 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'. + 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'. - Signature '(): number' has no corresponding signature in '() => number | {}' - Type 'number | {}' is not assignable to type 'number'. - Type '{}' is not assignable to type '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'. @@ -93,18 +91,16 @@ 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: 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'. +!!! 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: 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'. +!!! 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 ecfb70a7776..d058426b9c9 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt @@ -1,17 +1,14 @@ 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. @@ -92,9 +89,8 @@ 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: 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'. +!!! 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 @@ -107,9 +103,8 @@ 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: 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'. +!!! 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 @@ -122,9 +117,8 @@ 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: 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'. +!!! 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 dd9e29b7c31..9bd25dda4e6 100644 --- a/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt @@ -1,16 +1,13 @@ 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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) ==== @@ -25,25 +22,22 @@ 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: 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'. +!!! 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: 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'. +!!! 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: 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'. +!!! 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 e949a0a2fd8..eb74ff0ade0 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.errors.txt @@ -1,7 +1,6 @@ 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)'. - 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)'. + 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) ==== @@ -13,6 +12,5 @@ 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: 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 +!!! 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 3f0390ec46a..0c1e8cc4e97 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt @@ -4,18 +4,15 @@ 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'. - 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'. + 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'. - 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'. + 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'. - 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'. + 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'. @@ -83,9 +80,8 @@ 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: 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'. +!!! 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 @@ -95,9 +91,8 @@ 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: 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'. +!!! 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'. @@ -109,9 +104,8 @@ 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: 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'. +!!! 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 fb17775bc31..92d9d21f0cc 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt +++ b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt @@ -14,18 +14,14 @@ 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'. - 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'. + 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): p1 is A' has no corresponding signature in '(p1: any, p2: any) => boolean' - Signature '(p1: any, p2: any): boolean' must have a type predicate. + 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'. - 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'. + 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. @@ -151,17 +147,15 @@ 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: 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'. +!!! 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): 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. +!!! error TS2322: Signature '(p1: any, p2: any): boolean' must have a type predicate. return true; }; @@ -170,9 +164,8 @@ 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: 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'. +!!! 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; }; @@ -181,7 +174,6 @@ 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/typeParameterArgumentEquivalence.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt index 789820116ba..f47266f2850 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt @@ -1,11 +1,9 @@ tests/cases/compiler/typeParameterArgumentEquivalence.ts(4,5): error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: number) => boolean'. - 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'. + 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'. - 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'. + Types of parameters 'item' and 'item' are incompatible. + Type 'number' is not assignable to type 'T'. ==== tests/cases/compiler/typeParameterArgumentEquivalence.ts (2 errors) ==== @@ -15,14 +13,12 @@ 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: 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'. +!!! 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: 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'. +!!! 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 a50fd533ae6..2aa8d77ba6d 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence2.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence2.errors.txt @@ -1,11 +1,9 @@ tests/cases/compiler/typeParameterArgumentEquivalence2.ts(4,5): error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: U) => boolean'. - 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'. + 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'. - 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'. + Types of parameters 'item' and 'item' are incompatible. + Type 'U' is not assignable to type 'T'. ==== tests/cases/compiler/typeParameterArgumentEquivalence2.ts (2 errors) ==== @@ -15,14 +13,12 @@ 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: 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'. +!!! 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: 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'. +!!! 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 50e33c7afa4..1f126d7c00d 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence3.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence3.errors.txt @@ -1,9 +1,7 @@ tests/cases/compiler/typeParameterArgumentEquivalence3.ts(4,5): error TS2322: Type '(item: any) => boolean' is not assignable to type '(item: any) => T'. - Signature '(item: any): T' has no corresponding signature in '(item: any) => boolean' - Type 'boolean' is not assignable to type 'T'. + 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'. - Signature '(item: any): boolean' has no corresponding signature in '(item: any) => T' - Type 'T' is not assignable to type 'boolean'. + Type 'T' is not assignable to type 'boolean'. ==== tests/cases/compiler/typeParameterArgumentEquivalence3.ts (2 errors) ==== @@ -13,12 +11,10 @@ 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: Signature '(item: any): T' has no corresponding signature in '(item: any) => boolean' -!!! error TS2322: Type 'boolean' is not assignable to type 'T'. +!!! 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: Signature '(item: any): boolean' has no corresponding signature in '(item: any) => T' -!!! error TS2322: Type 'T' is not assignable to type 'boolean'. +!!! 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 68ab8dc28df..c7b19e8725c 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence4.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence4.errors.txt @@ -1,9 +1,7 @@ tests/cases/compiler/typeParameterArgumentEquivalence4.ts(4,5): error TS2322: 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'. + 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'. - Signature '(item: any): T' has no corresponding signature in '(item: any) => U' - Type 'U' is not assignable to type 'T'. + Type 'U' is not assignable to type 'T'. ==== tests/cases/compiler/typeParameterArgumentEquivalence4.ts (2 errors) ==== @@ -13,12 +11,10 @@ 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: Signature '(item: any): U' has no corresponding signature in '(item: any) => T' -!!! error TS2322: Type 'T' is not assignable to type 'U'. +!!! 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: Signature '(item: any): T' has no corresponding signature in '(item: any) => U' -!!! error TS2322: Type 'U' is not assignable to type 'T'. +!!! 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 8e1ac388a82..82290733a9e 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence5.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence5.errors.txt @@ -1,13 +1,9 @@ tests/cases/compiler/typeParameterArgumentEquivalence5.ts(4,5): error TS2322: 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 '(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'. + Type '(item: any) => T' is not assignable to type '(item: any) => U'. + 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'. - 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'. + Type '(item: any) => U' is not assignable to type '(item: any) => T'. + Type 'U' is not assignable to type 'T'. ==== tests/cases/compiler/typeParameterArgumentEquivalence5.ts (2 errors) ==== @@ -17,16 +13,12 @@ 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: 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'. +!!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U'. +!!! 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: 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'. +!!! error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T'. +!!! 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 8d926a14378..5a6047222ee 100644 --- a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments2.errors.txt +++ b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments2.errors.txt @@ -1,7 +1,6 @@ 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'. - 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'. + Type 'A' is not assignable to type 'B'. + Property 'b' is missing in type 'A'. ==== tests/cases/compiler/typeParameterFixingWithContextSensitiveArguments2.ts (1 errors) ==== @@ -14,6 +13,5 @@ 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: 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 +!!! 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 c93aa87f44b..cd0801f7ba9 100644 --- a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments3.errors.txt +++ b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments3.errors.txt @@ -1,7 +1,6 @@ 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'. - 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'. + Type 'A' is not assignable to type 'B'. + Property 'b' is missing in type 'A'. ==== tests/cases/compiler/typeParameterFixingWithContextSensitiveArguments3.ts (1 errors) ==== @@ -14,6 +13,5 @@ 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: 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 +!!! 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/undeclaredModuleError.errors.txt b/tests/baselines/reference/undeclaredModuleError.errors.txt index 3c1f930856c..74e36318595 100644 --- a/tests/baselines/reference/undeclaredModuleError.errors.txt +++ b/tests/baselines/reference/undeclaredModuleError.errors.txt @@ -1,7 +1,6 @@ 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'. - Signature '(stat: any, name: string): boolean' has no corresponding signature in '() => void' - Type 'void' is not assignable to type 'boolean'. + Type 'void' is not assignable to type 'boolean'. tests/cases/compiler/undeclaredModuleError.ts(11,41): error TS2304: Cannot find name 'IDoNotExist'. @@ -20,8 +19,7 @@ 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: Signature '(stat: any, name: string): boolean' has no corresponding signature in '() => void' -!!! error TS2345: Type 'void' is not assignable to type 'boolean'. +!!! error TS2345: Type 'void' is not assignable to type 'boolean'. files.forEach((file) => { var fullPath = join(IDoNotExist); ~~~~~~~~~~~