23 lines
No EOL
1.1 KiB
Text
23 lines
No EOL
1.1 KiB
Text
tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts(2,5): error TS7005: Variable 'x' implicitly has an 'any' type.
|
|
tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts(3,13): error TS7005: Variable 'foo' implicitly has an 'any' type.
|
|
tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts(4,15): error TS7006: Parameter 'k' implicitly has an 'any' type.
|
|
|
|
|
|
==== 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; |