18 lines
No EOL
634 B
Text
18 lines
No EOL
634 B
Text
==== tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts (3 errors) ====
|
|
// this should be an error
|
|
var x; // error at "x"
|
|
~
|
|
!!! Variable 'x' implicitly has an 'any' type.
|
|
declare var foo; // error at "foo"
|
|
~~~
|
|
!!! Variable 'foo' implicitly has an 'any' type.
|
|
function func(k) { }; //error at "k"
|
|
~
|
|
!!! 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; |