File: callOverload.symbols

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (39 lines) | stat: -rw-r--r-- 1,330 bytes parent folder | download | duplicates (4)
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
=== tests/cases/conformance/expressions/functionCalls/callOverload.ts ===
declare function fn(x: any): void;
>fn : Symbol(fn, Decl(callOverload.ts, 0, 0))
>x : Symbol(x, Decl(callOverload.ts, 0, 20))

declare function takeTwo(x: any, y: any): void;
>takeTwo : Symbol(takeTwo, Decl(callOverload.ts, 0, 34))
>x : Symbol(x, Decl(callOverload.ts, 1, 25))
>y : Symbol(y, Decl(callOverload.ts, 1, 32))

declare function withRest(a: any, ...args: Array<any>): void;
>withRest : Symbol(withRest, Decl(callOverload.ts, 1, 47))
>a : Symbol(a, Decl(callOverload.ts, 2, 26))
>args : Symbol(args, Decl(callOverload.ts, 2, 33))
>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))

var n: number[];
>n : Symbol(n, Decl(callOverload.ts, 3, 3))

fn(1) // no error
>fn : Symbol(fn, Decl(callOverload.ts, 0, 0))

fn(1, 2, 3, 4)
>fn : Symbol(fn, Decl(callOverload.ts, 0, 0))

takeTwo(1, 2, 3, 4)
>takeTwo : Symbol(takeTwo, Decl(callOverload.ts, 0, 34))

withRest('a', ...n); // no error
>withRest : Symbol(withRest, Decl(callOverload.ts, 1, 47))
>n : Symbol(n, Decl(callOverload.ts, 3, 3))

withRest();
>withRest : Symbol(withRest, Decl(callOverload.ts, 1, 47))

withRest(...n); 
>withRest : Symbol(withRest, Decl(callOverload.ts, 1, 47))
>n : Symbol(n, Decl(callOverload.ts, 3, 3))