Skip to content

Commit 7d32355

Browse files
committed
Accept new baselines
1 parent 2447bd7 commit 7d32355

File tree

4 files changed

+20
-23
lines changed

4 files changed

+20
-23
lines changed

tests/baselines/reference/controlFlowOptionalChain.errors.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(35,5): error TS2
66
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(39,1): error TS2722: Cannot invoke an object which is possibly 'undefined'.
77
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(52,5): error TS2532: Object is possibly 'undefined'.
88
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(57,1): error TS2532: Object is possibly 'undefined'.
9-
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(62,5): error TS2532: Object is possibly 'undefined'.
109
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(68,5): error TS2532: Object is possibly 'undefined'.
1110
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(72,1): error TS2532: Object is possibly 'undefined'.
1211
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(83,5): error TS2532: Object is possibly 'undefined'.
@@ -22,7 +21,7 @@ tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(134,1): error TS
2221
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(153,9): error TS2775: Assertions require every name in the call target to be declared with an explicit type annotation.
2322

2423

25-
==== tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts (22 errors) ====
24+
==== tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts (21 errors) ====
2625
// assignments in shortcutting chain
2726
declare const o: undefined | {
2827
[key: string]: any;
@@ -99,10 +98,8 @@ tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(153,9): error TS
9998

10099
declare const o3: { x: 1, y: string } | { x: 2, y: number } | undefined;
101100
if (o3?.x === 1) {
102-
o3; // TODO: should be `{ x: y, y: string }`
103-
o3.x; // TODO: should not be an error.
104-
~~
105-
!!! error TS2532: Object is possibly 'undefined'.
101+
o3;
102+
o3.x;
106103
o3?.x;
107104
}
108105
else {

tests/baselines/reference/controlFlowOptionalChain.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ o2.f;
5959

6060
declare const o3: { x: 1, y: string } | { x: 2, y: number } | undefined;
6161
if (o3?.x === 1) {
62-
o3; // TODO: should be `{ x: y, y: string }`
63-
o3.x; // TODO: should not be an error.
62+
o3;
63+
o3.x;
6464
o3?.x;
6565
}
6666
else {
@@ -206,8 +206,8 @@ o2;
206206
(_k = o2) === null || _k === void 0 ? void 0 : _k.f;
207207
o2.f;
208208
if (((_l = o3) === null || _l === void 0 ? void 0 : _l.x) === 1) {
209-
o3; // TODO: should be `{ x: y, y: string }`
210-
o3.x; // TODO: should not be an error.
209+
o3;
210+
o3.x;
211211
(_m = o3) === null || _m === void 0 ? void 0 : _m.x;
212212
}
213213
else {

tests/baselines/reference/controlFlowOptionalChain.symbols

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,18 +182,18 @@ if (o3?.x === 1) {
182182
>o3 : Symbol(o3, Decl(controlFlowOptionalChain.ts, 58, 13))
183183
>x : Symbol(x, Decl(controlFlowOptionalChain.ts, 58, 19), Decl(controlFlowOptionalChain.ts, 58, 41))
184184

185-
o3; // TODO: should be `{ x: y, y: string }`
185+
o3;
186186
>o3 : Symbol(o3, Decl(controlFlowOptionalChain.ts, 58, 13))
187187

188-
o3.x; // TODO: should not be an error.
189-
>o3.x : Symbol(x, Decl(controlFlowOptionalChain.ts, 58, 19), Decl(controlFlowOptionalChain.ts, 58, 41))
188+
o3.x;
189+
>o3.x : Symbol(x, Decl(controlFlowOptionalChain.ts, 58, 19))
190190
>o3 : Symbol(o3, Decl(controlFlowOptionalChain.ts, 58, 13))
191-
>x : Symbol(x, Decl(controlFlowOptionalChain.ts, 58, 19), Decl(controlFlowOptionalChain.ts, 58, 41))
191+
>x : Symbol(x, Decl(controlFlowOptionalChain.ts, 58, 19))
192192

193193
o3?.x;
194-
>o3?.x : Symbol(x, Decl(controlFlowOptionalChain.ts, 58, 19), Decl(controlFlowOptionalChain.ts, 58, 41))
194+
>o3?.x : Symbol(x, Decl(controlFlowOptionalChain.ts, 58, 19))
195195
>o3 : Symbol(o3, Decl(controlFlowOptionalChain.ts, 58, 13))
196-
>x : Symbol(x, Decl(controlFlowOptionalChain.ts, 58, 19), Decl(controlFlowOptionalChain.ts, 58, 41))
196+
>x : Symbol(x, Decl(controlFlowOptionalChain.ts, 58, 19))
197197
}
198198
else {
199199
o3;

tests/baselines/reference/controlFlowOptionalChain.types

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,18 +208,18 @@ if (o3?.x === 1) {
208208
>x : 1 | 2 | undefined
209209
>1 : 1
210210

211-
o3; // TODO: should be `{ x: y, y: string }`
212-
>o3 : { x: 1; y: string; } | { x: 2; y: number; } | undefined
211+
o3;
212+
>o3 : { x: 1; y: string; }
213213

214-
o3.x; // TODO: should not be an error.
214+
o3.x;
215215
>o3.x : 1
216-
>o3 : { x: 1; y: string; } | { x: 2; y: number; } | undefined
216+
>o3 : { x: 1; y: string; }
217217
>x : 1
218218

219219
o3?.x;
220-
>o3?.x : 1 | undefined
221-
>o3 : { x: 1; y: string; } | { x: 2; y: number; } | undefined
222-
>x : 1 | undefined
220+
>o3?.x : 1
221+
>o3 : { x: 1; y: string; }
222+
>x : 1
223223
}
224224
else {
225225
o3;

0 commit comments

Comments
 (0)