File: restParameterWithoutAnnotationIsAnyArray.types

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (69 lines) | stat: -rw-r--r-- 1,650 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParameterWithoutAnnotationIsAnyArray.ts ===
// Rest parameters without type annotations are 'any', errors only for the functions with 2 rest params

function foo(...x) { }
>foo : (...x: any[]) => void
>x : any[]

var f = function foo(...x) { }
>f : (...x: any[]) => void
>function foo(...x) { } : (...x: any[]) => void
>foo : (...x: any[]) => void
>x : any[]

var f2 = (...x, ...y) => { }
>f2 : (...x: any[], ...y: any[]) => void
>(...x, ...y) => { } : (...x: any[], ...y: any[]) => void
>x : any[]
>y : any[]

class C {
>C : C

    foo(...x) { }
>foo : (...x: any[]) => void
>x : any[]
}

interface I {
    (...x);
>x : any[]

    foo(...x, ...y);
>foo : (...x: any[], ...y: any[]) => any
>x : any[]
>y : any[]
}

var a: {
>a : { (...x: any[]): any; foo(...x: any[]): any; }

    (...x);
>x : any[]

    foo(...x);
>foo : (...x: any[]) => any
>x : any[]
}

var b = {
>b : { foo(...x: any[]): void; a: (...x: any[], ...y: any[]) => void; b: (...x: any[]) => void; }
>{    foo(...x) { },    a: function foo(...x, ...y) { },    b: (...x) => { }} : { foo(...x: any[]): void; a: (...x: any[], ...y: any[]) => void; b: (...x: any[]) => void; }

    foo(...x) { },
>foo : (...x: any[]) => void
>x : any[]

    a: function foo(...x, ...y) { },
>a : (...x: any[], ...y: any[]) => void
>function foo(...x, ...y) { } : (...x: any[], ...y: any[]) => void
>foo : (...x: any[], ...y: any[]) => void
>x : any[]
>y : any[]

    b: (...x) => { }
>b : (...x: any[]) => void
>(...x) => { } : (...x: any[]) => void
>x : any[]
}