@@ -13,7 +13,7 @@ if (obj1 instanceof A) { // narrowed to A.
13
13
}
14
14
15
15
var obj2 : any ;
16
- if ( obj2 instanceof A ) { // can't narrow type from 'any'
16
+ if ( obj2 instanceof A ) {
17
17
obj2 . foo ;
18
18
obj2 . bar ;
19
19
}
@@ -35,7 +35,7 @@ if (obj3 instanceof B) { // narrowed to B<number>.
35
35
}
36
36
37
37
var obj4 : any ;
38
- if ( obj4 instanceof B ) { // can't narrow type from 'any'
38
+ if ( obj4 instanceof B ) {
39
39
obj4 . foo = "str" ;
40
40
obj4 . foo = 1 ;
41
41
obj4 . bar = "str" ;
@@ -67,7 +67,7 @@ if (obj5 instanceof C) { // narrowed to C1|C2.
67
67
}
68
68
69
69
var obj6 : any ;
70
- if ( obj6 instanceof C ) { // can't narrow type from 'any'
70
+ if ( obj6 instanceof C ) {
71
71
obj6 . foo ;
72
72
obj6 . bar1 ;
73
73
obj6 . bar2 ;
@@ -86,7 +86,7 @@ if (obj7 instanceof D) { // narrowed to D.
86
86
}
87
87
88
88
var obj8 : any ;
89
- if ( obj8 instanceof D ) { // can't narrow type from 'any'
89
+ if ( obj8 instanceof D ) {
90
90
obj8 . foo ;
91
91
obj8 . bar ;
92
92
}
@@ -113,7 +113,7 @@ if (obj9 instanceof E) { // narrowed to E1 | E2
113
113
}
114
114
115
115
var obj10 : any ;
116
- if ( obj10 instanceof E ) { // can't narrow type from 'any'
116
+ if ( obj10 instanceof E ) {
117
117
obj10 . foo ;
118
118
obj10 . bar1 ;
119
119
obj10 . bar2 ;
@@ -136,7 +136,7 @@ if (obj11 instanceof F) { // can't type narrowing, construct signature returns a
136
136
}
137
137
138
138
var obj12 : any ;
139
- if ( obj12 instanceof F ) { // can't narrow type from 'any'
139
+ if ( obj12 instanceof F ) {
140
140
obj12 . foo ;
141
141
obj12 . bar ;
142
142
}
@@ -161,7 +161,7 @@ if (obj13 instanceof G) { // narrowed to G1. G1 is return type of prototype prop
161
161
}
162
162
163
163
var obj14 : any ;
164
- if ( obj14 instanceof G ) { // can't narrow type from 'any'
164
+ if ( obj14 instanceof G ) {
165
165
obj14 . foo1 ;
166
166
obj14 . foo2 ;
167
167
}
@@ -183,7 +183,19 @@ if (obj15 instanceof H) { // narrowed to H.
183
183
}
184
184
185
185
var obj16 : any ;
186
- if ( obj16 instanceof H ) { // can't narrow type from 'any'
186
+ if ( obj16 instanceof H ) {
187
187
obj16 . foo1 ;
188
188
obj16 . foo2 ;
189
189
}
190
+
191
+ var obj17 : any ;
192
+ if ( obj17 instanceof Object ) { // can't narrow type from 'any' to 'Object'
193
+ obj17 . foo1 ;
194
+ obj17 . foo2 ;
195
+ }
196
+
197
+ var obj18 : any ;
198
+ if ( obj18 instanceof Function ) { // can't narrow type from 'any' to 'Function'
199
+ obj18 . foo1 ;
200
+ obj18 . foo2 ;
201
+ }
0 commit comments