Accept new baselines

This commit is contained in:
Anders Hejlsberg
2019-10-04 16:01:27 -07:00
parent 2447bd775f
commit 7d32355f95
4 changed files with 20 additions and 23 deletions
@@ -6,7 +6,6 @@ tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(35,5): error TS2
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(39,1): error TS2722: Cannot invoke an object which is possibly 'undefined'.
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(52,5): error TS2532: Object is possibly 'undefined'.
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(57,1): error TS2532: Object is possibly 'undefined'.
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(62,5): error TS2532: Object is possibly 'undefined'.
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(68,5): error TS2532: Object is possibly 'undefined'.
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(72,1): error TS2532: Object is possibly 'undefined'.
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
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.
==== tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts (22 errors) ====
==== tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts (21 errors) ====
// assignments in shortcutting chain
declare const o: undefined | {
[key: string]: any;
@@ -99,10 +98,8 @@ tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(153,9): error TS
declare const o3: { x: 1, y: string } | { x: 2, y: number } | undefined;
if (o3?.x === 1) {
o3; // TODO: should be `{ x: y, y: string }`
o3.x; // TODO: should not be an error.
~~
!!! error TS2532: Object is possibly 'undefined'.
o3;
o3.x;
o3?.x;
}
else {
@@ -59,8 +59,8 @@ o2.f;
declare const o3: { x: 1, y: string } | { x: 2, y: number } | undefined;
if (o3?.x === 1) {
o3; // TODO: should be `{ x: y, y: string }`
o3.x; // TODO: should not be an error.
o3;
o3.x;
o3?.x;
}
else {
@@ -206,8 +206,8 @@ o2;
(_k = o2) === null || _k === void 0 ? void 0 : _k.f;
o2.f;
if (((_l = o3) === null || _l === void 0 ? void 0 : _l.x) === 1) {
o3; // TODO: should be `{ x: y, y: string }`
o3.x; // TODO: should not be an error.
o3;
o3.x;
(_m = o3) === null || _m === void 0 ? void 0 : _m.x;
}
else {
@@ -182,18 +182,18 @@ if (o3?.x === 1) {
>o3 : Symbol(o3, Decl(controlFlowOptionalChain.ts, 58, 13))
>x : Symbol(x, Decl(controlFlowOptionalChain.ts, 58, 19), Decl(controlFlowOptionalChain.ts, 58, 41))
o3; // TODO: should be `{ x: y, y: string }`
o3;
>o3 : Symbol(o3, Decl(controlFlowOptionalChain.ts, 58, 13))
o3.x; // TODO: should not be an error.
>o3.x : Symbol(x, Decl(controlFlowOptionalChain.ts, 58, 19), Decl(controlFlowOptionalChain.ts, 58, 41))
o3.x;
>o3.x : Symbol(x, Decl(controlFlowOptionalChain.ts, 58, 19))
>o3 : Symbol(o3, Decl(controlFlowOptionalChain.ts, 58, 13))
>x : Symbol(x, Decl(controlFlowOptionalChain.ts, 58, 19), Decl(controlFlowOptionalChain.ts, 58, 41))
>x : Symbol(x, Decl(controlFlowOptionalChain.ts, 58, 19))
o3?.x;
>o3?.x : Symbol(x, Decl(controlFlowOptionalChain.ts, 58, 19), Decl(controlFlowOptionalChain.ts, 58, 41))
>o3?.x : Symbol(x, Decl(controlFlowOptionalChain.ts, 58, 19))
>o3 : Symbol(o3, Decl(controlFlowOptionalChain.ts, 58, 13))
>x : Symbol(x, Decl(controlFlowOptionalChain.ts, 58, 19), Decl(controlFlowOptionalChain.ts, 58, 41))
>x : Symbol(x, Decl(controlFlowOptionalChain.ts, 58, 19))
}
else {
o3;
@@ -208,18 +208,18 @@ if (o3?.x === 1) {
>x : 1 | 2 | undefined
>1 : 1
o3; // TODO: should be `{ x: y, y: string }`
>o3 : { x: 1; y: string; } | { x: 2; y: number; } | undefined
o3;
>o3 : { x: 1; y: string; }
o3.x; // TODO: should not be an error.
o3.x;
>o3.x : 1
>o3 : { x: 1; y: string; } | { x: 2; y: number; } | undefined
>o3 : { x: 1; y: string; }
>x : 1
o3?.x;
>o3?.x : 1 | undefined
>o3 : { x: 1; y: string; } | { x: 2; y: number; } | undefined
>x : 1 | undefined
>o3?.x : 1
>o3 : { x: 1; y: string; }
>x : 1
}
else {
o3;