File: mappedTypes3.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 (135 lines) | stat: -rw-r--r-- 5,138 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
=== tests/cases/conformance/types/mapped/mappedTypes3.ts ===

class Box<P> {
>Box : Symbol(Box, Decl(mappedTypes3.ts, 0, 0))
>P : Symbol(P, Decl(mappedTypes3.ts, 1, 10))

    value: P;
>value : Symbol(Box.value, Decl(mappedTypes3.ts, 1, 14))
>P : Symbol(P, Decl(mappedTypes3.ts, 1, 10))
}

type Boxified<T> = {
>Boxified : Symbol(Boxified, Decl(mappedTypes3.ts, 3, 1))
>T : Symbol(T, Decl(mappedTypes3.ts, 5, 14))

    [K in keyof T]: Box<T[K]>;
>K : Symbol(K, Decl(mappedTypes3.ts, 6, 5))
>T : Symbol(T, Decl(mappedTypes3.ts, 5, 14))
>Box : Symbol(Box, Decl(mappedTypes3.ts, 0, 0))
>T : Symbol(T, Decl(mappedTypes3.ts, 5, 14))
>K : Symbol(K, Decl(mappedTypes3.ts, 6, 5))
}

declare function boxify<T>(obj: T): Boxified<T>;
>boxify : Symbol(boxify, Decl(mappedTypes3.ts, 7, 1))
>T : Symbol(T, Decl(mappedTypes3.ts, 9, 24))
>obj : Symbol(obj, Decl(mappedTypes3.ts, 9, 27))
>T : Symbol(T, Decl(mappedTypes3.ts, 9, 24))
>Boxified : Symbol(Boxified, Decl(mappedTypes3.ts, 3, 1))
>T : Symbol(T, Decl(mappedTypes3.ts, 9, 24))

declare function unboxify<T>(obj: Boxified<T>): T;
>unboxify : Symbol(unboxify, Decl(mappedTypes3.ts, 9, 48))
>T : Symbol(T, Decl(mappedTypes3.ts, 10, 26))
>obj : Symbol(obj, Decl(mappedTypes3.ts, 10, 29))
>Boxified : Symbol(Boxified, Decl(mappedTypes3.ts, 3, 1))
>T : Symbol(T, Decl(mappedTypes3.ts, 10, 26))
>T : Symbol(T, Decl(mappedTypes3.ts, 10, 26))

interface Bacon {
>Bacon : Symbol(Bacon, Decl(mappedTypes3.ts, 10, 50))

    isPerfect: boolean;
>isPerfect : Symbol(Bacon.isPerfect, Decl(mappedTypes3.ts, 12, 17))

    weight: number;
>weight : Symbol(Bacon.weight, Decl(mappedTypes3.ts, 13, 23))
}

interface BoxifiedBacon {
>BoxifiedBacon : Symbol(BoxifiedBacon, Decl(mappedTypes3.ts, 15, 1))

    isPerfect: Box<boolean>;
>isPerfect : Symbol(BoxifiedBacon.isPerfect, Decl(mappedTypes3.ts, 17, 25))
>Box : Symbol(Box, Decl(mappedTypes3.ts, 0, 0))

    weight: Box<number>;
>weight : Symbol(BoxifiedBacon.weight, Decl(mappedTypes3.ts, 18, 28))
>Box : Symbol(Box, Decl(mappedTypes3.ts, 0, 0))
}

