This was we don't get noisy baselines just because a different phase of the compiler reported the diagnostic. This helps with Yui's refactoring work to move grammar checks into the type checker.
79 lines
No EOL
5 KiB
Text
79 lines
No EOL
5 KiB
Text
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts(3,14): error TS2370: A rest parameter must be of an array type.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts(4,22): error TS2370: A rest parameter must be of an array type.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts(5,11): error TS1014: A rest parameter must be last in a parameter list.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts(5,11): error TS2370: A rest parameter must be of an array type.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts(5,23): error TS2370: A rest parameter must be of an array type.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts(8,9): error TS2370: A rest parameter must be of an array type.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts(12,6): error TS2370: A rest parameter must be of an array type.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts(13,9): error TS1014: A rest parameter must be last in a parameter list.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts(13,9): error TS2370: A rest parameter must be of an array type.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts(13,23): error TS2370: A rest parameter must be of an array type.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts(17,6): error TS2370: A rest parameter must be of an array type.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts(18,9): error TS2370: A rest parameter must be of an array type.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts(22,9): error TS2370: A rest parameter must be of an array type.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts(23,21): error TS1014: A rest parameter must be last in a parameter list.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts(23,21): error TS2370: A rest parameter must be of an array type.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts(23,35): error TS2370: A rest parameter must be of an array type.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts(24,9): error TS2370: A rest parameter must be of an array type.
|
|
|
|
|
|
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts (17 errors) ====
|
|
// Rest parameters must be an array type if they have a type annotation, so all these are errors
|
|
|
|
function foo(...x: string) { }
|
|
~~~~~~~~~~~~
|
|
!!! error TS2370: A rest parameter must be of an array type.
|
|
var f = function foo(...x: number) { }
|
|
~~~~~~~~~~~~
|
|
!!! error TS2370: A rest parameter must be of an array type.
|
|
var f2 = (...x: Date, ...y: boolean) => { }
|
|
~~~
|
|
!!! error TS1014: A rest parameter must be last in a parameter list.
|
|
~~~~~~~~~~
|
|
!!! error TS2370: A rest parameter must be of an array type.
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2370: A rest parameter must be of an array type.
|
|
|
|
class C {
|
|
foo(...x: C) { }
|
|
~~~~~~~
|
|
!!! error TS2370: A rest parameter must be of an array type.
|
|
}
|
|
|
|
interface I {
|
|
(...x: string);
|
|
~~~~~~~~~~~~
|
|
!!! error TS2370: A rest parameter must be of an array type.
|
|
foo(...x: number, ...y: number);
|
|
~~~
|
|
!!! error TS1014: A rest parameter must be last in a parameter list.
|
|
~~~~~~~~~~~~
|
|
!!! error TS2370: A rest parameter must be of an array type.
|
|
~~~~~~~~~~~~
|
|
!!! error TS2370: A rest parameter must be of an array type.
|
|
}
|
|
|
|
var a: {
|
|
(...x: string);
|
|
~~~~~~~~~~~~
|
|
!!! error TS2370: A rest parameter must be of an array type.
|
|
foo(...x: string);
|
|
~~~~~~~~~~~~
|
|
!!! error TS2370: A rest parameter must be of an array type.
|
|
}
|
|
|
|
var b = {
|
|
foo(...x: string) { },
|
|
~~~~~~~~~~~~
|
|
!!! error TS2370: A rest parameter must be of an array type.
|
|
a: function foo(...x: number, ...y: Date) { },
|
|
~~~
|
|
!!! error TS1014: A rest parameter must be last in a parameter list.
|
|
~~~~~~~~~~~~
|
|
!!! error TS2370: A rest parameter must be of an array type.
|
|
~~~~~~~~~~
|
|
!!! error TS2370: A rest parameter must be of an array type.
|
|
b: (...x: string) => { }
|
|
~~~~~~~~~~~~
|
|
!!! error TS2370: A rest parameter must be of an array type.
|
|
} |