Skip to content

Commit 8b43b3d

Browse files
committed
Update test
1 parent ac9b16c commit 8b43b3d

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.errors.txt

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(12,10): error TS2339: Property 'bar' does not exist on type 'A'.
22
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(33,5): error TS2322: Type 'string' is not assignable to type 'number'.
33
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(34,10): error TS2339: Property 'bar' does not exist on type 'B<number>'.
4-
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(62,10): error TS2339: Property 'bar1' does not exist on type 'C1 | C2'.
5-
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(63,10): error TS2339: Property 'bar2' does not exist on type 'C1 | C2'.
6-
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(82,10): error TS2339: Property 'bar' does not exist on type 'D'.
7-
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(108,10): error TS2339: Property 'bar1' does not exist on type 'E1 | E2'.
8-
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(109,10): error TS2339: Property 'bar2' does not exist on type 'E1 | E2'.
9-
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(131,11): error TS2339: Property 'foo' does not exist on type 'string | F'.
10-
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(132,11): error TS2339: Property 'bar' does not exist on type 'string | F'.
11-
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(157,11): error TS2339: Property 'foo2' does not exist on type 'G1'.
12-
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(179,11): error TS2339: Property 'bar' does not exist on type 'H'.
4+
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(65,10): error TS2339: Property 'bar1' does not exist on type 'C1 | C2'.
5+
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(66,10): error TS2339: Property 'bar2' does not exist on type 'C1 | C2'.
6+
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(85,10): error TS2339: Property 'bar' does not exist on type 'D'.
7+
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(111,10): error TS2339: Property 'bar1' does not exist on type 'E1 | E2'.
8+
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(112,10): error TS2339: Property 'bar2' does not exist on type 'E1 | E2'.
9+
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(134,11): error TS2339: Property 'foo' does not exist on type 'string | F'.
10+
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(135,11): error TS2339: Property 'bar' does not exist on type 'string | F'.
11+
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(160,11): error TS2339: Property 'foo2' does not exist on type 'G1'.
12+
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(182,11): error TS2339: Property 'bar' does not exist on type 'H'.
1313

1414

1515
==== tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts (12 errors) ====
@@ -69,17 +69,20 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstru
6969
}
7070
interface C1 {
7171
foo: string;
72+
c: string;
7273
bar1: number;
7374
}
7475
interface C2 {
7576
foo: string;
77+
c: string;
7678
bar2: number;
7779
}
7880
declare var C: CConstructor;
7981

8082
var obj5: C1 | A;
81-
if (obj5 instanceof C) { // narrowed to C1.
83+
if (obj5 instanceof C) { // narrowed to C1|C2.
8284
obj5.foo;
85+
obj5.c;
8386
obj5.bar1;
8487
~~~~
8588
!!! error TS2339: Property 'bar1' does not exist on type 'C1 | C2'.
@@ -130,7 +133,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstru
130133
declare var E: EConstructor;
131134

132135
var obj9: E1 | A;
133-
if (obj9 instanceof E) { // narrowed to E1.
136+
if (obj9 instanceof E) { // narrowed to E1 | E2
134137
obj9.foo;
135138
obj9.bar1;
136139
~~~~

tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,20 @@ interface CConstructor {
4949
}
5050
interface C1 {
5151
foo: string;
52+
c: string;
5253
bar1: number;
5354
}
5455
interface C2 {
5556
foo: string;
57+
c: string;
5658
bar2: number;
5759
}
5860
declare var C: CConstructor;
5961

6062
var obj5: C1 | A;
61-
if (obj5 instanceof C) { // narrowed to C1.
63+
if (obj5 instanceof C) { // narrowed to C1|C2.
6264
obj5.foo;
65+
obj5.c;
6366
obj5.bar1;
6467
obj5.bar2;
6568
}
@@ -104,7 +107,7 @@ interface E2 {
104107
declare var E: EConstructor;
105108

106109
var obj9: E1 | A;
107-
if (obj9 instanceof E) { // narrowed to E1.
110+
if (obj9 instanceof E) { // narrowed to E1 | E2
108111
obj9.foo;
109112
obj9.bar1;
110113
obj9.bar2;
@@ -213,6 +216,7 @@ if (obj4 instanceof B) {
213216
var obj5;
214217
if (obj5 instanceof C) {
215218
obj5.foo;
219+
obj5.c;
216220
obj5.bar1;
217221
obj5.bar2;
218222
}

tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,20 @@ interface CConstructor {
4848
}
4949
interface C1 {
5050
foo: string;
51+
c: string;
5152
bar1: number;
5253
}
5354
interface C2 {
5455
foo: string;
56+
c: string;
5557
bar2: number;
5658
}
5759
declare var C: CConstructor;
5860

5961
var obj5: C1 | A;
60-
if (obj5 instanceof C) { // narrowed to C1.
62+
if (obj5 instanceof C) { // narrowed to C1|C2.
6163
obj5.foo;
64+
obj5.c;
6265
obj5.bar1;
6366
obj5.bar2;
6467
}
@@ -103,7 +106,7 @@ interface E2 {
103106
declare var E: EConstructor;
104107

105108
var obj9: E1 | A;
106-
if (obj9 instanceof E) { // narrowed to E1.
109+
if (obj9 instanceof E) { // narrowed to E1 | E2
107110
obj9.foo;
108111
obj9.bar1;
109112
obj9.bar2;

0 commit comments

Comments
 (0)