function f1(b: Bacon) {
>f1 : Symbol(f1, Decl(mappedTypes3.ts, 20, 1))
>b : Symbol(b, Decl(mappedTypes3.ts, 22, 12))
>Bacon : Symbol(Bacon, Decl(mappedTypes3.ts, 10, 50))

    let bb = boxify(b);
>bb : Symbol(bb, Decl(mappedTypes3.ts, 23, 7))
>boxify : Symbol(boxify, Decl(mappedTypes3.ts, 7, 1))
>b : Symbol(b, Decl(mappedTypes3.ts, 22, 12))

    let isPerfect = bb.isPerfect.value;
>isPerfect : Symbol(isPerfect, Decl(mappedTypes3.ts, 24, 7))
>bb.isPerfect.value : Symbol(Box.value, Decl(mappedTypes3.ts, 1, 14))
>bb.isPerfect : Symbol(isPerfect)
>bb : Symbol(bb, Decl(mappedTypes3.ts, 23, 7))
>isPerfect : Symbol(isPerfect)
>value : Symbol(Box.value, Decl(mappedTypes3.ts, 1, 14))

    let weight = bb.weight.value;
>weight : Symbol(weight, Decl(mappedTypes3.ts, 25, 7))
>bb.weight.value : Symbol(Box.value, Decl(mappedTypes3.ts, 1, 14))
>bb.weight : Symbol(weight)
>bb : Symbol(bb, Decl(mappedTypes3.ts, 23, 7))
>weight : Symbol(weight)
>value : Symbol(Box.value, Decl(mappedTypes3.ts, 1, 14))
}

function f2(bb: Boxified<Bacon>) {
>f2 : Symbol(f2, Decl(mappedTypes3.ts, 26, 1))
>bb : Symbol(bb, Decl(mappedTypes3.ts, 28, 12))
>Boxified : Symbol(Boxified, Decl(mappedTypes3.ts, 3, 1))
>Bacon : Symbol(Bacon, Decl(mappedTypes3.ts, 10, 50))

    let b = unboxify(bb);  // Infer Bacon for T
>b : Symbol(b, Decl(mappedTypes3.ts, 29, 7))
>unboxify : Symbol(unboxify, Decl(mappedTypes3.ts, 9, 48))
>bb : Symbol(bb, Decl(mappedTypes3.ts, 28, 12))

    let bool = b.isPerfect;
>bool : Symbol(bool, Decl(mappedTypes3.ts, 30, 7))
>b.isPerfect : Symbol(Bacon.isPerfect, Decl(mappedTypes3.ts, 12, 17))
>b : Symbol(b, Decl(mappedTypes3.ts, 29, 7))
>isPerfect : Symbol(Bacon.isPerfect, Decl(mappedTypes3.ts, 12, 17))

    let weight = b.weight;
>weight : Symbol(weight, Decl(mappedTypes3.ts, 31, 7))
>b.weight : Symbol(Bacon.weight, Decl(mappedTypes3.ts, 13, 23))
>b : Symbol(b, Decl(mappedTypes3.ts, 29, 7))
>weight : Symbol(Bacon.weight, Decl(mappedTypes3.ts, 13, 23))
}

function f3(bb: BoxifiedBacon) {
>f3 : Symbol(f3, Decl(mappedTypes3.ts, 32, 1))
>bb : Symbol(bb, Decl(mappedTypes3.ts, 34, 12))
>BoxifiedBacon : Symbol(BoxifiedBacon, Decl(mappedTypes3.ts, 15, 1))

    let b = unboxify<Bacon>(bb);  // Explicit type parameter required
>b : Symbol(b, Decl(mappedTypes3.ts, 35, 7))
>unboxify : Symbol(unboxify, Decl(mappedTypes3.ts, 9, 48))
>Bacon : Symbol(Bacon, Decl(mappedTypes3.ts, 10, 50))
>bb : Symbol(bb, Decl(mappedTypes3.ts, 34, 12))

    let bool = b.isPerfect;
>bool : Symbol(bool, Decl(mappedTypes3.ts, 36, 7))
>b.isPerfect : Symbol(Bacon.isPerfect, Decl(mappedTypes3.ts, 12, 17))
>b : Symbol(b, Decl(mappedTypes3.ts, 35, 7))
>isPerfect : Symbol(Bacon.isPerfect, Decl(mappedTypes3.ts, 12, 17))

    let weight = bb.weight;
>weight : Symbol(weight, Decl(mappedTypes3.ts, 37, 7))
>bb.weight : Symbol(BoxifiedBacon.weight, Decl(mappedTypes3.ts, 18, 28))
>bb : Symbol(bb, Decl(mappedTypes3.ts, 34, 12))
>weight : Symbol(BoxifiedBacon.weight, Decl(mappedTypes3.ts, 18, 28))
}