File: switchStatements.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 (115 lines) | stat: -rw-r--r-- 3,264 bytes parent folder | download | duplicates (2)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
=== tests/cases/conformance/statements/switchStatements/switchStatements.ts ===
module M {
>M : Symbol(M, Decl(switchStatements.ts, 0, 0))

    export function fn(x: number) {
>fn : Symbol(fn, Decl(switchStatements.ts, 0, 10))
>x : Symbol(x, Decl(switchStatements.ts, 1, 23))

        return '';
    }
}

var x: any;
>x : Symbol(x, Decl(switchStatements.ts, 6, 3))

switch (x) {
>x : Symbol(x, Decl(switchStatements.ts, 6, 3))

    case '':
    case 12:
    case true:
    case null:
    case undefined:
>undefined : Symbol(undefined)

    case new Date(12):
>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --))

    case new Object():
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))

    case /[a-z]/:
    case[]:
    case {}:
    case { id: 12 }:
>id : Symbol(id, Decl(switchStatements.ts, 18, 10))

    case['a']:
    case typeof x:
>x : Symbol(x, Decl(switchStatements.ts, 6, 3))

    case typeof M:
>M : Symbol(M, Decl(switchStatements.ts, 0, 0))

    case M.fn(1):
>M.fn : Symbol(M.fn, Decl(switchStatements.ts, 0, 10))
>M : Symbol(M, Decl(switchStatements.ts, 0, 0))
>fn : Symbol(M.fn, Decl(switchStatements.ts, 0, 10))

    case <T>(x: number) => '':
>T : Symbol(T, Decl(switchStatements.ts, 23, 10))
>x : Symbol(x, Decl(switchStatements.ts, 23, 13))

    case (<T>(x: number) => '')(2):
>T : Symbol(T, Decl(switchStatements.ts, 24, 11))
>x : Symbol(x, Decl(switchStatements.ts, 24, 14))

    default:
}

// basic assignable check, rest covered in tests for 'assignement compatibility'
class C { id: number; }
>C : Symbol(C, Decl(switchStatements.ts, 26, 1))
>id : Symbol(C.id, Decl(switchStatements.ts, 29, 9))

class D extends C { name: string }
>D : Symbol(D, Decl(switchStatements.ts, 29, 23))
>C : Symbol(C, Decl(switchStatements.ts, 26, 1))
>name : Symbol(D.name, Decl(switchStatements.ts, 30, 19))

switch (new C()) {
>C : Symbol(C, Decl(switchStatements.ts, 26, 1))

    case new D():
>D : Symbol(D, Decl(switchStatements.ts, 29, 23))

    case { id: 12, name: '' }:
>id : Symbol(id, Decl(switchStatements.ts, 34, 10))
>name : Symbol(name, Decl(switchStatements.ts, 34, 18))

    case new C():
>C : Symbol(C, Decl(switchStatements.ts, 26, 1))
}

switch ('') { }
switch (12) { }
switch (true) { }
switch (null) { }
switch (undefined) { }
>undefined : Symbol(undefined)

switch (new Date(12)) { }
>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --))

switch (new Object()) { }
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))

switch (/[a-z]/) { }
switch ([]) { }
switch ({}) { }
switch ({ id: 12 }) { }
>id : Symbol(id, Decl(switchStatements.ts, 48, 9))

switch (['a']) { }
switch (<T>(x: number) => '') { }
>T : Symbol(T, Decl(switchStatements.ts, 50, 9))
>x : Symbol(x, Decl(switchStatements.ts, 50, 12))

switch ((<T>(x: T) => '')(1)) { }
>T : Symbol(T, Decl(switchStatements.ts, 51, 10))
>x : Symbol(x, Decl(switchStatements.ts, 51, 13))
>T : Symbol(T, Decl(switchStatements.ts, 51, 10))