File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 3
3
declare function cond ( ) : boolean ;
4
4
5
5
function f1 ( ) {
6
- let x = [ ] ;
7
- let y = x ; // Implicit any[] error
6
+ let x = [ ] ; // Implicit any[] error in some locations
7
+ let y = x ; // Implicit any[] error
8
8
x . push ( 5 ) ;
9
9
let z = x ;
10
10
}
11
11
12
12
function f2 ( ) {
13
- let x ;
13
+ let x ; // Implicit any[] error in some locations
14
14
x = [ ] ;
15
- let y = x ; // Implicit any[] error
15
+ let y = x ; // Implicit any[] error
16
16
x . push ( 5 ) ;
17
17
let z = x ;
18
18
}
@@ -21,7 +21,7 @@ function f3() {
21
21
let x = [ ] ; // Implicit any[] error in some locations
22
22
x . push ( 5 ) ;
23
23
function g ( ) {
24
- x ; // Implicit any[] error
24
+ x ; // Implicit any[] error
25
25
}
26
26
}
27
27
Original file line number Diff line number Diff line change @@ -115,13 +115,19 @@ function f10() {
115
115
116
116
function f11 ( ) {
117
117
let x = [ ] ;
118
- return x ; // never[]
118
+ if ( x . length === 0 ) { // x.length ok on implicit any[]
119
+ x . push ( "hello" ) ;
120
+ }
121
+ return x ;
119
122
}
120
123
121
124
function f12 ( ) {
122
125
let x ;
123
126
x = [ ] ;
124
- return x ; // never[]
127
+ if ( x . length === 0 ) { // x.length ok on implicit any[]
128
+ x . push ( "hello" ) ;
129
+ }
130
+ return x ;
125
131
}
126
132
127
133
function f13 ( ) {
You can’t perform that action at this time.
0 commit comments