Accepting new baselines

This commit is contained in:
Anders Hejlsberg 2016-02-27 18:13:26 -08:00
parent 82169ce7eb
commit 7dd59ceff6
3 changed files with 11 additions and 14 deletions

View File

@ -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;

View File

@ -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

View File

@ -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()) { }