From be4fb30e611629c535ae513f7e9376335d5fb448 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 2 Feb 2019 09:28:28 -0800 Subject: [PATCH] Accept new baselines --- .../genericRestParameters1.errors.txt | 24 ++--- .../genericRestParameters2.errors.txt | 89 ------------------- .../reference/inferTypes1.errors.txt | 24 ++--- .../parameterListAsTupleType.errors.txt | 8 +- 4 files changed, 21 insertions(+), 124 deletions(-) delete mode 100644 tests/baselines/reference/genericRestParameters2.errors.txt diff --git a/tests/baselines/reference/genericRestParameters1.errors.txt b/tests/baselines/reference/genericRestParameters1.errors.txt index d0a09ee463..3eed718337 100644 --- a/tests/baselines/reference/genericRestParameters1.errors.txt +++ b/tests/baselines/reference/genericRestParameters1.errors.txt @@ -1,19 +1,13 @@ tests/cases/conformance/types/rest/genericRestParameters1.ts(22,1): error TS2556: Expected 3 arguments, but got 1 or more. tests/cases/conformance/types/rest/genericRestParameters1.ts(31,1): error TS2556: Expected 3 arguments, but got 1 or more. -tests/cases/conformance/types/rest/genericRestParameters1.ts(133,40): error TS2344: Type '(...args: T) => void' does not satisfy the constraint '(...args: any[]) => any'. - Types of parameters 'args' and 'args' are incompatible. - Type 'any[]' is not assignable to type 'T'. -tests/cases/conformance/types/rest/genericRestParameters1.ts(134,51): error TS2344: Type 'new (...args: T) => void' does not satisfy the constraint 'new (...args: any[]) => any'. - Types of parameters 'args' and 'args' are incompatible. - Type 'any[]' is not assignable to type 'T'. -tests/cases/conformance/types/rest/genericRestParameters1.ts(135,23): error TS2344: Type 'Function' does not satisfy the constraint '(...args: any[]) => any'. - Type 'Function' provides no match for the signature '(...args: any[]): any'. +tests/cases/conformance/types/rest/genericRestParameters1.ts(135,23): error TS2344: Type 'Function' does not satisfy the constraint '(...args: any) => any'. + Type 'Function' provides no match for the signature '(...args: any): any'. tests/cases/conformance/types/rest/genericRestParameters1.ts(164,1): error TS2322: Type '(a: never) => void' is not assignable to type '(...args: any[]) => void'. Types of parameters 'a' and 'args' are incompatible. Type 'any' is not assignable to type 'never'. -==== tests/cases/conformance/types/rest/genericRestParameters1.ts (6 errors) ==== +==== tests/cases/conformance/types/rest/genericRestParameters1.ts (4 errors) ==== declare let f1: (...x: [number, string, boolean]) => void; declare let f2: (x0: number, x1: string, x2: boolean) => void; @@ -152,19 +146,11 @@ tests/cases/conformance/types/rest/genericRestParameters1.ts(164,1): error TS232 type T05 = Parameters<(...args: T[]) => void>; type T06 = ConstructorParameters void>; type T07 = Parameters<(...args: T) => void>; - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2344: Type '(...args: T) => void' does not satisfy the constraint '(...args: any[]) => any'. -!!! error TS2344: Types of parameters 'args' and 'args' are incompatible. -!!! error TS2344: Type 'any[]' is not assignable to type 'T'. type T08 = ConstructorParameters void>; - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2344: Type 'new (...args: T) => void' does not satisfy the constraint 'new (...args: any[]) => any'. -!!! error TS2344: Types of parameters 'args' and 'args' are incompatible. -!!! error TS2344: Type 'any[]' is not assignable to type 'T'. type T09 = Parameters; ~~~~~~~~ -!!! error TS2344: Type 'Function' does not satisfy the constraint '(...args: any[]) => any'. -!!! error TS2344: Type 'Function' provides no match for the signature '(...args: any[]): any'. +!!! error TS2344: Type 'Function' does not satisfy the constraint '(...args: any) => any'. +!!! error TS2344: Type 'Function' provides no match for the signature '(...args: any): any'. type Record1 = { move: [number, 'left' | 'right']; diff --git a/tests/baselines/reference/genericRestParameters2.errors.txt b/tests/baselines/reference/genericRestParameters2.errors.txt deleted file mode 100644 index a22af304ab..0000000000 --- a/tests/baselines/reference/genericRestParameters2.errors.txt +++ /dev/null @@ -1,89 +0,0 @@ -tests/cases/conformance/types/rest/genericRestParameters2.ts(71,40): error TS2344: Type '(x: string, ...args: T) => void' does not satisfy the constraint '(...args: any[]) => any'. - Types of parameters 'x' and 'args' are incompatible. - Property '0' is missing in type 'any[]' but required in type '[string, ...any[]]'. - - -==== tests/cases/conformance/types/rest/genericRestParameters2.ts (1 errors) ==== - declare const t1: [number, string, ...boolean[]]; - declare const t2: [string, ...boolean[]]; - declare const t3: [...boolean[]]; - declare const t4: []; - - declare let f00: (...x: [number, string, boolean]) => void; - declare let f01: (a: number, ...x: [string, boolean]) => void; - declare let f02: (a: number, b: string, ...x: [boolean]) => void; - declare let f03: (a: number, b: string, c: boolean) => void; - declare let f04: (a: number, b: string, c: boolean, ...x: []) => void; - - declare let f10: (...x: [number, string, ...boolean[]]) => void; - declare let f11: (a: number, ...x: [string, ...boolean[]]) => void; - declare let f12: (a: number, b: string, ...x: [...boolean[]]) => void; - declare let f13: (a: number, b: string, ...c: boolean[]) => void; - - declare const ns: [number, string]; - declare const sn: [string, number]; - - f10(42, "hello"); - f10(42, "hello", true); - f10(42, "hello", true, false); - f10(t1[0], t1[1], t1[2], t1[3]); - f10(...t1); - f10(42, ...t2); - f10(42, "hello", ...t3); - f10(42, "hello", true, ...t4); - f10(42, "hello", true, ...t4, false, ...t3); - - f11(42, "hello"); - f11(42, "hello", true); - f11(42, "hello", true, false); - f11(t1[0], t1[1], t1[2], t1[3]); - f11(...t1); - f11(42, ...t2); - f11(42, "hello", ...t3); - f11(42, "hello", true, ...t4); - f11(42, "hello", true, ...t4, false, ...t3); - - f12(42, "hello"); - f12(42, "hello", true); - f12(42, "hello", true, false); - f12(t1[0], t1[1], t1[2], t1[3]); - f12(...t1); - f12(42, ...t2); - f12(42, "hello", ...t3); - f12(42, "hello", true, ...t4); - f12(42, "hello", true, ...t4, false, ...t3); - - f13(42, "hello"); - f13(42, "hello", true); - f13(42, "hello", true, false); - f13(t1[0], t1[1], t1[2], t1[3]); - f13(...t1); - f13(42, ...t2); - f13(42, "hello", ...t3); - f13(42, "hello", true, ...t4); - f13(42, "hello", true, ...t4, false, ...t3); - - declare const f20: (...args: T) => T; - - f20(...t1); - f20(42, ...t2); - f20(42, "hello", ...t3); - f20(42, "hello", ...t2, true); - - type T01 = Parameters<(x: number, y: string, ...z: boolean[]) => void>; - type T02 = Parameters<(...args: [number, string, ...boolean[]]) => void>; - type T03 = ConstructorParameters void>; - type T04 = ConstructorParameters void>; - type T05 = Parameters<(x: string, ...args: T) => void>; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2344: Type '(x: string, ...args: T) => void' does not satisfy the constraint '(...args: any[]) => any'. -!!! error TS2344: Types of parameters 'x' and 'args' are incompatible. -!!! error TS2344: Property '0' is missing in type 'any[]' but required in type '[string, ...any[]]'. - type T06 = T05<[number, ...boolean[]]>; - - type P1 = T extends (head: infer A, ...tail: infer B) => any ? { head: A, tail: B } : any[]; - - type T10 = P1<(x: number, y: string, ...z: boolean[]) => void>; - type T11 = P1<(...z: number[]) => void>; - type T12 = P1<(x: number, y: number) => void>; - \ No newline at end of file diff --git a/tests/baselines/reference/inferTypes1.errors.txt b/tests/baselines/reference/inferTypes1.errors.txt index 4684b8f5e3..be16eb4c3f 100644 --- a/tests/baselines/reference/inferTypes1.errors.txt +++ b/tests/baselines/reference/inferTypes1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/types/conditional/inferTypes1.ts(31,23): error TS2344: Type 'string' does not satisfy the constraint '(...args: any[]) => any'. -tests/cases/conformance/types/conditional/inferTypes1.ts(32,23): error TS2344: Type 'Function' does not satisfy the constraint '(...args: any[]) => any'. - Type 'Function' provides no match for the signature '(...args: any[]): any'. -tests/cases/conformance/types/conditional/inferTypes1.ts(37,25): error TS2344: Type 'string' does not satisfy the constraint 'new (...args: any[]) => any'. -tests/cases/conformance/types/conditional/inferTypes1.ts(38,25): error TS2344: Type 'Function' does not satisfy the constraint 'new (...args: any[]) => any'. - Type 'Function' provides no match for the signature 'new (...args: any[]): any'. +tests/cases/conformance/types/conditional/inferTypes1.ts(31,23): error TS2344: Type 'string' does not satisfy the constraint '(...args: any) => any'. +tests/cases/conformance/types/conditional/inferTypes1.ts(32,23): error TS2344: Type 'Function' does not satisfy the constraint '(...args: any) => any'. + Type 'Function' provides no match for the signature '(...args: any): any'. +tests/cases/conformance/types/conditional/inferTypes1.ts(37,25): error TS2344: Type 'string' does not satisfy the constraint 'new (...args: any) => any'. +tests/cases/conformance/types/conditional/inferTypes1.ts(38,25): error TS2344: Type 'Function' does not satisfy the constraint 'new (...args: any) => any'. + Type 'Function' provides no match for the signature 'new (...args: any): any'. tests/cases/conformance/types/conditional/inferTypes1.ts(46,25): error TS2344: Type '(x: string, y: string) => number' does not satisfy the constraint '(x: any) => any'. tests/cases/conformance/types/conditional/inferTypes1.ts(47,25): error TS2344: Type 'Function' does not satisfy the constraint '(x: any) => any'. Type 'Function' provides no match for the signature '(x: any): any'. @@ -54,22 +54,22 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(144,40): error TS2322: type T16 = ReturnType; // never type T17 = ReturnType; // Error ~~~~~~ -!!! error TS2344: Type 'string' does not satisfy the constraint '(...args: any[]) => any'. +!!! error TS2344: Type 'string' does not satisfy the constraint '(...args: any) => any'. type T18 = ReturnType; // Error ~~~~~~~~ -!!! error TS2344: Type 'Function' does not satisfy the constraint '(...args: any[]) => any'. -!!! error TS2344: Type 'Function' provides no match for the signature '(...args: any[]): any'. +!!! error TS2344: Type 'Function' does not satisfy the constraint '(...args: any) => any'. +!!! error TS2344: Type 'Function' provides no match for the signature '(...args: any): any'. type U10 = InstanceType; // C type U11 = InstanceType; // any type U12 = InstanceType; // never type U13 = InstanceType; // Error ~~~~~~ -!!! error TS2344: Type 'string' does not satisfy the constraint 'new (...args: any[]) => any'. +!!! error TS2344: Type 'string' does not satisfy the constraint 'new (...args: any) => any'. type U14 = InstanceType; // Error ~~~~~~~~ -!!! error TS2344: Type 'Function' does not satisfy the constraint 'new (...args: any[]) => any'. -!!! error TS2344: Type 'Function' provides no match for the signature 'new (...args: any[]): any'. +!!! error TS2344: Type 'Function' does not satisfy the constraint 'new (...args: any) => any'. +!!! error TS2344: Type 'Function' provides no match for the signature 'new (...args: any): any'. type ArgumentType any> = T extends (a: infer A) => any ? A : any; diff --git a/tests/baselines/reference/parameterListAsTupleType.errors.txt b/tests/baselines/reference/parameterListAsTupleType.errors.txt index 021138ec2b..6bf3d74466 100644 --- a/tests/baselines/reference/parameterListAsTupleType.errors.txt +++ b/tests/baselines/reference/parameterListAsTupleType.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/parameterListAsTupleType.ts(8,17): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/parameterListAsTupleType.ts(16,23): error TS2344: Type 'typeof C' does not satisfy the constraint '(...args: any[]) => any'. - Type 'typeof C' provides no match for the signature '(...args: any[]): any'. +tests/cases/compiler/parameterListAsTupleType.ts(16,23): error TS2344: Type 'typeof C' does not satisfy the constraint '(...args: any) => any'. + Type 'typeof C' provides no match for the signature '(...args: any): any'. ==== tests/cases/compiler/parameterListAsTupleType.ts (2 errors) ==== @@ -23,8 +23,8 @@ tests/cases/compiler/parameterListAsTupleType.ts(16,23): error TS2344: Type 'typ type Cps = Parameters; // should not work ~~~~~~~~ -!!! error TS2344: Type 'typeof C' does not satisfy the constraint '(...args: any[]) => any'. -!!! error TS2344: Type 'typeof C' provides no match for the signature '(...args: any[]): any'. +!!! error TS2344: Type 'typeof C' does not satisfy the constraint '(...args: any) => any'. +!!! error TS2344: Type 'typeof C' provides no match for the signature '(...args: any): any'. type Ccps = ConstructorParameters; // should be [number, string] class D {