mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 20:14:01 -06:00
Update tests
This commit is contained in:
parent
bf301e9ccc
commit
bfa4197ffe
@ -3,16 +3,16 @@
|
||||
declare function cond(): boolean;
|
||||
|
||||
function f1() {
|
||||
let x = [];
|
||||
let y = x; // Implicit any[] error
|
||||
let x = []; // Implicit any[] error in some locations
|
||||
let y = x; // Implicit any[] error
|
||||
x.push(5);
|
||||
let z = x;
|
||||
}
|
||||
|
||||
function f2() {
|
||||
let x;
|
||||
let x; // Implicit any[] error in some locations
|
||||
x = [];
|
||||
let y = x; // Implicit any[] error
|
||||
let y = x; // Implicit any[] error
|
||||
x.push(5);
|
||||
let z = x;
|
||||
}
|
||||
@ -21,7 +21,7 @@ function f3() {
|
||||
let x = []; // Implicit any[] error in some locations
|
||||
x.push(5);
|
||||
function g() {
|
||||
x; // Implicit any[] error
|
||||
x; // Implicit any[] error
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -115,13 +115,19 @@ function f10() {
|
||||
|
||||
function f11() {
|
||||
let x = [];
|
||||
return x; // never[]
|
||||
if (x.length === 0) { // x.length ok on implicit any[]
|
||||
x.push("hello");
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
function f12() {
|
||||
let x;
|
||||
x = [];
|
||||
return x; // never[]
|
||||
if (x.length === 0) { // x.length ok on implicit any[]
|
||||
x.push("hello");
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
function f13() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user