73 lines
No EOL
3 KiB
Text
73 lines
No EOL
3 KiB
Text
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersWithArrayTypeAnnotations.ts(5,11): error TS1014: A rest parameter must be last in a parameter list.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersWithArrayTypeAnnotations.ts(13,9): error TS1014: A rest parameter must be last in a parameter list.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersWithArrayTypeAnnotations.ts(23,21): error TS1014: A rest parameter must be last in a parameter list.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersWithArrayTypeAnnotations.ts(32,11): error TS1014: A rest parameter must be last in a parameter list.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersWithArrayTypeAnnotations.ts(40,9): error TS1014: A rest parameter must be last in a parameter list.
|
|
tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersWithArrayTypeAnnotations.ts(50,21): error TS1014: A rest parameter must be last in a parameter list.
|
|
|
|
|
|
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersWithArrayTypeAnnotations.ts (6 errors) ====
|
|
// Rest parameters must be an array type if they have a type annotation, errors only for the functions with 2 rest params
|
|
|
|
function foo(...x: number[]) { }
|
|
var f = function foo(...x: number[]) { }
|
|
var f2 = (...x: number[], ...y: number[]) => { }
|
|
~~~
|
|
!!! error TS1014: A rest parameter must be last in a parameter list.
|
|
|
|
class C {
|
|
foo(...x: number[]) { }
|
|
}
|
|
|
|
interface I {
|
|
(...x: number[]);
|
|
foo(...x: number[], ...y: number[]);
|
|
~~~
|
|
!!! error TS1014: A rest parameter must be last in a parameter list.
|
|
}
|
|
|
|
var a: {
|
|
(...x: number[]);
|
|
foo(...x: number[]);
|
|
}
|
|
|
|
var b = {
|
|
foo(...x: number[]) { },
|
|
a: function foo(...x: number[], ...y: number[]) { },
|
|
~~~
|
|
!!! error TS1014: A rest parameter must be last in a parameter list.
|
|
b: (...x: number[]) => { }
|
|
}
|
|
|
|
|
|
|
|
|
|
function foo2(...x: Array<string>) { }
|
|
var f3 = function foo(...x: Array<string>) { }
|
|
var f4 = (...x: Array<string>, ...y: Array<string>) => { }
|
|
~~~
|
|
!!! error TS1014: A rest parameter must be last in a parameter list.
|
|
|
|
class C2 {
|
|
foo(...x: Array<string>) { }
|
|
}
|
|
|
|
interface I2 {
|
|
(...x: Array<string>);
|
|
foo(...x: Array<string>, ...y: Array<string>);
|
|
~~~
|
|
!!! error TS1014: A rest parameter must be last in a parameter list.
|
|
}
|
|
|
|
var a2: {
|
|
(...x: Array<string>);
|
|
foo(...x: Array<string>);
|
|
}
|
|
|
|
var b2 = {
|
|
foo(...x: Array<string>) { },
|
|
a: function foo(...x: Array<string>, ...y: Array<string>) { },
|
|
~~~
|
|
!!! error TS1014: A rest parameter must be last in a parameter list.
|
|
b: (...x: Array<string>) => { }
|
|
} |