Update tests

This commit is contained in:
Anders Hejlsberg 2016-10-13 13:29:08 -07:00
parent bf301e9ccc
commit bfa4197ffe
2 changed files with 13 additions and 7 deletions

View File

@ -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
}
}

View File

@ -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() {