File: TypeGuardWithEnumUnion.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 (88 lines) | stat: -rw-r--r-- 3,554 bytes parent folder | download | duplicates (7)
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
=== tests/cases/conformance/expressions/typeGuards/TypeGuardWithEnumUnion.ts ===
enum Color { R, G, B }
>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
>R : Symbol(Color.R, Decl(TypeGuardWithEnumUnion.ts, 0, 12))
>G : Symbol(Color.G, Decl(TypeGuardWithEnumUnion.ts, 0, 15))
>B : Symbol(Color.B, Decl(TypeGuardWithEnumUnion.ts, 0, 18))

function f1(x: Color | string) {
>f1 : Symbol(f1, Decl(TypeGuardWithEnumUnion.ts, 0, 22))
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))

    if (typeof x === "number") {
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))

        var y = x;
>y : Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 4, 11), Decl(TypeGuardWithEnumUnion.ts, 5, 11))
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))

        var y: Color;
>y : Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 4, 11), Decl(TypeGuardWithEnumUnion.ts, 5, 11))
>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
    }
    else {
        var z = x;
>z : Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 8, 11), Decl(TypeGuardWithEnumUnion.ts, 9, 11))
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))

        var z: string;
>z : Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 8, 11), Decl(TypeGuardWithEnumUnion.ts, 9, 11))
    }
}

function f2(x: Color | string | string[]) {
>f2 : Symbol(f2, Decl(TypeGuardWithEnumUnion.ts, 11, 1))
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))

    if (typeof x === "object") {
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))

        var y = x;
>y : Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 15, 11), Decl(TypeGuardWithEnumUnion.ts, 16, 11))
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))

        var y: string[];
>y : Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 15, 11), Decl(TypeGuardWithEnumUnion.ts, 16, 11))
    }
    if (typeof x === "number") {
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))

        var z = x;
>z : Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 19, 11), Decl(TypeGuardWithEnumUnion.ts, 20, 11))
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))

        var z: Color;
>z : Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 19, 11), Decl(TypeGuardWithEnumUnion.ts, 20, 11))
>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
    }
    else {
        var w = x;
>w : Symbol(w, Decl(TypeGuardWithEnumUnion.ts, 23, 11), Decl(TypeGuardWithEnumUnion.ts, 24, 11))
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))

        var w: string | string[];
>w : Symbol(w, Decl(TypeGuardWithEnumUnion.ts, 23, 11), Decl(TypeGuardWithEnumUnion.ts, 24, 11))
    }
    if (typeof x === "string") {
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))

        var a = x;
>a : Symbol(a, Decl(TypeGuardWithEnumUnion.ts, 27, 11), Decl(TypeGuardWithEnumUnion.ts, 28, 11))
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))

        var a: string;
>a : Symbol(a, Decl(TypeGuardWithEnumUnion.ts, 27, 11), Decl(TypeGuardWithEnumUnion.ts, 28, 11))
    }
    else {
        var b = x;
>b : Symbol(b, Decl(TypeGuardWithEnumUnion.ts, 31, 11), Decl(TypeGuardWithEnumUnion.ts, 32, 11))
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))

        var b: Color | string[];
>b : Symbol(b, Decl(TypeGuardWithEnumUnion.ts, 31, 11), Decl(TypeGuardWithEnumUnion.ts, 32, 11))
>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
    }
}