From db230a2a0dfaaa253e85c19293ea98ac01fd3bd4 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 2 Sep 2016 10:31:16 -0700 Subject: [PATCH] Accept new baselines --- .../reference/abstractProperty.types | 2 +- .../reference/assignmentCompatBug2.errors.txt | 24 ++++++------- ...ignmentCompatWithCallSignatures.errors.txt | 16 ++++----- ...ignaturesWithOptionalParameters.errors.txt | 8 ++--- ...allSignaturesWithRestParameters.errors.txt | 36 +++++++++---------- .../reference/contextualTyping23.types | 4 +-- .../reference/contextualTyping24.errors.txt | 4 +-- .../reference/contextualTyping39.errors.txt | 8 ++--- ...ctionExpressionsAndReturnAnnotations.types | 4 +-- .../contextuallyTypingOrOperator.types | 6 ++-- .../contextuallyTypingOrOperator2.types | 6 ++-- ...veryTypeWithAnnotationAndInitializer.types | 4 +-- ...AnnotationAndInvalidInitializer.errors.txt | 8 ++--- .../exportDefaultAsyncFunction2.types | 2 +- ...backToBindingPatternForTypeInference.types | 6 ++-- tests/baselines/reference/forStatements.types | 4 +-- .../reference/functionAssignmentError.types | 4 +-- .../functionExpressionContextualTyping1.types | 12 +++---- ...tionExpressionContextualTyping2.errors.txt | 12 +++---- ...CallWithFunctionTypedArguments5.errors.txt | 16 ++++----- ...ericFunctionsWithOptionalParameters3.types | 4 +-- .../reference/genericTypeAliases.types | 4 +-- .../reference/incompatibleTypes.errors.txt | 4 +-- .../inferenceFromParameterlessLambda.types | 2 +- .../interfaceWithPropertyOfEveryType.types | 6 ++-- tests/baselines/reference/ipromise2.types | 2 +- tests/baselines/reference/ipromise4.types | 2 +- tests/baselines/reference/neverType.types | 2 +- .../reference/noImplicitReturnsInAsync1.types | 4 +-- .../reference/objectLitGetterSetter.types | 8 ++--- .../optionalAccessorsInInterface1.types | 12 +++---- .../overloadOnConstAsTypeAnnotation.types | 2 +- ...loadOnConstNoAnyImplementation2.errors.txt | 8 ++--- ...verloadOnConstNoStringImplementation.types | 6 ++-- ...dOnConstNoStringImplementation2.errors.txt | 8 ++--- ...lbacksWithDifferingOptionalityOnArgs.types | 4 +-- .../baselines/reference/promiseChaining.types | 2 +- .../reference/promiseChaining1.errors.txt | 8 ++--- .../reference/promiseChaining2.errors.txt | 8 ++--- tests/baselines/reference/promiseType.types | 14 ++++---- .../propagationOfPromiseInitialization.types | 4 +-- .../subtypingWithCallSignatures.types | 8 ++--- .../subtypingWithCallSignaturesA.errors.txt | 8 ++--- .../reference/targetTypeObjectLiteral.types | 6 ++-- .../reference/thisTypeInFunctions.types | 20 +++++------ .../reference/thisTypeInFunctions2.types | 4 +-- ...entInferenceConstructSignatures.errors.txt | 8 ++--- .../typeArgumentInferenceErrors.errors.txt | 8 ++--- ...rgumentInferenceWithConstraints.errors.txt | 8 ++--- .../reference/typeInferenceFixEarly.types | 2 +- .../unionAndIntersectionInference1.types | 4 +-- .../reference/unionTypeInference.types | 4 +-- .../voidFunctionAssignmentCompat.types | 6 ++-- 53 files changed, 193 insertions(+), 193 deletions(-) diff --git a/tests/baselines/reference/abstractProperty.types b/tests/baselines/reference/abstractProperty.types index b139a9c1cb7..aa0d1c6917a 100644 --- a/tests/baselines/reference/abstractProperty.types +++ b/tests/baselines/reference/abstractProperty.types @@ -51,7 +51,7 @@ class C extends B { >"edge" : "edge" readonly ro = "readonly please"; ->ro : string +>ro : "readonly please" >"readonly please" : "readonly please" readonlyProp: string; // don't have to give a value, in fact diff --git a/tests/baselines/reference/assignmentCompatBug2.errors.txt b/tests/baselines/reference/assignmentCompatBug2.errors.txt index 4acdc0d8663..29ba96e6586 100644 --- a/tests/baselines/reference/assignmentCompatBug2.errors.txt +++ b/tests/baselines/reference/assignmentCompatBug2.errors.txt @@ -4,12 +4,12 @@ tests/cases/compiler/assignmentCompatBug2.ts(3,8): error TS2322: Type '{ a: numb Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. tests/cases/compiler/assignmentCompatBug2.ts(5,13): error TS2322: Type '{ b: number; a: number; }' is not assignable to type '{ b: number; }'. Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. -tests/cases/compiler/assignmentCompatBug2.ts(15,1): error TS2322: Type '{ f: (n: number) => 0; g: (s: string) => 0; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. - Property 'm' is missing in type '{ f: (n: number) => 0; g: (s: string) => 0; }'. -tests/cases/compiler/assignmentCompatBug2.ts(20,1): error TS2322: Type '{ f: (n: number) => 0; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. - Property 'g' is missing in type '{ f: (n: number) => 0; m: number; }'. -tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: number) => 0; g: (s: string) => 0; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. - Property 'm' is missing in type '{ f: (n: number) => 0; g: (s: string) => 0; n: number; k: (a: any) => any; }'. +tests/cases/compiler/assignmentCompatBug2.ts(15,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. + Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'. +tests/cases/compiler/assignmentCompatBug2.ts(20,1): error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. + Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'. +tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. + Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'. ==== tests/cases/compiler/assignmentCompatBug2.ts (6 errors) ==== @@ -38,16 +38,16 @@ tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: b3 = { ~~ -!!! error TS2322: Type '{ f: (n: number) => 0; g: (s: string) => 0; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. -!!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => 0; g: (s: string) => 0; }'. +!!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +!!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'. f: (n) => { return 0; }, g: (s) => { return 0; }, }; // error b3 = { ~~ -!!! error TS2322: Type '{ f: (n: number) => 0; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. -!!! error TS2322: Property 'g' is missing in type '{ f: (n: number) => 0; m: number; }'. +!!! error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +!!! error TS2322: Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'. f: (n) => { return 0; }, m: 0, }; // error @@ -62,8 +62,8 @@ tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: b3 = { ~~ -!!! error TS2322: Type '{ f: (n: number) => 0; g: (s: string) => 0; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. -!!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => 0; g: (s: string) => 0; n: number; k: (a: any) => any; }'. +!!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +!!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'. f: (n) => { return 0; }, g: (s) => { return 0; }, n: 0, diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt index 6e1db59ea81..c5914e59386 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt @@ -4,10 +4,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(36,1): error TS2322: Type '(x: string) => void' is not assignable to type 'T'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(37,1): error TS2322: Type '(x: string) => 1' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(37,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(38,1): error TS2322: Type '(x: string) => ""' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(38,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(39,1): error TS2322: Type 'S2' is not assignable to type '(x: number) => void'. @@ -16,10 +16,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(40,1): error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(41,1): error TS2322: Type '(x: string) => 1' is not assignable to type '(x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(41,1): error TS2322: Type '(x: string) => number' is not assignable to type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(42,1): error TS2322: Type '(x: string) => ""' is not assignable to type '(x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(42,1): error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. @@ -71,12 +71,12 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'number' is not assignable to type 'string'. t = (x: string) => 1; ~ -!!! error TS2322: Type '(x: string) => 1' is not assignable to type 'T'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. t = function (x: string) { return ''; } ~ -!!! error TS2322: Type '(x: string) => ""' is not assignable to type 'T'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. a = s2; @@ -91,12 +91,12 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'number' is not assignable to type 'string'. a = (x: string) => 1; ~ -!!! error TS2322: Type '(x: string) => 1' is not assignable to type '(x: number) => void'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type '(x: number) => void'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. a = function (x: string) { return ''; } ~ -!!! error TS2322: Type '(x: string) => ""' is not assignable to type '(x: number) => void'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => void'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt index 86e7fee9e3f..f89bbfa5798 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(16,5): error TS2322: Type '(x: number) => 1' is not assignable to type '() => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(16,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => 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'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(22,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '() => 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'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(39,5): error TS2322: Type '(x: number, y: number) => 1' is not assignable to type '(x: number) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(39,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. 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'. @@ -25,7 +25,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = (x?: number) => 1; // ok, same number of required params a = (x: number) => 1; // error, too many required params ~ -!!! error TS2322: Type '(x: number) => 1' is not assignable to type '() => number'. +!!! error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. a = b.a; // ok a = b.a2; // ok a = b.a3; // error @@ -58,7 +58,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = (x: number) => 1; // ok, same number of required params a3 = (x: number, y: number) => 1; // error, too many required params ~~ -!!! error TS2322: Type '(x: number, y: number) => 1' is not assignable to type '(x: number) => number'. +!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. a3 = b.a; // ok a3 = b.a2; // ok a3 = b.a3; // ok diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt index e56968a5482..6b563ef2631 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt @@ -1,28 +1,28 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(13,5): error TS2322: Type '(...args: string[]) => 1' is not assignable to type '(...args: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(13,5): error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. Types of parameters 'args' and 'args' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(17,5): error TS2322: Type '(x?: string) => 1' is not assignable to type '(...args: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(17,5): error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. Types of parameters 'x' and 'args' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(26,5): error TS2322: Type '(x: number, ...args: string[]) => 1' is not assignable to type '(x: number, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(26,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. Types of parameters 'args' and 'z' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(35,5): error TS2322: Type '(x: number, y?: number, z?: number) => 1' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(35,5): error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. Types of parameters 'y' and 'y' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(36,5): error TS2322: Type '(x: number, ...z: number[]) => 1' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(36,5): error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. Types of parameters 'z' and 'y' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(37,5): error TS2322: Type '(x: string, y?: string, z?: string) => 1' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(37,5): error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(41,5): error TS2322: Type '(x?: number, y?: number) => 1' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(41,5): error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. Types of parameters 'y' and 'y' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(43,5): error TS2322: Type '(x: number, y?: number) => 1' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(43,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. Types of parameters 'y' and 'y' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2322: Type '(x: number, ...args: string[]) => 1' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. Types of parameters 'args' and 'z' are incompatible. Type 'number' is not assignable to type 'string'. @@ -42,7 +42,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = (...args: number[]) => 1; // ok, same number of required params a = (...args: string[]) => 1; // error, type mismatch ~ -!!! error TS2322: Type '(...args: string[]) => 1' is not assignable to type '(...args: number[]) => number'. +!!! error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. !!! error TS2322: Types of parameters 'args' and 'args' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. a = (x?: number) => 1; // ok, same number of required params @@ -50,7 +50,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme 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) => 1' is not assignable to type '(...args: number[]) => number'. +!!! error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. !!! error TS2322: Types of parameters 'x' and 'args' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. @@ -63,7 +63,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = (x: number, ...args: number[]) => 1; // ok, same number of required params a2 = (x: number, ...args: string[]) => 1; // should be type mismatch error ~~ -!!! error TS2322: Type '(x: number, ...args: string[]) => 1' is not assignable to type '(x: number, ...z: number[]) => number'. +!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. !!! error TS2322: Types of parameters 'args' and 'z' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. a2 = (x: number, y: number) => 1; // ok, rest param corresponds to infinite number of params @@ -76,17 +76,17 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = (x: number, y: string) => 1; // ok, all present params match a3 = (x: number, y?: number, z?: number) => 1; // error ~~ -!!! error TS2322: Type '(x: number, y?: number, z?: number) => 1' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. !!! error TS2322: Types of parameters 'y' and 'y' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. a3 = (x: number, ...z: number[]) => 1; // error ~~ -!!! error TS2322: Type '(x: number, ...z: number[]) => 1' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. !!! error TS2322: Types of parameters 'z' and 'y' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. a3 = (x: string, y?: string, z?: string) => 1; // error ~~ -!!! error TS2322: Type '(x: string, y?: string, z?: string) => 1' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. @@ -94,18 +94,18 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a4 = () => 1; // ok, fewer required params a4 = (x?: number, y?: number) => 1; // error, type mismatch ~~ -!!! error TS2322: Type '(x?: number, y?: number) => 1' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. !!! error TS2322: Types of parameters 'y' and 'y' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. 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) => 1' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. !!! error TS2322: Types of parameters 'y' and 'y' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. 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[]) => 1' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. !!! error TS2322: Types of parameters 'args' and 'z' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping23.types b/tests/baselines/reference/contextualTyping23.types index 605d0bd5c9d..351ee51c28d 100644 --- a/tests/baselines/reference/contextualTyping23.types +++ b/tests/baselines/reference/contextualTyping23.types @@ -3,9 +3,9 @@ var foo:(a:{():number; (i:number):number; })=>number; foo = function(a){return 5 >foo : (a: { (): number; (i: number): number; }) => number >a : { (): number; (i: number): number; } >i : number ->foo = function(a){return 5} : (a: { (): number; (i: number): number; }) => 5 +>foo = function(a){return 5} : (a: { (): number; (i: number): number; }) => number >foo : (a: { (): number; (i: number): number; }) => number ->function(a){return 5} : (a: { (): number; (i: number): number; }) => 5 +>function(a){return 5} : (a: { (): number; (i: number): number; }) => number >a : { (): number; (i: number): number; } >5 : 5 diff --git a/tests/baselines/reference/contextualTyping24.errors.txt b/tests/baselines/reference/contextualTyping24.errors.txt index bafe2070bba..ea973050625 100644 --- a/tests/baselines/reference/contextualTyping24.errors.txt +++ b/tests/baselines/reference/contextualTyping24.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/contextualTyping24.ts(1,55): error TS2322: Type '(this: void, a: string) => 5' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. +tests/cases/compiler/contextualTyping24.ts(1,55): error TS2322: Type '(this: void, a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. Types of parameters 'a' and 'a' are incompatible. Type '{ (): number; (i: number): number; }' is not assignable to type 'string'. @@ -6,6 +6,6 @@ tests/cases/compiler/contextualTyping24.ts(1,55): error TS2322: Type '(this: voi ==== tests/cases/compiler/contextualTyping24.ts (1 errors) ==== var foo:(a:{():number; (i:number):number; })=>number; foo = function(this: void, a:string){return 5}; ~~~ -!!! error TS2322: Type '(this: void, a: string) => 5' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. +!!! error TS2322: Type '(this: void, a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. !!! error TS2322: Types of parameters 'a' and 'a' are incompatible. !!! error TS2322: Type '{ (): number; (i: number): number; }' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping39.errors.txt b/tests/baselines/reference/contextualTyping39.errors.txt index 622afaeba59..9081480f4ba 100644 --- a/tests/baselines/reference/contextualTyping39.errors.txt +++ b/tests/baselines/reference/contextualTyping39.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/contextualTyping39.ts(1,11): error TS2352: Type '() => "err"' cannot be converted to type '() => number'. - Type '"err"' is not comparable to type 'number'. +tests/cases/compiler/contextualTyping39.ts(1,11): error TS2352: Type '() => string' cannot be converted to type '() => number'. + Type 'string' is not comparable to type 'number'. ==== tests/cases/compiler/contextualTyping39.ts (1 errors) ==== var foo = <{ (): number; }> function() { return "err"; }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2352: Type '() => "err"' cannot be converted to type '() => number'. -!!! error TS2352: Type '"err"' is not comparable to type 'number'. \ No newline at end of file +!!! error TS2352: Type '() => string' cannot be converted to type '() => number'. +!!! error TS2352: Type 'string' is not comparable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types b/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types index bb66c7fcd76..7fc2f88f326 100644 --- a/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types +++ b/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types @@ -29,11 +29,11 @@ foo((y): (y2: number) => void => { foo((y: string) => { >foo((y: string) => { return y2 => { var z = y2.toFixed(); // Should be string return 0; };}) : any >foo : (x: (y: string) => (y2: number) => void) => any ->(y: string) => { return y2 => { var z = y2.toFixed(); // Should be string return 0; };} : (y: string) => (y2: number) => 0 +>(y: string) => { return y2 => { var z = y2.toFixed(); // Should be string return 0; };} : (y: string) => (y2: number) => number >y : string return y2 => { ->y2 => { var z = y2.toFixed(); // Should be string return 0; } : (y2: number) => 0 +>y2 => { var z = y2.toFixed(); // Should be string return 0; } : (y2: number) => number >y2 : number var z = y2.toFixed(); // Should be string diff --git a/tests/baselines/reference/contextuallyTypingOrOperator.types b/tests/baselines/reference/contextuallyTypingOrOperator.types index d2f15ba7abe..3ca4ff4ee8f 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator.types +++ b/tests/baselines/reference/contextuallyTypingOrOperator.types @@ -11,9 +11,9 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; >s.length : number >s : string >length : number ->{ a: s => 1 } : { a: (s: string) => 1; } ->a : (s: string) => 1 ->s => 1 : (s: string) => 1 +>{ a: s => 1 } : { a: (s: string) => number; } +>a : (s: string) => number +>s => 1 : (s: string) => number >s : string >1 : 1 diff --git a/tests/baselines/reference/contextuallyTypingOrOperator2.types b/tests/baselines/reference/contextuallyTypingOrOperator2.types index b1deb1eb24d..f72e6f3e92e 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator2.types +++ b/tests/baselines/reference/contextuallyTypingOrOperator2.types @@ -11,9 +11,9 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; >s.length : number >s : string >length : number ->{ a: s => 1 } : { a: (s: string) => 1; } ->a : (s: string) => 1 ->s => 1 : (s: string) => 1 +>{ a: s => 1 } : { a: (s: string) => number; } +>a : (s: string) => number +>s => 1 : (s: string) => number >s : string >1 : 1 diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types index a3f2d3e3149..d1843aebb1a 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types @@ -135,7 +135,7 @@ var anOtherFunction: (x: string) => number = F; var aLambda: typeof F = (x) => 2; >aLambda : (x: string) => number >F : (x: string) => number ->(x) => 2 : (x: string) => 2 +>(x) => 2 : (x: string) => number >x : string >2 : 2 @@ -158,7 +158,7 @@ var aFunctionInModule: typeof M.F2 = (x) => 'this is a string'; >M.F2 : (x: number) => string >M : typeof M >F2 : (x: number) => string ->(x) => 'this is a string' : (x: number) => "this is a string" +>(x) => 'this is a string' : (x: number) => string >x : number >'this is a string' : "this is a string" diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt index c110ce1d6c6..5302f856c6f 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt @@ -20,8 +20,8 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(47,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(48,5): error TS2322: Type '(x: string) => "a string"' is not assignable to type '(x: string) => number'. - Type '"a string"' is not assignable to type 'number'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(48,5): error TS2322: Type '(x: string) => string' is not assignable to type '(x: string) => number'. + Type 'string' is not assignable to type 'number'. 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'. @@ -115,8 +115,8 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd !!! error TS2322: Type 'string' is not assignable to type 'number'. var aLambda: typeof F = (x) => 'a string'; ~~~~~~~ -!!! error TS2322: Type '(x: string) => "a string"' is not assignable to type '(x: string) => number'. -!!! error TS2322: Type '"a string"' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: string) => number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var aModule: typeof M = N; ~~~~~~~ diff --git a/tests/baselines/reference/exportDefaultAsyncFunction2.types b/tests/baselines/reference/exportDefaultAsyncFunction2.types index a9ff903e53a..baa41a10532 100644 --- a/tests/baselines/reference/exportDefaultAsyncFunction2.types +++ b/tests/baselines/reference/exportDefaultAsyncFunction2.types @@ -20,7 +20,7 @@ export default async(() => await(Promise.resolve(1))); >() => await(Promise.resolve(1)) : () => any >await(Promise.resolve(1)) : any >await : (...args: any[]) => any ->Promise.resolve(1) : Promise +>Promise.resolve(1) : Promise<1> >Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor >resolve : { (value: T | PromiseLike): Promise; (): Promise; } diff --git a/tests/baselines/reference/fallbackToBindingPatternForTypeInference.types b/tests/baselines/reference/fallbackToBindingPatternForTypeInference.types index 961642216c9..7b1a2d8e6ff 100644 --- a/tests/baselines/reference/fallbackToBindingPatternForTypeInference.types +++ b/tests/baselines/reference/fallbackToBindingPatternForTypeInference.types @@ -16,7 +16,7 @@ trans(({a}) => a); trans(([b,c]) => 'foo'); >trans(([b,c]) => 'foo') : number >trans : (f: (x: T) => string) => number ->([b,c]) => 'foo' : ([b, c]: [any, any]) => "foo" +>([b,c]) => 'foo' : ([b, c]: [any, any]) => string >b : any >c : any >'foo' : "foo" @@ -24,7 +24,7 @@ trans(([b,c]) => 'foo'); trans(({d: [e,f]}) => 'foo'); >trans(({d: [e,f]}) => 'foo') : number >trans : (f: (x: T) => string) => number ->({d: [e,f]}) => 'foo' : ({d: [e, f]}: { d: [any, any]; }) => "foo" +>({d: [e,f]}) => 'foo' : ({d: [e, f]}: { d: [any, any]; }) => string >d : any >e : any >f : any @@ -33,7 +33,7 @@ trans(({d: [e,f]}) => 'foo'); trans(([{g},{h}]) => 'foo'); >trans(([{g},{h}]) => 'foo') : number >trans : (f: (x: T) => string) => number ->([{g},{h}]) => 'foo' : ([{g}, {h}]: [{ g: any; }, { h: any; }]) => "foo" +>([{g},{h}]) => 'foo' : ([{g}, {h}]: [{ g: any; }, { h: any; }]) => string >g : any >h : any >'foo' : "foo" diff --git a/tests/baselines/reference/forStatements.types b/tests/baselines/reference/forStatements.types index aba3d17b63b..a6ae6ea9aa5 100644 --- a/tests/baselines/reference/forStatements.types +++ b/tests/baselines/reference/forStatements.types @@ -136,7 +136,7 @@ for(var anOtherFunction: (x: string) => number = F;;){} for(var aLambda: typeof F = (x) => 2;;){} >aLambda : (x: string) => number >F : (x: string) => number ->(x) => 2 : (x: string) => 2 +>(x) => 2 : (x: string) => number >x : string >2 : 2 @@ -159,7 +159,7 @@ for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} >M.F2 : (x: number) => string >M : typeof M >F2 : (x: number) => string ->(x) => 'this is a string' : (x: number) => "this is a string" +>(x) => 'this is a string' : (x: number) => string >x : number >'this is a string' : "this is a string" diff --git a/tests/baselines/reference/functionAssignmentError.types b/tests/baselines/reference/functionAssignmentError.types index 189b6eddf2d..3223a7b40f8 100644 --- a/tests/baselines/reference/functionAssignmentError.types +++ b/tests/baselines/reference/functionAssignmentError.types @@ -5,8 +5,8 @@ var func = function (){return "ONE";}; >"ONE" : "ONE" func = function (){return "ONE";}; ->func = function (){return "ONE";} : () => "ONE" +>func = function (){return "ONE";} : () => string >func : () => string ->function (){return "ONE";} : () => "ONE" +>function (){return "ONE";} : () => string >"ONE" : "ONE" diff --git a/tests/baselines/reference/functionExpressionContextualTyping1.types b/tests/baselines/reference/functionExpressionContextualTyping1.types index e9e6ad66a6d..58265c74aa2 100644 --- a/tests/baselines/reference/functionExpressionContextualTyping1.types +++ b/tests/baselines/reference/functionExpressionContextualTyping1.types @@ -14,7 +14,7 @@ var a0: (n: number, s: string) => number = (num, str) => { >a0 : (n: number, s: string) => number >n : number >s : string ->(num, str) => { num.toExponential(); return 0;} : (num: number, str: string) => 0 +>(num, str) => { num.toExponential(); return 0;} : (num: number, str: string) => number >num : number >str : string @@ -41,7 +41,7 @@ var a1: (c: Class) => number = (a1) => { >c : Class >Class : Class >Number : Number ->(a1) => { a1.foo(); return 1;} : (a1: Class) => 1 +>(a1) => { a1.foo(); return 1;} : (a1: Class) => number >a1 : Class a1.foo(); @@ -90,9 +90,9 @@ b2 = (foo, bar) => { return foo + 1; } >1 : 1 b2 = (foo, bar) => { return "hello"; } ->b2 = (foo, bar) => { return "hello"; } : (foo: number, bar: string) => "hello" +>b2 = (foo, bar) => { return "hello"; } : (foo: number, bar: string) => string >b2 : ((n: number, s: string) => number) | ((n: number, s: string) => string) ->(foo, bar) => { return "hello"; } : (foo: number, bar: string) => "hello" +>(foo, bar) => { return "hello"; } : (foo: number, bar: string) => string >foo : number >bar : string >"hello" : "hello" @@ -114,7 +114,7 @@ var b4: (n: E) => string = (number = 1) => { return "hello"; }; >b4 : (n: E) => string >n : E >E : E ->(number = 1) => { return "hello"; } : (number?: E) => "hello" +>(number = 1) => { return "hello"; } : (number?: E) => string >number : E >1 : 1 >"hello" : "hello" @@ -122,7 +122,7 @@ var b4: (n: E) => string = (number = 1) => { return "hello"; }; var b5: (n: {}) => string = (number = "string") => { return "hello"; }; >b5 : (n: {}) => string >n : {} ->(number = "string") => { return "hello"; } : (number?: {}) => "hello" +>(number = "string") => { return "hello"; } : (number?: {}) => string >number : {} >"string" : "string" >"hello" : "hello" diff --git a/tests/baselines/reference/functionExpressionContextualTyping2.errors.txt b/tests/baselines/reference/functionExpressionContextualTyping2.errors.txt index 6248f4e9b5b..6a3a7998f09 100644 --- a/tests/baselines/reference/functionExpressionContextualTyping2.errors.txt +++ b/tests/baselines/reference/functionExpressionContextualTyping2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping2.ts(11,1): error TS2322: Type '(foo: number, bar: string) => true' is not assignable to type '((n: number, s: string) => number) | ((n: number, s: string) => string)'. - Type '(foo: number, bar: string) => true' is not assignable to type '(n: number, s: string) => string'. - Type 'true' is not assignable to type 'string'. +tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping2.ts(11,1): error TS2322: Type '(foo: number, bar: string) => boolean' is not assignable to type '((n: number, s: string) => number) | ((n: number, s: string) => string)'. + Type '(foo: number, bar: string) => boolean' is not assignable to type '(n: number, s: string) => string'. + Type 'boolean' is not assignable to type 'string'. ==== tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping2.ts (1 errors) ==== @@ -16,6 +16,6 @@ tests/cases/conformance/expressions/contextualTyping/functionExpressionContextua var a1: typeof a0 | ((n: number, s: string) => string); a1 = (foo, bar) => { return true; } // Error ~~ -!!! error TS2322: Type '(foo: number, bar: string) => true' is not assignable to type '((n: number, s: string) => number) | ((n: number, s: string) => string)'. -!!! error TS2322: Type '(foo: number, bar: string) => true' is not assignable to type '(n: number, s: string) => string'. -!!! error TS2322: Type 'true' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type '(foo: number, bar: string) => boolean' is not assignable to type '((n: number, s: string) => number) | ((n: number, s: string) => string)'. +!!! error TS2322: Type '(foo: number, bar: string) => boolean' is not assignable to type '(n: number, s: string) => string'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt index fb7062dbcea..75ae76b1dbc 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(10,14): error TS2345: Argument of type '{ cb: (x: T, y: T) => ""; }' is not assignable to parameter of type '{ cb: (t: {}) => string; }'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(10,14): error TS2345: Argument of type '{ cb: (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: (t: {}) => string; }'. Types of property 'cb' are incompatible. - Type '(x: T, y: T) => ""' is not assignable to type '(t: {}) => string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(11,14): error TS2345: Argument of type '{ cb: (x: string, y: number) => ""; }' is not assignable to parameter of type '{ cb: (t: string) => string; }'. + Type '(x: T, y: T) => string' is not assignable to type '(t: {}) => string'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(11,14): error TS2345: Argument of type '{ cb: (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: (t: string) => string; }'. Types of property 'cb' are incompatible. - Type '(x: string, y: number) => ""' is not assignable to type '(t: string) => string'. + Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts (2 errors) ==== @@ -18,14 +18,14 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun // more args not allowed var r2 = foo({ cb: (x: T, y: T) => '' }); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ cb: (x: T, y: T) => ""; }' is not assignable to parameter of type '{ cb: (t: {}) => string; }'. +!!! error TS2345: Argument of type '{ cb: (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: (t: {}) => string; }'. !!! error TS2345: Types of property 'cb' are incompatible. -!!! error TS2345: Type '(x: T, y: T) => ""' is not assignable to type '(t: {}) => string'. +!!! error TS2345: Type '(x: T, y: T) => string' is not assignable to type '(t: {}) => string'. var r3 = foo({ cb: (x: string, y: number) => '' }); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ cb: (x: string, y: number) => ""; }' is not assignable to parameter of type '{ cb: (t: string) => string; }'. +!!! error TS2345: Argument of type '{ cb: (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: (t: string) => string; }'. !!! error TS2345: Types of property 'cb' are incompatible. -!!! error TS2345: Type '(x: string, y: number) => ""' is not assignable to type '(t: string) => string'. +!!! error TS2345: Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'. function foo2(arg: { cb: (t: T, t2: T) => U }) { return arg.cb(null, null); diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types index cba9effcdaa..133c5cc2063 100644 --- a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types @@ -63,7 +63,7 @@ var r3 = utils.mapReduce(c, (x) => { return 1 }, (y) => { return new Date() }); >utils : Utils >mapReduce : (c: Collection, mapper: (x: T) => U, reducer: (y: U) => V) => Collection >c : Collection ->(x) => { return 1 } : (x: string) => 1 +>(x) => { return 1 } : (x: string) => number >x : string >1 : 1 >(y) => { return new Date() } : (y: number) => Date @@ -78,7 +78,7 @@ var r4 = utils.mapReduce(c, (x: string) => { return 1 }, (y: number) => { return >utils : Utils >mapReduce : (c: Collection, mapper: (x: T) => U, reducer: (y: U) => V) => Collection >c : Collection ->(x: string) => { return 1 } : (x: string) => 1 +>(x: string) => { return 1 } : (x: string) => number >x : string >1 : 1 >(y: number) => { return new Date() } : (y: number) => Date diff --git a/tests/baselines/reference/genericTypeAliases.types b/tests/baselines/reference/genericTypeAliases.types index 3f5f0d71f2b..1cabaa8caa0 100644 --- a/tests/baselines/reference/genericTypeAliases.types +++ b/tests/baselines/reference/genericTypeAliases.types @@ -59,9 +59,9 @@ ls = "eager"; >"eager" : "eager" ls = () => "lazy"; ->ls = () => "lazy" : () => "lazy" +>ls = () => "lazy" : () => string >ls : Lazy ->() => "lazy" : () => "lazy" +>() => "lazy" : () => string >"lazy" : "lazy" type Foo = T | { x: Foo }; diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index 0939eb68c2b..4cd68470007 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -23,7 +23,7 @@ tests/cases/compiler/incompatibleTypes.ts(49,7): error TS2345: Argument of type tests/cases/compiler/incompatibleTypes.ts(66,47): error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. tests/cases/compiler/incompatibleTypes.ts(72,5): error TS2322: Type '5' is not assignable to type '() => string'. -tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => 0' is not assignable to type '() => any'. +tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. ==== tests/cases/compiler/incompatibleTypes.ts (9 errors) ==== @@ -135,5 +135,5 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => var fp1: () =>any = a => 0; ~~~ -!!! error TS2322: Type '(a: any) => 0' is not assignable to type '() => any'. +!!! error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. \ No newline at end of file diff --git a/tests/baselines/reference/inferenceFromParameterlessLambda.types b/tests/baselines/reference/inferenceFromParameterlessLambda.types index 907c2ab5468..1adf508226b 100644 --- a/tests/baselines/reference/inferenceFromParameterlessLambda.types +++ b/tests/baselines/reference/inferenceFromParameterlessLambda.types @@ -33,6 +33,6 @@ foo(n => n.length, () => 'hi'); >n.length : number >n : string >length : number ->() => 'hi' : () => "hi" +>() => 'hi' : () => string >'hi' : "hi" diff --git a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types index 533bc070702..07832f23fc3 100644 --- a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types +++ b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types @@ -80,7 +80,7 @@ interface Foo { var a: Foo = { >a : Foo >Foo : Foo ->{ a: 1, b: '', c: true, d: {}, e: null , f: [1], g: {}, h: (x: number) => 1, i: (x: T) => x, j: null, k: new C(), l: f1, m: M, n: {}, o: E.A} : { a: number; b: string; c: true; d: {}; e: null; f: number[]; g: {}; h: (x: number) => 1; i: (x: T) => T; j: Foo; k: C; l: () => void; m: typeof M; n: {}; o: E; } +>{ a: 1, b: '', c: true, d: {}, e: null , f: [1], g: {}, h: (x: number) => 1, i: (x: T) => x, j: null, k: new C(), l: f1, m: M, n: {}, o: E.A} : { a: number; b: string; c: true; d: {}; e: null; f: number[]; g: {}; h: (x: number) => number; i: (x: T) => T; j: Foo; k: C; l: () => void; m: typeof M; n: {}; o: E; } a: 1, >a : number @@ -112,8 +112,8 @@ var a: Foo = { >{} : {} h: (x: number) => 1, ->h : (x: number) => 1 ->(x: number) => 1 : (x: number) => 1 +>h : (x: number) => number +>(x: number) => 1 : (x: number) => number >x : number >1 : 1 diff --git a/tests/baselines/reference/ipromise2.types b/tests/baselines/reference/ipromise2.types index ac0df6ee4b5..e643bd7da4b 100644 --- a/tests/baselines/reference/ipromise2.types +++ b/tests/baselines/reference/ipromise2.types @@ -108,7 +108,7 @@ var p2 = p.then(function (s) { >p.then : { (success?: (value: string) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; } >p : Windows.Foundation.IPromise >then : { (success?: (value: string) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; } ->function (s) { return 34;} : (s: string) => 34 +>function (s) { return 34;} : (s: string) => number >s : string return 34; diff --git a/tests/baselines/reference/ipromise4.types b/tests/baselines/reference/ipromise4.types index 844afc05783..32461326c56 100644 --- a/tests/baselines/reference/ipromise4.types +++ b/tests/baselines/reference/ipromise4.types @@ -114,7 +114,7 @@ p.then(function (x) { return "hello"; } ).then(function (x) { return x } ); // s >p.then : { (success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: number) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; } >p : Windows.Foundation.IPromise >then : { (success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: number) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; } ->function (x) { return "hello"; } : (x: number) => "hello" +>function (x) { return "hello"; } : (x: number) => string >x : number >"hello" : "hello" >then : { (success?: (value: string) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; } diff --git a/tests/baselines/reference/neverType.types b/tests/baselines/reference/neverType.types index 69a2c4c7dfe..bdb1ff56c3e 100644 --- a/tests/baselines/reference/neverType.types +++ b/tests/baselines/reference/neverType.types @@ -215,7 +215,7 @@ let errorCallback = () => error("Error callback"); test(() => "hello"); >test(() => "hello") : string >test : (cb: () => string) => string ->() => "hello" : () => "hello" +>() => "hello" : () => string >"hello" : "hello" test(() => fail()); diff --git a/tests/baselines/reference/noImplicitReturnsInAsync1.types b/tests/baselines/reference/noImplicitReturnsInAsync1.types index 19da8fdfaf4..e143722eb4d 100644 --- a/tests/baselines/reference/noImplicitReturnsInAsync1.types +++ b/tests/baselines/reference/noImplicitReturnsInAsync1.types @@ -14,8 +14,8 @@ async function test(isError: boolean = false) { } let x = await Promise.resolve("The test is passed without an error."); >x : string ->await Promise.resolve("The test is passed without an error.") : string ->Promise.resolve("The test is passed without an error.") : Promise +>await Promise.resolve("The test is passed without an error.") : "The test is passed without an error." +>Promise.resolve("The test is passed without an error.") : Promise<"The test is passed without an error."> >Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor >resolve : { (value: T | PromiseLike): Promise; (): Promise; } diff --git a/tests/baselines/reference/objectLitGetterSetter.types b/tests/baselines/reference/objectLitGetterSetter.types index d973765c855..12801b65340 100644 --- a/tests/baselines/reference/objectLitGetterSetter.types +++ b/tests/baselines/reference/objectLitGetterSetter.types @@ -12,12 +12,12 @@ >"accProperty" : "accProperty" >({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : PropertyDescriptor >PropertyDescriptor : PropertyDescriptor ->({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : { get: () => 11; set: (v: any) => void; } ->{ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } } : { get: () => 11; set: (v: any) => void; } +>({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : { get: () => number; set: (v: any) => void; } +>{ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } } : { get: () => number; set: (v: any) => void; } get: function () { ->get : () => 11 ->function () { eval("public = 1;"); return 11; } : () => 11 +>get : () => number +>function () { eval("public = 1;"); return 11; } : () => number eval("public = 1;"); >eval("public = 1;") : any diff --git a/tests/baselines/reference/optionalAccessorsInInterface1.types b/tests/baselines/reference/optionalAccessorsInInterface1.types index d8751c252c3..c4894fd30dc 100644 --- a/tests/baselines/reference/optionalAccessorsInInterface1.types +++ b/tests/baselines/reference/optionalAccessorsInInterface1.types @@ -22,9 +22,9 @@ defineMyProperty({}, "name", { get: function () { return 5; } }); >defineMyProperty : (o: any, p: string, attributes: MyPropertyDescriptor) => any >{} : {} >"name" : "name" ->{ get: function () { return 5; } } : { get: () => 5; } ->get : () => 5 ->function () { return 5; } : () => 5 +>{ get: function () { return 5; } } : { get: () => number; } +>get : () => number +>function () { return 5; } : () => number >5 : 5 interface MyPropertyDescriptor2 { @@ -50,8 +50,8 @@ defineMyProperty2({}, "name", { get: function () { return 5; } }); >defineMyProperty2 : (o: any, p: string, attributes: MyPropertyDescriptor2) => any >{} : {} >"name" : "name" ->{ get: function () { return 5; } } : { get: () => 5; } ->get : () => 5 ->function () { return 5; } : () => 5 +>{ get: function () { return 5; } } : { get: () => number; } +>get : () => number +>function () { return 5; } : () => number >5 : 5 diff --git a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.types b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.types index ab0dd2ae8ae..382fddfb78a 100644 --- a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.types +++ b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.types @@ -3,7 +3,7 @@ var f: (x: 'hi') => number = (x: 'hi') => { return 1; }; >f : (x: "hi") => number >x : "hi" ->(x: 'hi') => { return 1; } : (x: "hi") => 1 +>(x: 'hi') => { return 1; } : (x: "hi") => number >x : "hi" >1 : 1 diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt index e09e6ef46f6..24047578ec6 100644 --- a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(12,18): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. -tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(18,9): error TS2345: Argument of type '(x: "bye") => 1' is not assignable to parameter of type '(x: "hi") => number'. +tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(18,9): error TS2345: Argument of type '(x: "bye") => number' is not assignable to parameter of type '(x: "hi") => number'. Types of parameters 'x' and 'x' are incompatible. Type '"hi"' is not assignable to type '"bye"'. -tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(21,9): error TS2345: Argument of type '(x: number) => 1' is not assignable to parameter of type '(x: "hi") => number'. +tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(21,9): error TS2345: Argument of type '(x: number) => number' is not assignable to parameter of type '(x: "hi") => number'. Types of parameters 'x' and 'x' are incompatible. Type '"hi"' is not assignable to type 'number'. @@ -29,13 +29,13 @@ tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(21,9): error TS2345: c.x1(1, (x: 'hi') => { return 1; } ); c.x1(1, (x: 'bye') => { return 1; } ); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: "bye") => 1' is not assignable to parameter of type '(x: "hi") => number'. +!!! error TS2345: Argument of type '(x: "bye") => number' is not assignable to parameter of type '(x: "hi") => number'. !!! error TS2345: Types of parameters 'x' and 'x' are incompatible. !!! error TS2345: Type '"hi"' is not assignable to type '"bye"'. c.x1(1, (x) => { return 1; } ); c.x1(1, (x: number) => { return 1; } ); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number) => 1' is not assignable to parameter of type '(x: "hi") => number'. +!!! error TS2345: Argument of type '(x: number) => number' is not assignable to parameter of type '(x: "hi") => number'. !!! error TS2345: Types of parameters 'x' and 'x' are incompatible. !!! error TS2345: Type '"hi"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstNoStringImplementation.types b/tests/baselines/reference/overloadOnConstNoStringImplementation.types index a4d13ef06a3..0fdbc97e380 100644 --- a/tests/baselines/reference/overloadOnConstNoStringImplementation.types +++ b/tests/baselines/reference/overloadOnConstNoStringImplementation.types @@ -50,7 +50,7 @@ function x2(a: number, cb: (x: any) => number) { var cb: (number) => number = (x: number) => 1; >cb : (number: any) => number >number : any ->(x: number) => 1 : (x: number) => 1 +>(x: number) => 1 : (x: number) => number >x : number >1 : 1 @@ -64,7 +64,7 @@ x2(1, (x: 'hi') => 1); // error >x2(1, (x: 'hi') => 1) : any >x2 : { (a: number, cb: (x: "hi") => number): any; (a: number, cb: (x: "bye") => number): any; } >1 : 1 ->(x: 'hi') => 1 : (x: "hi") => 1 +>(x: 'hi') => 1 : (x: "hi") => number >x : "hi" >1 : 1 @@ -72,7 +72,7 @@ x2(1, (x: string) => 1); >x2(1, (x: string) => 1) : any >x2 : { (a: number, cb: (x: "hi") => number): any; (a: number, cb: (x: "bye") => number): any; } >1 : 1 ->(x: string) => 1 : (x: string) => 1 +>(x: string) => 1 : (x: string) => number >x : string >1 : 1 diff --git a/tests/baselines/reference/overloadOnConstNoStringImplementation2.errors.txt b/tests/baselines/reference/overloadOnConstNoStringImplementation2.errors.txt index 90081d9259b..e7ac72eb052 100644 --- a/tests/baselines/reference/overloadOnConstNoStringImplementation2.errors.txt +++ b/tests/baselines/reference/overloadOnConstNoStringImplementation2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/overloadOnConstNoStringImplementation2.ts(18,9): error TS2345: Argument of type '(x: "bye") => 1' is not assignable to parameter of type '(x: "hi") => number'. +tests/cases/compiler/overloadOnConstNoStringImplementation2.ts(18,9): error TS2345: Argument of type '(x: "bye") => number' is not assignable to parameter of type '(x: "hi") => number'. Types of parameters 'x' and 'x' are incompatible. Type '"hi"' is not assignable to type '"bye"'. -tests/cases/compiler/overloadOnConstNoStringImplementation2.ts(20,9): error TS2345: Argument of type '(x: number) => 1' is not assignable to parameter of type '(x: "hi") => number'. +tests/cases/compiler/overloadOnConstNoStringImplementation2.ts(20,9): error TS2345: Argument of type '(x: number) => number' is not assignable to parameter of type '(x: "hi") => number'. Types of parameters 'x' and 'x' are incompatible. Type '"hi"' is not assignable to type 'number'. @@ -26,12 +26,12 @@ tests/cases/compiler/overloadOnConstNoStringImplementation2.ts(20,9): error TS23 c.x1(1, (x: 'hi') => { return 1; } ); c.x1(1, (x: 'bye') => { return 1; } ); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: "bye") => 1' is not assignable to parameter of type '(x: "hi") => number'. +!!! error TS2345: Argument of type '(x: "bye") => number' is not assignable to parameter of type '(x: "hi") => number'. !!! error TS2345: Types of parameters 'x' and 'x' are incompatible. !!! error TS2345: Type '"hi"' is not assignable to type '"bye"'. c.x1(1, (x: string) => { return 1; } ); c.x1(1, (x: number) => { return 1; } ); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number) => 1' is not assignable to parameter of type '(x: "hi") => number'. +!!! error TS2345: Argument of type '(x: number) => number' is not assignable to parameter of type '(x: "hi") => number'. !!! error TS2345: Types of parameters 'x' and 'x' are incompatible. !!! error TS2345: Type '"hi"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types index 5cf070df0fe..9b44e197cd8 100644 --- a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types +++ b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types @@ -17,13 +17,13 @@ function x2(callback: (x: any) => number) { } x2(() => 1); >x2(() => 1) : any >x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; } ->() => 1 : () => 1 +>() => 1 : () => number >1 : 1 x2((x) => 1 ); >x2((x) => 1 ) : any >x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; } ->(x) => 1 : (x: number) => 1 +>(x) => 1 : (x: number) => number >x : number >1 : 1 diff --git a/tests/baselines/reference/promiseChaining.types b/tests/baselines/reference/promiseChaining.types index eb0c56ee99d..fa40d8b68fc 100644 --- a/tests/baselines/reference/promiseChaining.types +++ b/tests/baselines/reference/promiseChaining.types @@ -40,7 +40,7 @@ class Chain { >x : T >result : S >then : (cb: (x: S) => S) => Chain ->x => "abc" : (x: S) => "abc" +>x => "abc" : (x: S) => string >x : S >"abc" : "abc" >then : (cb: (x: string) => S) => Chain diff --git a/tests/baselines/reference/promiseChaining1.errors.txt b/tests/baselines/reference/promiseChaining1.errors.txt index bc6602feb31..7396d03059a 100644 --- a/tests/baselines/reference/promiseChaining1.errors.txt +++ b/tests/baselines/reference/promiseChaining1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/promiseChaining1.ts(7,50): error TS2345: Argument of type '(x: S) => "abc"' is not assignable to parameter of type '(x: S) => Function'. - Type '"abc"' is not assignable to type 'Function'. +tests/cases/compiler/promiseChaining1.ts(7,50): error TS2345: Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'. + Type 'string' is not assignable to type 'Function'. ==== tests/cases/compiler/promiseChaining1.ts (1 errors) ==== @@ -11,8 +11,8 @@ tests/cases/compiler/promiseChaining1.ts(7,50): error TS2345: Argument of type ' // should get a fresh type parameter which each then call 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) => "abc"' is not assignable to parameter of type '(x: S) => Function'. -!!! error TS2345: Type '"abc"' is not assignable to type 'Function'. +!!! error TS2345: Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'. +!!! error TS2345: Type 'string' is not assignable to type 'Function'. 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 83c4de1a7dc..a31c4335da7 100644 --- a/tests/baselines/reference/promiseChaining2.errors.txt +++ b/tests/baselines/reference/promiseChaining2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/promiseChaining2.ts(7,45): error TS2345: Argument of type '(x: S) => "abc"' is not assignable to parameter of type '(x: S) => Function'. - Type '"abc"' is not assignable to type 'Function'. +tests/cases/compiler/promiseChaining2.ts(7,45): error TS2345: Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'. + Type 'string' is not assignable to type 'Function'. ==== tests/cases/compiler/promiseChaining2.ts (1 errors) ==== @@ -11,8 +11,8 @@ tests/cases/compiler/promiseChaining2.ts(7,45): error TS2345: Argument of type ' // should get a fresh type parameter which each then call var z = this.then(x => result).then(x => "abc").then(x => x.length); ~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: S) => "abc"' is not assignable to parameter of type '(x: S) => Function'. -!!! error TS2345: Type '"abc"' is not assignable to type 'Function'. +!!! error TS2345: Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'. +!!! error TS2345: Type 'string' is not assignable to type 'Function'. return new Chain2(result); } } \ No newline at end of file diff --git a/tests/baselines/reference/promiseType.types b/tests/baselines/reference/promiseType.types index 26f33d161cf..3271c2aee90 100644 --- a/tests/baselines/reference/promiseType.types +++ b/tests/baselines/reference/promiseType.types @@ -16,7 +16,7 @@ const b = p.then(b => 1); >p.then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } >p : Promise >then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } ->b => 1 : (b: boolean) => 1 +>b => 1 : (b: boolean) => number >b : boolean >1 : 1 @@ -26,10 +26,10 @@ const c = p.then(b => 1, e => 'error'); >p.then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } >p : Promise >then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } ->b => 1 : (b: boolean) => 1 +>b => 1 : (b: boolean) => number >b : boolean >1 : 1 ->e => 'error' : (e: any) => "error" +>e => 'error' : (e: any) => string >e : any >'error' : "error" @@ -39,7 +39,7 @@ const d = p.then(b => 1, e => { }); >p.then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } >p : Promise >then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } ->b => 1 : (b: boolean) => 1 +>b => 1 : (b: boolean) => number >b : boolean >1 : 1 >e => { } : (e: any) => void @@ -51,7 +51,7 @@ const e = p.then(b => 1, e => { throw Error(); }); >p.then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } >p : Promise >then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } ->b => 1 : (b: boolean) => 1 +>b => 1 : (b: boolean) => number >b : boolean >1 : 1 >e => { throw Error(); } : (e: any) => never @@ -65,7 +65,7 @@ const f = p.then(b => 1, e => Promise.reject(Error())); >p.then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } >p : Promise >then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } ->b => 1 : (b: boolean) => 1 +>b => 1 : (b: boolean) => number >b : boolean >1 : 1 >e => Promise.reject(Error()) : (e: any) => Promise @@ -83,7 +83,7 @@ const g = p.catch(e => 'error'); >p.catch : { (onrejected: (reason: any) => TResult | PromiseLike): Promise; (onrejected: (reason: any) => boolean | PromiseLike): Promise; } >p : Promise >catch : { (onrejected: (reason: any) => TResult | PromiseLike): Promise; (onrejected: (reason: any) => boolean | PromiseLike): Promise; } ->e => 'error' : (e: any) => "error" +>e => 'error' : (e: any) => string >e : any >'error' : "error" diff --git a/tests/baselines/reference/propagationOfPromiseInitialization.types b/tests/baselines/reference/propagationOfPromiseInitialization.types index 62abe2c09de..0ec973474bc 100644 --- a/tests/baselines/reference/propagationOfPromiseInitialization.types +++ b/tests/baselines/reference/propagationOfPromiseInitialization.types @@ -28,7 +28,7 @@ foo.then((x) => { >foo.then : (successCallback: (promiseValue: number) => TResult, errorCallback?: (reason: any) => TResult) => IPromise >foo : IPromise >then : (successCallback: (promiseValue: number) => TResult, errorCallback?: (reason: any) => TResult) => IPromise ->(x) => { // x is inferred to be a number return "asdf";} : (x: number) => "asdf" +>(x) => { // x is inferred to be a number return "asdf";} : (x: number) => string >x : number // x is inferred to be a number @@ -37,7 +37,7 @@ foo.then((x) => { }).then((x) => { >then : (successCallback: (promiseValue: string) => TResult, errorCallback?: (reason: any) => TResult) => IPromise ->(x) => { // x is inferred to be string x.length; return 123;} : (x: string) => 123 +>(x) => { // x is inferred to be string x.length; return 123;} : (x: string) => number >x : string // x is inferred to be string diff --git a/tests/baselines/reference/subtypingWithCallSignatures.types b/tests/baselines/reference/subtypingWithCallSignatures.types index 1dce48378c5..3f6994c8a04 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures.types +++ b/tests/baselines/reference/subtypingWithCallSignatures.types @@ -16,7 +16,7 @@ module CallSignature { >r : (x: number) => void >foo1((x: number) => 1) : (x: number) => void >foo1 : { (cb: (x: number) => void): (x: number) => void; (cb: any): any; } ->(x: number) => 1 : (x: number) => 1 +>(x: number) => 1 : (x: number) => number >x : number >1 : 1 @@ -24,7 +24,7 @@ module CallSignature { >r2 : (x: number) => void >foo1((x: T) => '') : (x: number) => void >foo1 : { (cb: (x: number) => void): (x: number) => void; (cb: any): any; } ->(x: T) => '' : (x: T) => "" +>(x: T) => '' : (x: T) => string >T : T >x : T >T : T @@ -45,7 +45,7 @@ module CallSignature { >r3 : (x: number, y: number) => void >foo2((x: number, y: number) => 1) : (x: number, y: number) => void >foo2 : { (cb: (x: number, y: number) => void): (x: number, y: number) => void; (cb: any): any; } ->(x: number, y: number) => 1 : (x: number, y: number) => 1 +>(x: number, y: number) => 1 : (x: number, y: number) => number >x : number >y : number >1 : 1 @@ -54,7 +54,7 @@ module CallSignature { >r4 : (x: number, y: number) => void >foo2((x: T) => '') : (x: number, y: number) => void >foo2 : { (cb: (x: number, y: number) => void): (x: number, y: number) => void; (cb: any): any; } ->(x: T) => '' : (x: T) => "" +>(x: T) => '' : (x: T) => string >T : T >x : T >T : T diff --git a/tests/baselines/reference/subtypingWithCallSignaturesA.errors.txt b/tests/baselines/reference/subtypingWithCallSignaturesA.errors.txt index 7990c67e82e..3821c707f4b 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesA.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesA.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesA.ts(2,15): error TS2345: Argument of type '(x: number) => ""' is not assignable to parameter of type '(x: number) => number'. - Type '""' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesA.ts(2,15): error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => number'. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesA.ts (1 errors) ==== declare function foo3(cb: (x: number) => number): typeof cb; var r5 = foo3((x: number) => ''); // error ~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number) => ""' is not assignable to parameter of type '(x: number) => number'. -!!! error TS2345: Type '""' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => number'. +!!! error TS2345: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/targetTypeObjectLiteral.types b/tests/baselines/reference/targetTypeObjectLiteral.types index 3d38ccd22ba..5f80a01bf0c 100644 --- a/tests/baselines/reference/targetTypeObjectLiteral.types +++ b/tests/baselines/reference/targetTypeObjectLiteral.types @@ -4,15 +4,15 @@ var z: { x: number; y: (w:string)=>number;} = { >x : number >y : (w: string) => number >w : string ->{ x: 12, y: function(w) { return 0; }} : { x: number; y: (w: string) => 0; } +>{ x: 12, y: function(w) { return 0; }} : { x: number; y: (w: string) => number; } x: 12, >x : number >12 : 12 y: function(w) { ->y : (w: string) => 0 ->function(w) { return 0; } : (w: string) => 0 +>y : (w: string) => number +>function(w) { return 0; } : (w: string) => number >w : string return 0; diff --git a/tests/baselines/reference/thisTypeInFunctions.types b/tests/baselines/reference/thisTypeInFunctions.types index e77505835e5..44bf23ad509 100644 --- a/tests/baselines/reference/thisTypeInFunctions.types +++ b/tests/baselines/reference/thisTypeInFunctions.types @@ -132,7 +132,7 @@ function implicitThis(n: number): number { let impl: I = { >impl : I >I : I ->{ a: 12, explicitVoid2: () => this.a, // ok, this: any because it refers to some outer object (window?) explicitVoid1() { return 12; }, explicitStructural() { return this.a; }, explicitInterface() { return this.a; }, explicitThis() { return this.a; },} : { a: number; explicitVoid2: () => any; explicitVoid1(this: void): 12; explicitStructural(this: { a: number; }): number; explicitInterface(this: I): number; explicitThis(this: I): number; } +>{ a: 12, explicitVoid2: () => this.a, // ok, this: any because it refers to some outer object (window?) explicitVoid1() { return 12; }, explicitStructural() { return this.a; }, explicitInterface() { return this.a; }, explicitThis() { return this.a; },} : { a: number; explicitVoid2: () => any; explicitVoid1(this: void): number; explicitStructural(this: { a: number; }): number; explicitInterface(this: I): number; explicitThis(this: I): number; } a: 12, >a : number @@ -146,7 +146,7 @@ let impl: I = { >a : any explicitVoid1() { return 12; }, ->explicitVoid1 : (this: void) => 12 +>explicitVoid1 : (this: void) => number >12 : 12 explicitStructural() { @@ -178,19 +178,19 @@ let impl: I = { }, } impl.explicitVoid1 = function () { return 12; }; ->impl.explicitVoid1 = function () { return 12; } : (this: void) => 12 +>impl.explicitVoid1 = function () { return 12; } : (this: void) => number >impl.explicitVoid1 : (this: void) => number >impl : I >explicitVoid1 : (this: void) => number ->function () { return 12; } : (this: void) => 12 +>function () { return 12; } : (this: void) => number >12 : 12 impl.explicitVoid2 = () => 12; ->impl.explicitVoid2 = () => 12 : () => 12 +>impl.explicitVoid2 = () => 12 : () => number >impl.explicitVoid2 : (this: void) => number >impl : I >explicitVoid2 : (this: void) => number ->() => 12 : () => 12 +>() => 12 : () => number >12 : 12 impl.explicitStructural = function() { return this.a; }; @@ -214,19 +214,19 @@ impl.explicitInterface = function() { return this.a; }; >a : number impl.explicitStructural = () => 12; ->impl.explicitStructural = () => 12 : () => 12 +>impl.explicitStructural = () => 12 : () => number >impl.explicitStructural : (this: { a: number; }) => number >impl : I >explicitStructural : (this: { a: number; }) => number ->() => 12 : () => 12 +>() => 12 : () => number >12 : 12 impl.explicitInterface = () => 12; ->impl.explicitInterface = () => 12 : () => 12 +>impl.explicitInterface = () => 12 : () => number >impl.explicitInterface : (this: I) => number >impl : I >explicitInterface : (this: I) => number ->() => 12 : () => 12 +>() => 12 : () => number >12 : 12 impl.explicitThis = function () { return this.a; }; diff --git a/tests/baselines/reference/thisTypeInFunctions2.types b/tests/baselines/reference/thisTypeInFunctions2.types index bff71dd4450..3cf6c1d2fae 100644 --- a/tests/baselines/reference/thisTypeInFunctions2.types +++ b/tests/baselines/reference/thisTypeInFunctions2.types @@ -138,7 +138,7 @@ extend2({ simple({ >simple({ foo(n) { return n.length + this.bar(); }, bar() { return 14; }}) : void >simple : (arg: SimpleInterface) => void ->{ foo(n) { return n.length + this.bar(); }, bar() { return 14; }} : { foo(n: string): any; bar(): 14; } +>{ foo(n) { return n.length + this.bar(); }, bar() { return 14; }} : { foo(n: string): any; bar(): number; } foo(n) { >foo : (n: string) => any @@ -156,7 +156,7 @@ simple({ }, bar() { ->bar : () => 14 +>bar : () => number return 14; >14 : 14 diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt index 485017940b5..59ed2db9b1a 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(25,35): error TS2345: Argument of type '3' 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) => ""' is not assignable to parameter of type '(x: number) => void'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(61,39): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(71,39): error TS2345: Argument of type '(x: string) => ""' is not assignable to parameter of type '(x: number) => void'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(71,39): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. 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'. @@ -88,7 +88,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct new someGenerics4('', () => 3); new someGenerics4('', (x: string) => ''); // Error ~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: string) => ""' is not assignable to parameter of type '(x: number) => void'. +!!! error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. !!! error TS2345: Types of parameters 'x' and 'x' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. new someGenerics4(null, null); @@ -102,7 +102,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct new someGenerics5('', () => 3); new someGenerics5('', (x: string) => ''); // Error ~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: string) => ""' is not assignable to parameter of type '(x: number) => void'. +!!! error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. !!! error TS2345: Types of parameters 'x' and 'x' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. new someGenerics5(null, null); diff --git a/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt b/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt index 80f087df5e1..47d5e82994c 100644 --- a/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts(3,31): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts(7,35): error TS2345: Argument of type '(x: string) => ""' is not assignable to parameter of type '(x: number) => void'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts(7,35): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts(11,35): error TS2345: Argument of type '(x: string) => ""' is not assignable to parameter of type '(x: number) => void'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts(11,35): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. 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'. @@ -21,7 +21,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts function someGenerics4(n: T, f: (x: U) => void) { } someGenerics4('', (x: string) => ''); // Error ~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: string) => ""' is not assignable to parameter of type '(x: number) => void'. +!!! error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. !!! error TS2345: Types of parameters 'x' and 'x' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. @@ -29,7 +29,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts function someGenerics5(n: T, f: (x: U) => void) { } someGenerics5('', (x: string) => ''); // Error ~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: string) => ""' is not assignable to parameter of type '(x: number) => void'. +!!! error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. !!! error TS2345: Types of parameters 'x' and 'x' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt index 881ed1c5ac3..22d18e11eca 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt @@ -3,10 +3,10 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(17,23): error TS2344: Type '{}' does not satisfy the constraint 'number'. 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) => ""' is not assignable to parameter of type '(x: number) => void'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(41,35): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(48,35): error TS2345: Argument of type '(x: string) => ""' is not assignable to parameter of type '(x: number) => void'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(48,35): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(49,15): error TS2344: Type 'string' does not satisfy the constraint 'number'. @@ -79,7 +79,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst someGenerics4('', () => 3); someGenerics4('', (x: string) => ''); // Error ~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: string) => ""' is not assignable to parameter of type '(x: number) => void'. +!!! error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. !!! error TS2345: Types of parameters 'x' and 'x' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. someGenerics4(null, null); @@ -90,7 +90,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst someGenerics5('', () => 3); someGenerics5('', (x: string) => ''); // Error ~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: string) => ""' is not assignable to parameter of type '(x: number) => void'. +!!! error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. !!! error TS2345: Types of parameters 'x' and 'x' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. someGenerics5(null, null); // Error diff --git a/tests/baselines/reference/typeInferenceFixEarly.types b/tests/baselines/reference/typeInferenceFixEarly.types index 15d8c661c88..2eacc53be61 100644 --- a/tests/baselines/reference/typeInferenceFixEarly.types +++ b/tests/baselines/reference/typeInferenceFixEarly.types @@ -11,7 +11,7 @@ declare function f(p: (t: T) => T): T; f(n => 3); >f(n => 3) : {} >f : (p: (t: T) => T) => T ->n => 3 : (n: {}) => 3 +>n => 3 : (n: {}) => number >n : {} >3 : 3 diff --git a/tests/baselines/reference/unionAndIntersectionInference1.types b/tests/baselines/reference/unionAndIntersectionInference1.types index 7b7260beeea..6d24bffb56d 100644 --- a/tests/baselines/reference/unionAndIntersectionInference1.types +++ b/tests/baselines/reference/unionAndIntersectionInference1.types @@ -71,10 +71,10 @@ var result = destructure(value, text => 'string', y => 'other one'); // text: st >destructure(value, text => 'string', y => 'other one') : string >destructure : (something: Y | a, haveValue: (value: a) => r, haveY: (value: Y) => r) => r >value : string | Y ->text => 'string' : (text: string) => "string" +>text => 'string' : (text: string) => string >text : string >'string' : "string" ->y => 'other one' : (y: Y) => "other one" +>y => 'other one' : (y: Y) => string >y : Y >'other one' : "other one" diff --git a/tests/baselines/reference/unionTypeInference.types b/tests/baselines/reference/unionTypeInference.types index 138717693da..e624be7a42e 100644 --- a/tests/baselines/reference/unionTypeInference.types +++ b/tests/baselines/reference/unionTypeInference.types @@ -108,7 +108,7 @@ var c1: number; var c1 = h(5); >c1 : number ->h(5) : number +>h(5) : 5 >h : (x: string | boolean | T) => T >5 : 5 @@ -117,7 +117,7 @@ var c2: string; var c2 = h("abc"); >c2 : string ->h("abc") : string +>h("abc") : "abc" >h : (x: string | boolean | T) => T >"abc" : "abc" diff --git a/tests/baselines/reference/voidFunctionAssignmentCompat.types b/tests/baselines/reference/voidFunctionAssignmentCompat.types index 3ecb98338c6..72f3d1b4c61 100644 --- a/tests/baselines/reference/voidFunctionAssignmentCompat.types +++ b/tests/baselines/reference/voidFunctionAssignmentCompat.types @@ -14,9 +14,9 @@ var fv = function(): void {} >function(): void {} : () => void fv = function() { return 0; } // should work ->fv = function() { return 0; } : () => 0 +>fv = function() { return 0; } : () => number >fv : () => void ->function() { return 0; } : () => 0 +>function() { return 0; } : () => number >0 : 0 function execAny(callback:(val:any)=>any) { return callback(0) } @@ -43,7 +43,7 @@ function execVoid(callback:(val:any)=>void) { callback(0); } execVoid(function () {return 0;}); // should work >execVoid(function () {return 0;}) : void >execVoid : (callback: (val: any) => void) => void ->function () {return 0;} : () => 0 +>function () {return 0;} : () => number >0 : 0 var fra: (v:any)=>any = function() { return function () {}; } // should work