diff --git a/tests/baselines/reference/typeGuardFunctionOfFormThis.types b/tests/baselines/reference/typeGuardFunctionOfFormThis.types index 6b21fea3457..cd0381a94e9 100644 --- a/tests/baselines/reference/typeGuardFunctionOfFormThis.types +++ b/tests/baselines/reference/typeGuardFunctionOfFormThis.types @@ -174,9 +174,9 @@ if (holder2.a.isLeader()) { >isLeader : () => this is LeadGuard holder2.a; ->holder2.a : RoyalGuard +>holder2.a : LeadGuard >holder2 : { a: RoyalGuard; } ->a : RoyalGuard +>a : LeadGuard } else { holder2.a; diff --git a/tests/baselines/reference/typeGuardsInProperties.types b/tests/baselines/reference/typeGuardsInProperties.types index ca4d8b94527..d6c9602a450 100644 --- a/tests/baselines/reference/typeGuardsInProperties.types +++ b/tests/baselines/reference/typeGuardsInProperties.types @@ -76,18 +76,18 @@ var c1: C1; >C1 : C1 strOrNum = typeof c1.pp2 === "string" && c1.pp2; // string | number ->strOrNum = typeof c1.pp2 === "string" && c1.pp2 : string | number +>strOrNum = typeof c1.pp2 === "string" && c1.pp2 : string >strOrNum : string | number ->typeof c1.pp2 === "string" && c1.pp2 : string | number +>typeof c1.pp2 === "string" && c1.pp2 : string >typeof c1.pp2 === "string" : boolean >typeof c1.pp2 : string >c1.pp2 : string | number >c1 : C1 >pp2 : string | number >"string" : string ->c1.pp2 : string | number +>c1.pp2 : string >c1 : C1 ->pp2 : string | number +>pp2 : string strOrNum = typeof c1.pp3 === "string" && c1.pp3; // string | number >strOrNum = typeof c1.pp3 === "string" && c1.pp3 : string | number @@ -111,16 +111,16 @@ var obj1: { }; strOrNum = typeof obj1.x === "string" && obj1.x; // string | number ->strOrNum = typeof obj1.x === "string" && obj1.x : string | number +>strOrNum = typeof obj1.x === "string" && obj1.x : string >strOrNum : string | number ->typeof obj1.x === "string" && obj1.x : string | number +>typeof obj1.x === "string" && obj1.x : string >typeof obj1.x === "string" : boolean >typeof obj1.x : string >obj1.x : string | number >obj1 : { x: string | number; } >x : string | number >"string" : string ->obj1.x : string | number +>obj1.x : string >obj1 : { x: string | number; } ->x : string | number +>x : string diff --git a/tests/baselines/reference/typeGuardsOnClassProperty.errors.txt b/tests/baselines/reference/typeGuardsOnClassProperty.errors.txt index 91d6d6998bc..660962ec1a7 100644 --- a/tests/baselines/reference/typeGuardsOnClassProperty.errors.txt +++ b/tests/baselines/reference/typeGuardsOnClassProperty.errors.txt @@ -1,8 +1,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts(14,70): error TS2339: Property 'join' does not exist on type 'string | string[]'. -tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts(26,44): error TS2339: Property 'toLowerCase' does not exist on type 'number | string'. -==== tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts (2 errors) ==== +==== tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts (1 errors) ==== // Note that type guards affect types of variables and parameters only and // have no effect on members of objects such as properties. @@ -31,7 +30,5 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts(26,4 } if (typeof o.prop1 === "string" && o.prop1.toLowerCase()) {} - ~~~~~~~~~~~ -!!! error TS2339: Property 'toLowerCase' does not exist on type 'number | string'. var prop1 = o.prop1; if (typeof prop1 === "string" && prop1.toLocaleLowerCase()) { } \ No newline at end of file