forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
67 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,52 @@ | ||
tests/cases/compiler/tupleKinds.ts(1,22): error TS2370: A rest parameter must be of an array type. | ||
tests/cases/compiler/tupleKinds.ts(4,44): error TS1144: '{' or ';' expected. | ||
tests/cases/compiler/tupleKinds.ts(4,44): error TS2304: Cannot find name 'is'. | ||
tests/cases/compiler/tupleKinds.ts(4,47): error TS1005: ';' expected. | ||
tests/cases/compiler/tupleKinds.ts(4,47): error TS2304: Cannot find name 'boolean'. | ||
tests/cases/compiler/tupleKinds.ts(4,55): error TS1005: ';' expected. | ||
tests/cases/compiler/tupleKinds.ts(6,45): error TS1144: '{' or ';' expected. | ||
tests/cases/compiler/tupleKinds.ts(6,46): error TS2304: Cannot find name 'U'. | ||
tests/cases/compiler/tupleKinds.ts(8,29): error TS1005: '>' expected. | ||
tests/cases/compiler/tupleKinds.ts(8,37): error TS2304: Cannot find name 'string'. | ||
tests/cases/compiler/tupleKinds.ts(8,45): error TS1109: Expression expected. | ||
tests/cases/compiler/tupleKinds.ts(8,48): error TS2304: Cannot find name 'args'. | ||
tests/cases/compiler/tupleKinds.ts(8,52): error TS1005: ';' expected. | ||
|
||
|
||
==== tests/cases/compiler/tupleKinds.ts (1 errors) ==== | ||
function tuple<...T>(...args:...T) { | ||
==== tests/cases/compiler/tupleKinds.ts (13 errors) ==== | ||
function tuple<...T>(...args:...T): ...T { | ||
~~~~~~~~~~~~ | ||
!!! error TS2370: A rest parameter must be of an array type. | ||
return args; | ||
} | ||
function noPredicates<...T>(...args): ...T is boolean { | ||
~~ | ||
!!! error TS1144: '{' or ';' expected. | ||
~~ | ||
!!! error TS2304: Cannot find name 'is'. | ||
~~~~~~~ | ||
!!! error TS1005: ';' expected. | ||
~~~~~~~ | ||
!!! error TS2304: Cannot find name 'boolean'. | ||
~ | ||
!!! error TS1005: ';' expected. | ||
} | ||
function noArguments<...T, U>(...args): ...T<U> { | ||
~ | ||
!!! error TS1144: '{' or ';' expected. | ||
~ | ||
!!! error TS2304: Cannot find name 'U'. | ||
} | ||
function noConstraints<...T extends string>(...args) { | ||
~~~~~~~ | ||
!!! error TS1005: '>' expected. | ||
~~~~~~ | ||
!!! error TS2304: Cannot find name 'string'. | ||
~~~ | ||
!!! error TS1109: Expression expected. | ||
~~~~ | ||
!!! error TS2304: Cannot find name 'args'. | ||
~ | ||
!!! error TS1005: ';' expected. | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
function tuple<...T>(...args:...T) { | ||
function tuple<...T>(...args:...T): ...T { | ||
return args; | ||
} | ||
function noPredicates<...T>(...args): ...T is boolean { | ||
} | ||
function noArguments<...T, U>(...args): ...T<U> { | ||
} | ||
function noConstraints<...T extends string>(...args) { | ||
} |