Accept new baselines
This commit is contained in:
parent
e7ad76ddc8
commit
be4fb30e61
4 changed files with 21 additions and 124 deletions
|
@ -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<T> = Parameters<(...args: T[]) => void>;
|
||||
type T06<T> = ConstructorParameters<new (...args: []) => void>;
|
||||
type T07<T extends any[]> = 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<T extends any[]> = ConstructorParameters<new (...args: T) => 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<Function>;
|
||||
~~~~~~~~
|
||||
!!! 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'];
|
||||
|
|
|
@ -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: <T extends unknown[]>(...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<new (x: number, y: string, ...z: boolean[]) => void>;
|
||||
type T04 = ConstructorParameters<new (...args: [number, string, ...boolean[]]) => void>;
|
||||
type T05<T extends any[]> = 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 Function> = 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>;
|
||||
|
|
@ -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>; // never
|
||||
type T17 = ReturnType<string>; // 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<Function>; // 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<typeof C>; // C
|
||||
type U11 = InstanceType<any>; // any
|
||||
type U12 = InstanceType<never>; // never
|
||||
type U13 = InstanceType<string>; // 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<Function>; // 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<T extends (x: any) => any> = T extends (a: infer A) => any ? A : any;
|
||||
|
||||
|
|
|
@ -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<typeof C>; // 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<typeof C>; // should be [number, string]
|
||||
|
||||
class D {
|
||||
|
|
Loading…
Reference in a new issue