mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
Accepting new baselines
This commit is contained in:
parent
82169ce7eb
commit
7dd59ceff6
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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()) { }
|
||||
Loading…
x
Reference in New Issue
Block a user