File: mappedTypes4.symbols

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (198 lines) | stat: -rw-r--r-- 7,088 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
=== tests/cases/conformance/types/mapped/mappedTypes4.ts ===

type Box<T> = {
>Box : Symbol(Box, Decl(mappedTypes4.ts, 0, 0))
>T : Symbol(T, Decl(mappedTypes4.ts, 1, 9))

};

type Boxified<T> = {
>Boxified : Symbol(Boxified, Decl(mappedTypes4.ts, 2, 2))
>T : Symbol(T, Decl(mappedTypes4.ts, 4, 14))

    [P in keyof T]: Box<T[P]>;
>P : Symbol(P, Decl(mappedTypes4.ts, 5, 5))
>T : Symbol(T, Decl(mappedTypes4.ts, 4, 14))
>Box : Symbol(Box, Decl(mappedTypes4.ts, 0, 0))
>T : Symbol(T, Decl(mappedTypes4.ts, 4, 14))
>P : Symbol(P, Decl(mappedTypes4.ts, 5, 5))

};

function boxify<T>(obj: T): Boxified<T> {
>boxify : Symbol(boxify, Decl(mappedTypes4.ts, 6, 2))
>T : Symbol(T, Decl(mappedTypes4.ts, 8, 16))
>obj : Symbol(obj, Decl(mappedTypes4.ts, 8, 19))
>T : Symbol(T, Decl(mappedTypes4.ts, 8, 16))
>Boxified : Symbol(Boxified, Decl(mappedTypes4.ts, 2, 2))
>T : Symbol(T, Decl(mappedTypes4.ts, 8, 16))

    if (typeof obj === "object") {
>obj : Symbol(obj, Decl(mappedTypes4.ts, 8, 19))

        let result = {} as Boxified<T>;
>result : Symbol(result, Decl(mappedTypes4.ts, 10, 11))
>Boxified : Symbol(Boxified, Decl(mappedTypes4.ts, 2, 2))
>T : Symbol(T, Decl(mappedTypes4.ts, 8, 16))

        for (let k in obj) {
>k : Symbol(k, Decl(mappedTypes4.ts, 11, 16))
>obj : Symbol(obj, Decl(mappedTypes4.ts, 8, 19))

            result[k] = { value: obj[k] };
>result : Symbol(result, Decl(mappedTypes4.ts, 10, 11))
>k : Symbol(k, Decl(mappedTypes4.ts, 11, 16))
>value : Symbol(value, Decl(mappedTypes4.ts, 12, 25))
>obj : Symbol(obj, Decl(mappedTypes4.ts, 8, 19))
>k : Symbol(k, Decl(mappedTypes4.ts, 11, 16))
        }
        return result;
>result : Symbol(result, Decl(mappedTypes4.ts, 10, 11))
    }
    return <any>obj;
>obj : Symbol(obj, Decl(mappedTypes4.ts, 8, 19))
}

type A = { a: string };
>A : Symbol(A, Decl(mappedTypes4.ts, 17, 1))
>a : Symbol(a, Decl(mappedTypes4.ts, 19, 10))

type B = { b: string };
>B : Symbol(B, Decl(mappedTypes4.ts, 19, 23))
>b : Symbol(b, Decl(mappedTypes4.ts, 20, 10))

type C = { c: string };
>C : Symbol(C, Decl(mappedTypes4.ts, 20, 23))
>c : Symbol(c, Decl(mappedTypes4.ts, 21, 10))

function f1(x: A | B | C | undefined) {
>f1 : Symbol(f1, Decl(mappedTypes4.ts, 21, 23))
>x : Symbol(x, Decl(mappedTypes4.ts, 23, 12))
>A : Symbol(A, Decl(mappedTypes4.ts, 17, 1))
>B : Symbol(B, Decl(mappedTypes4.ts, 19, 23))
>C : Symbol(C, Decl(mappedTypes4.ts, 20, 23))

    return boxify(x);
>boxify : Symbol(boxify, Decl(mappedTypes4.ts, 6, 2))
>x : Symbol(x, Decl(mappedTypes4.ts, 23, 12))
}

type T00 = Partial<A | B | C>;
>T00 : Symbol(T00, Decl(mappedTypes4.ts, 25, 1))
>Partial : Symbol(Partial, Decl(lib.d.ts, --, --))
>A : Symbol(A, Decl(mappedTypes4.ts, 17, 1))
>B : Symbol(B, Decl(mappedTypes4.ts, 19, 23))
>C : Symbol(C, Decl(mappedTypes4.ts, 20, 23))

type T01 = Readonly<A | B | C | null | undefined>;
>T01 : Symbol(T01, Decl(mappedTypes4.ts, 27, 30))
>Readonly : Symbol(Readonly, Decl(lib.d.ts, --, --))
>A : Symbol(A, Decl(mappedTypes4.ts, 17, 1))
>B : Symbol(B, Decl(mappedTypes4.ts, 19, 23))
>C : Symbol(C, Decl(mappedTypes4.ts, 20, 23))

type T02 = Boxified<A | B[] | C | string>
>T02 : Symbol(T02, Decl(mappedTypes4.ts, 28, 50))
>Boxified : Symbol(Boxified, Decl(mappedTypes4.ts, 2, 2))
>A : Symbol(A, Decl(mappedTypes4.ts, 17, 1))
>B : Symbol(B, Decl(mappedTypes4.ts, 19, 23))
>C : Symbol(C, Decl(mappedTypes4.ts, 20, 23))

