Update test

This commit is contained in:
Mohamed Hegazy 2015-05-06 20:18:32 -07:00
parent ac9b16cff3
commit 8b43b3d18c
3 changed files with 25 additions and 15 deletions

View File

@ -1,15 +1,15 @@
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(12,10): error TS2339: Property 'bar' does not exist on type 'A'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(33,5): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(34,10): error TS2339: Property 'bar' does not exist on type 'B<number>'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(62,10): error TS2339: Property 'bar1' does not exist on type 'C1 | C2'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(63,10): error TS2339: Property 'bar2' does not exist on type 'C1 | C2'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(82,10): error TS2339: Property 'bar' does not exist on type 'D'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(108,10): error TS2339: Property 'bar1' does not exist on type 'E1 | E2'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(109,10): error TS2339: Property 'bar2' does not exist on type 'E1 | E2'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(131,11): error TS2339: Property 'foo' does not exist on type 'string | F'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(132,11): error TS2339: Property 'bar' does not exist on type 'string | F'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(157,11): error TS2339: Property 'foo2' does not exist on type 'G1'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(179,11): error TS2339: Property 'bar' does not exist on type 'H'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(65,10): error TS2339: Property 'bar1' does not exist on type 'C1 | C2'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(66,10): error TS2339: Property 'bar2' does not exist on type 'C1 | C2'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(85,10): error TS2339: Property 'bar' does not exist on type 'D'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(111,10): error TS2339: Property 'bar1' does not exist on type 'E1 | E2'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(112,10): error TS2339: Property 'bar2' does not exist on type 'E1 | E2'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(134,11): error TS2339: Property 'foo' does not exist on type 'string | F'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(135,11): error TS2339: Property 'bar' does not exist on type 'string | F'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(160,11): error TS2339: Property 'foo2' does not exist on type 'G1'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(182,11): error TS2339: Property 'bar' does not exist on type 'H'.
==== tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts (12 errors) ====
@ -69,17 +69,20 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstru
}
interface C1 {
foo: string;
c: string;
bar1: number;
}
interface C2 {
foo: string;
c: string;
bar2: number;
}
declare var C: CConstructor;
var obj5: C1 | A;
if (obj5 instanceof C) { // narrowed to C1.
if (obj5 instanceof C) { // narrowed to C1|C2.
obj5.foo;
obj5.c;
obj5.bar1;
~~~~
!!! error TS2339: Property 'bar1' does not exist on type 'C1 | C2'.
@ -130,7 +133,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstru
declare var E: EConstructor;
var obj9: E1 | A;
if (obj9 instanceof E) { // narrowed to E1.
if (obj9 instanceof E) { // narrowed to E1 | E2
obj9.foo;
obj9.bar1;
~~~~

View File

@ -49,17 +49,20 @@ interface CConstructor {
}
interface C1 {
foo: string;
c: string;
bar1: number;
}
interface C2 {
foo: string;
c: string;
bar2: number;
}
declare var C: CConstructor;
var obj5: C1 | A;
if (obj5 instanceof C) { // narrowed to C1.
if (obj5 instanceof C) { // narrowed to C1|C2.
obj5.foo;
obj5.c;
obj5.bar1;
obj5.bar2;
}
@ -104,7 +107,7 @@ interface E2 {
declare var E: EConstructor;
var obj9: E1 | A;
if (obj9 instanceof E) { // narrowed to E1.
if (obj9 instanceof E) { // narrowed to E1 | E2
obj9.foo;
obj9.bar1;
obj9.bar2;
@ -213,6 +216,7 @@ if (obj4 instanceof B) {
var obj5;
if (obj5 instanceof C) {
obj5.foo;
obj5.c;
obj5.bar1;
obj5.bar2;
}

View File

@ -48,17 +48,20 @@ interface CConstructor {
}
interface C1 {
foo: string;
c: string;
bar1: number;
}
interface C2 {
foo: string;
c: string;
bar2: number;
}
declare var C: CConstructor;
var obj5: C1 | A;
if (obj5 instanceof C) { // narrowed to C1.
if (obj5 instanceof C) { // narrowed to C1|C2.
obj5.foo;
obj5.c;
obj5.bar1;
obj5.bar2;
}
@ -103,7 +106,7 @@ interface E2 {
declare var E: EConstructor;
var obj9: E1 | A;
if (obj9 instanceof E) { // narrowed to E1.
if (obj9 instanceof E) { // narrowed to E1 | E2
obj9.foo;
obj9.bar1;
obj9.bar2;