34 lines
No EOL
980 B
Text
34 lines
No EOL
980 B
Text
==== tests/cases/compiler/noImplicitAnyFunctions.ts (5 errors) ====
|
|
|
|
declare function f1();
|
|
~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! 'f1', which lacks return-type annotation, implicitly has an 'any' return type.
|
|
|
|
declare function f2(): any;
|
|
|
|
function f3(x) {
|
|
~
|
|
!!! Parameter 'x' implicitly has an 'any' type.
|
|
}
|
|
|
|
function f4(x: any) {
|
|
return x;
|
|
}
|
|
|
|
function f5(x: any): any {
|
|
return x;
|
|
}
|
|
|
|
function f6(x: string, y: number);
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! 'f6', which lacks return-type annotation, implicitly has an 'any' return type.
|
|
function f6(x: string, y: string): any;
|
|
function f6(x: string, y) {
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
~
|
|
!!! Parameter 'y' implicitly has an 'any' type.
|
|
return null;
|
|
~~~~~~~~~~~~~~~~
|
|
}
|
|
~
|
|
!!! 'f6', which lacks return-type annotation, implicitly has an 'any' return type. |