Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/baselines/reference/genericRestParameters1.errors.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
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(164,1): error TS2322: Type '(a: never) => void' is not assignable to type '(...args: any[]) => void'.
Expand Down Expand Up @@ -149,9 +153,13 @@ tests/cases/conformance/types/rest/genericRestParameters1.ts(164,1): error TS232
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'.
Expand Down
6 changes: 6 additions & 0 deletions tests/baselines/reference/genericRestParameters2.errors.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
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.
Type 'any[]' is not assignable to type '[string, ...any[]]'.
Property '0' is missing in type 'any[]'.


==== tests/cases/conformance/types/rest/genericRestParameters2.ts (1 errors) ====
Expand Down Expand Up @@ -75,6 +78,9 @@ tests/cases/conformance/types/rest/genericRestParameters2.ts(71,40): error TS234
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: Type 'any[]' is not assignable to type '[string, ...any[]]'.
!!! error TS2344: Property '0' is missing in type '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[];
Expand Down