diff --git a/tests/cases/compiler/anyPlusAny1.ts b/tests/cases/compiler/anyPlusAny1.ts index 084dcc02be3..c1bee9b97b0 100644 --- a/tests/cases/compiler/anyPlusAny1.ts +++ b/tests/cases/compiler/anyPlusAny1.ts @@ -1,3 +1,3 @@ -var x; +var x: any; x.name = "hello"; var z = x + x; \ No newline at end of file diff --git a/tests/cases/compiler/expr.ts b/tests/cases/compiler/expr.ts index b76aba88103..8d6f7beed7e 100644 --- a/tests/cases/compiler/expr.ts +++ b/tests/cases/compiler/expr.ts @@ -6,7 +6,7 @@ enum E { } function f() { - var a; + var a: any; var n=3; var s=""; var b=false; diff --git a/tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts b/tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts index 88812001c9e..a84ab03f4b3 100644 --- a/tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts +++ b/tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts @@ -1,8 +1,9 @@ // @noimplicitany: true // this should be an error -var x; // error at "x" -declare var foo; // error at "foo" -function func(k) { }; //error at "k" +var x; // no error, control flow typed +var y; // error because captured +declare var foo; // error at "foo" +function func(k) { y }; // error at "k" func(x); // this shouldn't be an error diff --git a/tests/cases/conformance/Symbols/ES5SymbolProperty2.ts b/tests/cases/conformance/Symbols/ES5SymbolProperty2.ts index 07c95eb27d9..6bfce5fc58d 100644 --- a/tests/cases/conformance/Symbols/ES5SymbolProperty2.ts +++ b/tests/cases/conformance/Symbols/ES5SymbolProperty2.ts @@ -1,6 +1,6 @@ //@target: ES5 module M { - var Symbol; + var Symbol: any; export class C { [Symbol.iterator]() { } diff --git a/tests/cases/conformance/Symbols/ES5SymbolProperty3.ts b/tests/cases/conformance/Symbols/ES5SymbolProperty3.ts index 262e47557f8..a6eecc72124 100644 --- a/tests/cases/conformance/Symbols/ES5SymbolProperty3.ts +++ b/tests/cases/conformance/Symbols/ES5SymbolProperty3.ts @@ -1,5 +1,5 @@ //@target: ES5 -var Symbol; +var Symbol: any; class C { [Symbol.iterator]() { } diff --git a/tests/cases/conformance/es6/for-ofStatements/for-of3.ts b/tests/cases/conformance/es6/for-ofStatements/for-of3.ts index 7eb1e1fd220..850daee8368 100644 --- a/tests/cases/conformance/es6/for-ofStatements/for-of3.ts +++ b/tests/cases/conformance/es6/for-ofStatements/for-of3.ts @@ -1,3 +1,3 @@ //@target: ES6 -var v; +var v: any; for (v++ of []) { } \ No newline at end of file diff --git a/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsReference.ts b/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsReference.ts index 02e6acfa685..7339704fc65 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsReference.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsReference.ts @@ -1,4 +1,4 @@ -var value; +var value: any; // identifiers: variable and parameter var x1: number; diff --git a/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts b/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts index 0eac581bfe4..176c2043344 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts @@ -1,5 +1,5 @@ // expected error for all the LHS of compound assignments (arithmetic and addition) -var value; +var value: any; // this class C { diff --git a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts index e5118d18551..13f5ce14e7d 100644 --- a/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts +++ b/tests/cases/conformance/es7/exponentiationOperator/exponentiationOperatorSyntaxError2.ts @@ -1,7 +1,7 @@ // @target: es5 // Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () -var temp; +var temp: any; delete --temp ** 3; delete ++temp ** 3; diff --git a/tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsReference.ts b/tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsReference.ts index de5dbf6d747..91db91a3a9b 100644 --- a/tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsReference.ts +++ b/tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsReference.ts @@ -1,4 +1,4 @@ -var value; +var value: any; // identifiers: variable and parameter var x1: number; diff --git a/tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts b/tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts index 467a750b418..30b8df4268a 100644 --- a/tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts +++ b/tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts @@ -1,5 +1,5 @@ // expected error for all the LHS of assignments -var value; +var value: any; // this class C { diff --git a/tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts b/tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts index 62311ee75c9..8eb50d2f64a 100644 --- a/tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts +++ b/tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts @@ -1,7 +1,7 @@ // @allowUnusedLabels: true // expected error for all the LHS of compound assignments (arithmetic and addition) -var value; +var value: any; // this class C { diff --git a/tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherType.ts b/tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherType.ts index 4ca37129f60..f8efeb81ecb 100644 --- a/tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherType.ts +++ b/tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherType.ts @@ -1,7 +1,7 @@ // -- operator on any type var ANY: any; -var ANY1; +var ANY1: any; var ANY2: any[] = ["", ""]; var obj = {x:1,y:null}; class A { diff --git a/tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts b/tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts index 10dc05a4a33..d5dd62de442 100644 --- a/tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts +++ b/tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts @@ -1,5 +1,5 @@ // -- operator on any type -var ANY1; +var ANY1: any; var ANY2: any[] = ["", ""]; var obj: () => {} @@ -10,7 +10,7 @@ function foo(): any { } class A { public a: any; - static foo() { + static foo(): any { var a; return a; } diff --git a/tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherType.ts b/tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherType.ts index f1fa058745f..09f272442e1 100644 --- a/tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherType.ts +++ b/tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherType.ts @@ -1,7 +1,7 @@ // ++ operator on any type var ANY: any; -var ANY1; +var ANY1: any; var ANY2: any[] = ["", ""]; var obj = {x:1,y:null}; class A { diff --git a/tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts b/tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts index 2e6b14d7727..397024d45d6 100644 --- a/tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts +++ b/tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts @@ -1,5 +1,5 @@ // ++ operator on any type -var ANY1; +var ANY1: any; var ANY2: any[] = [1, 2]; var obj: () => {} @@ -10,7 +10,7 @@ function foo(): any { } class A { public a: any; - static foo() { + static foo(): any { var a; return a; } diff --git a/tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts b/tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts index 189f1f000d8..d29b1a845eb 100644 --- a/tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts +++ b/tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts @@ -1,7 +1,7 @@ // - operator on any type var ANY: any; -var ANY1; +var ANY1: any; var ANY2: any[] = ["", ""]; var obj: () => {} var obj1 = { x: "", y: () => { }}; @@ -12,7 +12,7 @@ function foo(): any { } class A { public a: any; - static foo() { + static foo(): any { var a; return a; } diff --git a/tests/cases/conformance/statements/for-inStatements/for-inStatements.ts b/tests/cases/conformance/statements/for-inStatements/for-inStatements.ts index 1ff19b3e412..89cc0314d36 100644 --- a/tests/cases/conformance/statements/for-inStatements/for-inStatements.ts +++ b/tests/cases/conformance/statements/for-inStatements/for-inStatements.ts @@ -14,7 +14,7 @@ for (var x in fn()) { } for (var x in /[a-z]/) { } for (var x in new Date()) { } -var c, d, e; +var c: any, d: any, e: any; for (var x in c || d) { } for (var x in e ? c : d) { }