TypeScript/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.errors.txt
2014-09-11 16:11:08 -07:00

18 lines
676 B
Plaintext

==== tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts (3 errors) ====
// this should be an error
var x; // error at "x"
~
!!! error TS7005: Variable 'x' implicitly has an 'any' type.
declare var foo; // error at "foo"
~~~
!!! error TS7005: Variable 'foo' implicitly has an 'any' type.
function func(k) { }; //error at "k"
~
!!! error TS7006: Parameter 'k' implicitly has an 'any' type.
func(x);
// this shouldn't be an error
var bar = 3;
var bar1: any;
declare var bar2: any;
var x1: any; var y1 = new x1;