File: nonPrimitiveStrictNull.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 (147 lines) | stat: -rw-r--r-- 4,817 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
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
=== tests/cases/conformance/types/nonPrimitive/nonPrimitiveStrictNull.ts ===
var a: object
>a : Symbol(a, Decl(nonPrimitiveStrictNull.ts, 0, 3))

declare var b: object | null
>b : Symbol(b, Decl(nonPrimitiveStrictNull.ts, 1, 11))

declare var c: object | undefined
>c : Symbol(c, Decl(nonPrimitiveStrictNull.ts, 2, 11))

declare var d: object | null | undefined
>d : Symbol(d, Decl(nonPrimitiveStrictNull.ts, 3, 11))

var e: object | null
>e : Symbol(e, Decl(nonPrimitiveStrictNull.ts, 4, 3))

a.toString; // error
>a.toString : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --))
>a : Symbol(a, Decl(nonPrimitiveStrictNull.ts, 0, 3))
>toString : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --))

a = undefined; // error
>a : Symbol(a, Decl(nonPrimitiveStrictNull.ts, 0, 3))
>undefined : Symbol(undefined)

a = null; // error
>a : Symbol(a, Decl(nonPrimitiveStrictNull.ts, 0, 3))

a = b; // error
>a : Symbol(a, Decl(nonPrimitiveStrictNull.ts, 0, 3))
>b : Symbol(b, Decl(nonPrimitiveStrictNull.ts, 1, 11))

a = c; // error
>a : Symbol(a, Decl(nonPrimitiveStrictNull.ts, 0, 3))
>c : Symbol(c, Decl(nonPrimitiveStrictNull.ts, 2, 11))

a = d; // error
>a : Symbol(a, Decl(nonPrimitiveStrictNull.ts, 0, 3))
>d : Symbol(d, Decl(nonPrimitiveStrictNull.ts, 3, 11))

e = a; // ok
>e : Symbol(e, Decl(nonPrimitiveStrictNull.ts, 4, 3))
>a : Symbol(a, Decl(nonPrimitiveStrictNull.ts, 0, 3))

a = e; // ok
>a : Symbol(a, Decl(nonPrimitiveStrictNull.ts, 0, 3))
>e : Symbol(e, Decl(nonPrimitiveStrictNull.ts, 4, 3))

if (typeof b !== 'object') {
>b : Symbol(b, Decl(nonPrimitiveStrictNull.ts, 1, 11))

    b.toString(); // error, never
>b : Symbol(b, Decl(nonPrimitiveStrictNull.ts, 1, 11))
}

if (typeof b === 'object') {
>b : Symbol(b, Decl(nonPrimitiveStrictNull.ts, 1, 11))

    a = b; // error, b is not narrowed
>a : Symbol(a, Decl(nonPrimitiveStrictNull.ts, 0, 3))
>b : Symbol(b, Decl(nonPrimitiveStrictNull.ts, 1, 11))
}

if (typeof d === 'object') {
>d : Symbol(d, Decl(nonPrimitiveStrictNull.ts, 3, 11))

    b = d; // ok
>b : Symbol(b, Decl(nonPrimitiveStrictNull.ts, 1, 11))
>d : Symbol(d, Decl(nonPrimitiveStrictNull.ts, 3, 11))

    d.toString(); // error, object | null
>d.toString : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --))
>d : Symbol(d, Decl(nonPrimitiveStrictNull.ts, 3, 11))
>toString : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --))

} else {
    d.toString(); // error, undefined
>d : Symbol(d, Decl(nonPrimitiveStrictNull.ts, 3, 11))
}

if (d == null) {
>d : Symbol(d, Decl(nonPrimitiveStrictNull.ts, 3, 11))

    d.toString(); // error, undefined | null
>d : Symbol(d, Decl(nonPrimitiveStrictNull.ts, 3, 11))

} else {
    d.toString(); // object
>d.toString : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --))
>d : Symbol(d, Decl(nonPrimitiveStrictNull.ts, 3, 11))
>toString : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --))
}

if (d === null) {
>d : Symbol(d, Decl(nonPrimitiveStrictNull.ts, 3, 11))

    d.toString(); // error, null
>d : Symbol(d, Decl(nonPrimitiveStrictNull.ts, 3, 11))

} else {
    d.toString(); // error, object | undefined
>d.toString : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --))
>d : Symbol(d, Decl(nonPrimitiveStrictNull.ts, 3, 11))
>toString : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --))
}

if (typeof d === 'undefined') {
>d : Symbol(d, Decl(nonPrimitiveStrictNull.ts, 3, 11))

    d.toString(); // error, undefined
>d : Symbol(d, Decl(nonPrimitiveStrictNull.ts, 3, 11))

} else {
    d.toString(); // error, object | null
>d.toString : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --))
>d : Symbol(d, Decl(nonPrimitiveStrictNull.ts, 3, 11))
>toString : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --))
}

interface Proxy<T extends object> {}
>Proxy : Symbol(Proxy, Decl(nonPrimitiveStrictNull.ts, 46, 1))
>T : Symbol(T, Decl(nonPrimitiveStrictNull.ts, 48, 16))

var x: Proxy<number>; // error
>x : Symbol(x, Decl(nonPrimitiveStrictNull.ts, 50, 3))
>Proxy : Symbol(Proxy, Decl(nonPrimitiveStrictNull.ts, 46, 1))

var y: Proxy<null>; // error
>y : Symbol(y, Decl(nonPrimitiveStrictNull.ts, 51, 3))
>Proxy : Symbol(Proxy, Decl(nonPrimitiveStrictNull.ts, 46, 1))

var z: Proxy<undefined>; // error
>z : Symbol(z, Decl(nonPrimitiveStrictNull.ts, 52, 3))
>Proxy : Symbol(Proxy, Decl(nonPrimitiveStrictNull.ts, 46, 1))

interface Blah {
>Blah : Symbol(Blah, Decl(nonPrimitiveStrictNull.ts, 52, 24))

  foo: number;
>foo : Symbol(Blah.foo, Decl(nonPrimitiveStrictNull.ts, 54, 16))
}

var u: Proxy<Blah>; // ok
>u : Symbol(u, Decl(nonPrimitiveStrictNull.ts, 58, 3))
>Proxy : Symbol(Proxy, Decl(nonPrimitiveStrictNull.ts, 46, 1))
>Blah : Symbol(Blah, Decl(nonPrimitiveStrictNull.ts, 52, 24))