type T03 = Readonly<string | number | boolean | null | undefined | void>;
>T03 : Symbol(T03, Decl(mappedTypes4.ts, 29, 41))
>Readonly : Symbol(Readonly, Decl(lib.d.ts, --, --))

type T04 = Boxified<string | number | boolean | null | undefined | void>;
>T04 : Symbol(T04, Decl(mappedTypes4.ts, 30, 73))
>Boxified : Symbol(Boxified, Decl(mappedTypes4.ts, 2, 2))

type T05 = Partial<"hello" | "world" | 42>;
>T05 : Symbol(T05, Decl(mappedTypes4.ts, 31, 73))
>Partial : Symbol(Partial, Decl(lib.d.ts, --, --))

type BoxifiedWithSentinel<T, U> = {
>BoxifiedWithSentinel : Symbol(BoxifiedWithSentinel, Decl(mappedTypes4.ts, 32, 43))
>T : Symbol(T, Decl(mappedTypes4.ts, 34, 26))
>U : Symbol(U, Decl(mappedTypes4.ts, 34, 28))

    [P in keyof T]: Box<T[P]> | U;
>P : Symbol(P, Decl(mappedTypes4.ts, 35, 5))
>T : Symbol(T, Decl(mappedTypes4.ts, 34, 26))
>Box : Symbol(Box, Decl(mappedTypes4.ts, 0, 0))
>T : Symbol(T, Decl(mappedTypes4.ts, 34, 26))
>P : Symbol(P, Decl(mappedTypes4.ts, 35, 5))
>U : Symbol(U, Decl(mappedTypes4.ts, 34, 28))
}

type T10 = BoxifiedWithSentinel<A | B | C, null>;
>T10 : Symbol(T10, Decl(mappedTypes4.ts, 36, 1))
>BoxifiedWithSentinel : Symbol(BoxifiedWithSentinel, Decl(mappedTypes4.ts, 32, 43))
>A : Symbol(A, Decl(mappedTypes4.ts, 17, 1))
>B : Symbol(B, Decl(mappedTypes4.ts, 19, 23))
>C : Symbol(C, Decl(mappedTypes4.ts, 20, 23))

type T11 = BoxifiedWithSentinel<A | B | C, undefined>;
>T11 : Symbol(T11, Decl(mappedTypes4.ts, 38, 49))
>BoxifiedWithSentinel : Symbol(BoxifiedWithSentinel, Decl(mappedTypes4.ts, 32, 43))
>A : Symbol(A, Decl(mappedTypes4.ts, 17, 1))
>B : Symbol(B, Decl(mappedTypes4.ts, 19, 23))
>C : Symbol(C, Decl(mappedTypes4.ts, 20, 23))

type T12 = BoxifiedWithSentinel<string, undefined>;
>T12 : Symbol(T12, Decl(mappedTypes4.ts, 39, 54))
>BoxifiedWithSentinel : Symbol(BoxifiedWithSentinel, Decl(mappedTypes4.ts, 32, 43))

type DeepReadonly<T> = {
>DeepReadonly : Symbol(DeepReadonly, Decl(mappedTypes4.ts, 40, 51))
>T : Symbol(T, Decl(mappedTypes4.ts, 42, 18))

    readonly [P in keyof T]: DeepReadonly<T[P]>;
>P : Symbol(P, Decl(mappedTypes4.ts, 43, 14))
>T : Symbol(T, Decl(mappedTypes4.ts, 42, 18))
>DeepReadonly : Symbol(DeepReadonly, Decl(mappedTypes4.ts, 40, 51))
>T : Symbol(T, Decl(mappedTypes4.ts, 42, 18))
>P : Symbol(P, Decl(mappedTypes4.ts, 43, 14))

};

type Foo = {
>Foo : Symbol(Foo, Decl(mappedTypes4.ts, 44, 2))

    x: number;
>x : Symbol(x, Decl(mappedTypes4.ts, 46, 12))

    y: { a: string, b: number };
>y : Symbol(y, Decl(mappedTypes4.ts, 47, 14))
>a : Symbol(a, Decl(mappedTypes4.ts, 48, 8))
>b : Symbol(b, Decl(mappedTypes4.ts, 48, 19))

    z: boolean;
>z : Symbol(z, Decl(mappedTypes4.ts, 48, 32))

};

type DeepReadonlyFoo = {
>DeepReadonlyFoo : Symbol(DeepReadonlyFoo, Decl(mappedTypes4.ts, 50, 2))

    readonly x: number;
>x : Symbol(x, Decl(mappedTypes4.ts, 52, 24))

    readonly y: { readonly a: string, readonly b: number };
>y : Symbol(y, Decl(mappedTypes4.ts, 53, 23))
>a : Symbol(a, Decl(mappedTypes4.ts, 54, 17))
>b : Symbol(b, Decl(mappedTypes4.ts, 54, 37))

    readonly z: boolean;
>z : Symbol(z, Decl(mappedTypes4.ts, 54, 59))

};

var x1: DeepReadonly<Foo>;
>x1 : Symbol(x1, Decl(mappedTypes4.ts, 58, 3), Decl(mappedTypes4.ts, 59, 3))
>DeepReadonly : Symbol(DeepReadonly, Decl(mappedTypes4.ts, 40, 51))
>Foo : Symbol(Foo, Decl(mappedTypes4.ts, 44, 2))

var x1: DeepReadonlyFoo;
>x1 : Symbol(x1, Decl(mappedTypes4.ts, 58, 3), Decl(mappedTypes4.ts, 59, 3))
>DeepReadonlyFoo : Symbol(DeepReadonlyFoo, Decl(mappedTypes4.ts, 50, 2))