-
Notifications
You must be signed in to change notification settings - Fork 12.8k
/
Copy pathcontrolFlowOptionalChain4.symbols
141 lines (111 loc) · 6.72 KB
/
controlFlowOptionalChain4.symbols
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
//// [tests/cases/conformance/controlFlow/controlFlowOptionalChain4.ts] ////
=== controlFlowOptionalChain4.ts ===
// https://github.com/microsoft/TypeScript/issues/56998
type Type = {
>Type : Symbol(Type, Decl(controlFlowOptionalChain4.ts, 0, 0))
id: number;
>id : Symbol(id, Decl(controlFlowOptionalChain4.ts, 2, 13))
};
type InferenceInfo = {
>InferenceInfo : Symbol(InferenceInfo, Decl(controlFlowOptionalChain4.ts, 4, 2))
typeParameter: Type;
>typeParameter : Symbol(typeParameter, Decl(controlFlowOptionalChain4.ts, 6, 22))
>Type : Symbol(Type, Decl(controlFlowOptionalChain4.ts, 0, 0))
impliedArity?: number;
>impliedArity : Symbol(impliedArity, Decl(controlFlowOptionalChain4.ts, 7, 22))
};
declare function getInferenceInfoForType(type: Type): InferenceInfo | undefined;
>getInferenceInfoForType : Symbol(getInferenceInfoForType, Decl(controlFlowOptionalChain4.ts, 9, 2))
>type : Symbol(type, Decl(controlFlowOptionalChain4.ts, 11, 41))
>Type : Symbol(Type, Decl(controlFlowOptionalChain4.ts, 0, 0))
>InferenceInfo : Symbol(InferenceInfo, Decl(controlFlowOptionalChain4.ts, 4, 2))
function fn1(t1: Type, t2: Type) {
>fn1 : Symbol(fn1, Decl(controlFlowOptionalChain4.ts, 11, 80))
>t1 : Symbol(t1, Decl(controlFlowOptionalChain4.ts, 13, 13))
>Type : Symbol(Type, Decl(controlFlowOptionalChain4.ts, 0, 0))
>t2 : Symbol(t2, Decl(controlFlowOptionalChain4.ts, 13, 22))
>Type : Symbol(Type, Decl(controlFlowOptionalChain4.ts, 0, 0))
let info = getInferenceInfoForType(t1);
>info : Symbol(info, Decl(controlFlowOptionalChain4.ts, 14, 5))
>getInferenceInfoForType : Symbol(getInferenceInfoForType, Decl(controlFlowOptionalChain4.ts, 9, 2))
>t1 : Symbol(t1, Decl(controlFlowOptionalChain4.ts, 13, 13))
if (info?.impliedArity !== undefined) {
>info?.impliedArity : Symbol(impliedArity, Decl(controlFlowOptionalChain4.ts, 7, 22))
>info : Symbol(info, Decl(controlFlowOptionalChain4.ts, 14, 5))
>impliedArity : Symbol(impliedArity, Decl(controlFlowOptionalChain4.ts, 7, 22))
>undefined : Symbol(undefined)
info.impliedArity;
>info.impliedArity : Symbol(impliedArity, Decl(controlFlowOptionalChain4.ts, 7, 22))
>info : Symbol(info, Decl(controlFlowOptionalChain4.ts, 14, 5))
>impliedArity : Symbol(impliedArity, Decl(controlFlowOptionalChain4.ts, 7, 22))
} else if ((info = getInferenceInfoForType(t2))?.impliedArity !== undefined) {
>(info = getInferenceInfoForType(t2))?.impliedArity : Symbol(impliedArity, Decl(controlFlowOptionalChain4.ts, 7, 22))
>info : Symbol(info, Decl(controlFlowOptionalChain4.ts, 14, 5))
>getInferenceInfoForType : Symbol(getInferenceInfoForType, Decl(controlFlowOptionalChain4.ts, 9, 2))
>t2 : Symbol(t2, Decl(controlFlowOptionalChain4.ts, 13, 22))
>impliedArity : Symbol(impliedArity, Decl(controlFlowOptionalChain4.ts, 7, 22))
>undefined : Symbol(undefined)
info.impliedArity;
>info.impliedArity : Symbol(impliedArity, Decl(controlFlowOptionalChain4.ts, 7, 22))
>info : Symbol(info, Decl(controlFlowOptionalChain4.ts, 14, 5))
>impliedArity : Symbol(impliedArity, Decl(controlFlowOptionalChain4.ts, 7, 22))
}
}
function fn2(t1: Type, t2: Type) {
>fn2 : Symbol(fn2, Decl(controlFlowOptionalChain4.ts, 20, 1))
>t1 : Symbol(t1, Decl(controlFlowOptionalChain4.ts, 22, 13))
>Type : Symbol(Type, Decl(controlFlowOptionalChain4.ts, 0, 0))
>t2 : Symbol(t2, Decl(controlFlowOptionalChain4.ts, 22, 22))
>Type : Symbol(Type, Decl(controlFlowOptionalChain4.ts, 0, 0))
let info = getInferenceInfoForType(t1);
>info : Symbol(info, Decl(controlFlowOptionalChain4.ts, 23, 5))
>getInferenceInfoForType : Symbol(getInferenceInfoForType, Decl(controlFlowOptionalChain4.ts, 9, 2))
>t1 : Symbol(t1, Decl(controlFlowOptionalChain4.ts, 22, 13))
if (info?.impliedArity !== undefined) {
>info?.impliedArity : Symbol(impliedArity, Decl(controlFlowOptionalChain4.ts, 7, 22))
>info : Symbol(info, Decl(controlFlowOptionalChain4.ts, 23, 5))
>impliedArity : Symbol(impliedArity, Decl(controlFlowOptionalChain4.ts, 7, 22))
>undefined : Symbol(undefined)
info.impliedArity;
>info.impliedArity : Symbol(impliedArity, Decl(controlFlowOptionalChain4.ts, 7, 22))
>info : Symbol(info, Decl(controlFlowOptionalChain4.ts, 23, 5))
>impliedArity : Symbol(impliedArity, Decl(controlFlowOptionalChain4.ts, 7, 22))
} else if ((info = getInferenceInfoForType(t2))?.impliedArity) {
>(info = getInferenceInfoForType(t2))?.impliedArity : Symbol(impliedArity, Decl(controlFlowOptionalChain4.ts, 7, 22))
>info : Symbol(info, Decl(controlFlowOptionalChain4.ts, 23, 5))
>getInferenceInfoForType : Symbol(getInferenceInfoForType, Decl(controlFlowOptionalChain4.ts, 9, 2))
>t2 : Symbol(t2, Decl(controlFlowOptionalChain4.ts, 22, 22))
>impliedArity : Symbol(impliedArity, Decl(controlFlowOptionalChain4.ts, 7, 22))
info.impliedArity;
>info.impliedArity : Symbol(impliedArity, Decl(controlFlowOptionalChain4.ts, 7, 22))
>info : Symbol(info, Decl(controlFlowOptionalChain4.ts, 23, 5))
>impliedArity : Symbol(impliedArity, Decl(controlFlowOptionalChain4.ts, 7, 22))
}
}
// https://github.com/microsoft/TypeScript/issues/60855
type Option = { type: "Some"; value: number } | { type: "None" };
>Option : Symbol(Option, Decl(lib.dom.d.ts, --, --), Decl(controlFlowOptionalChain4.ts, 29, 1))
>type : Symbol(type, Decl(controlFlowOptionalChain4.ts, 33, 15))
>value : Symbol(value, Decl(controlFlowOptionalChain4.ts, 33, 29))
>type : Symbol(type, Decl(controlFlowOptionalChain4.ts, 33, 49))
declare function someOptionalOption(): Option | undefined;
>someOptionalOption : Symbol(someOptionalOption, Decl(controlFlowOptionalChain4.ts, 33, 65))
>Option : Symbol(Option, Decl(lib.dom.d.ts, --, --), Decl(controlFlowOptionalChain4.ts, 29, 1))
function test60855(): number | undefined {
>test60855 : Symbol(test60855, Decl(controlFlowOptionalChain4.ts, 35, 58))
let option: Option | undefined;
>option : Symbol(option, Decl(controlFlowOptionalChain4.ts, 38, 5))
>Option : Symbol(Option, Decl(lib.dom.d.ts, --, --), Decl(controlFlowOptionalChain4.ts, 29, 1))
if ((option = someOptionalOption())?.type === "Some") {
>(option = someOptionalOption())?.type : Symbol(type, Decl(controlFlowOptionalChain4.ts, 33, 15), Decl(controlFlowOptionalChain4.ts, 33, 49))
>option : Symbol(option, Decl(controlFlowOptionalChain4.ts, 38, 5))
>someOptionalOption : Symbol(someOptionalOption, Decl(controlFlowOptionalChain4.ts, 33, 65))
>type : Symbol(type, Decl(controlFlowOptionalChain4.ts, 33, 15), Decl(controlFlowOptionalChain4.ts, 33, 49))
return option.value;
>option.value : Symbol(value, Decl(controlFlowOptionalChain4.ts, 33, 29))
>option : Symbol(option, Decl(controlFlowOptionalChain4.ts, 38, 5))
>value : Symbol(value, Decl(controlFlowOptionalChain4.ts, 33, 29))
}
return undefined;
>undefined : Symbol(undefined)
}