File: implicitAnyDeclareFunctionWithoutFormalType.symbols

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 (38 lines) | stat: -rw-r--r-- 2,127 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
=== tests/cases/compiler/implicitAnyDeclareFunctionWithoutFormalType.ts ===
// these should be errors
function foo(x) { };
>foo : Symbol(foo, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 0, 0))
>x : Symbol(x, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 1, 13))

function bar(x: number, y) { };  // error at "y"; no error at "x"
>bar : Symbol(bar, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 1, 20))
>x : Symbol(x, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 2, 13))
>y : Symbol(y, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 2, 23))

function func2(a, b, c) { };     // error at "a,b,c"
>func2 : Symbol(func2, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 2, 31))
>a : Symbol(a, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 3, 15))
>b : Symbol(b, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 3, 17))
>c : Symbol(c, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 3, 20))

function func3(...args) { };     // error at "args" 
>func3 : Symbol(func3, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 3, 28))
>args : Symbol(args, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 4, 15))

function func4(z= null, w= undefined) { };  // error at "z,w"
>func4 : Symbol(func4, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 4, 28))
>z : Symbol(z, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 5, 15))
>w : Symbol(w, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 5, 23))
>undefined : Symbol(undefined)

// these shouldn't be errors
function noError1(x= 3, y= 2) { };
>noError1 : Symbol(noError1, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 5, 42))
>x : Symbol(x, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 8, 18))
>y : Symbol(y, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 8, 23))

function noError2(x: number, y: string) { };
>noError2 : Symbol(noError2, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 8, 34))
>x : Symbol(x, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 9, 18))
>y : Symbol(y, Decl(implicitAnyDeclareFunctionWithoutFormalType.ts, 9, 28))