44 lines
No EOL
3.1 KiB
Text
44 lines
No EOL
3.1 KiB
Text
tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts(2,15): error TS7006: Parameter 'l1' implicitly has an 'any' type.
|
|
tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts(3,15): error TS7006: Parameter 'll1' implicitly has an 'any' type.
|
|
tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts(4,33): error TS7006: Parameter 'myParam' implicitly has an 'any' type.
|
|
tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts(5,14): error TS7011: Function expression, which lacks return-type annotation, implicitly has an 'any' return type.
|
|
tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts(8,15): error TS7010: 'temp', which lacks return-type annotation, implicitly has an 'any' return type.
|
|
tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts(9,15): error TS7011: Function expression, which lacks return-type annotation, implicitly has an 'any' return type.
|
|
tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts(10,15): error TS7010: 'temp', which lacks return-type annotation, implicitly has an 'any' return type.
|
|
tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts(11,15): error TS7011: Function expression, which lacks return-type annotation, implicitly has an 'any' return type.
|
|
|
|
|
|
==== tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts (8 errors) ====
|
|
// these should be errors for implicit any parameter
|
|
var lambda = (l1) => { }; // Error at "l1"
|
|
~~
|
|
!!! error TS7006: Parameter 'l1' implicitly has an 'any' type.
|
|
var lambd2 = (ll1, ll2: string) => { } // Error at "ll1"
|
|
~~~
|
|
!!! error TS7006: Parameter 'll1' implicitly has an 'any' type.
|
|
var lamda3 = function myLambda3(myParam) { }
|
|
~~~~~~~
|
|
!!! error TS7006: Parameter 'myParam' implicitly has an 'any' type.
|
|
var lamda4 = () => { return null };
|
|
~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS7011: Function expression, which lacks return-type annotation, implicitly has an 'any' return type.
|
|
|
|
// these should be error for implicit any return type
|
|
var lambda5 = function temp() { return null; }
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS7010: 'temp', which lacks return-type annotation, implicitly has an 'any' return type.
|
|
var lambda6 = () => { return null; }
|
|
~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS7011: Function expression, which lacks return-type annotation, implicitly has an 'any' return type.
|
|
var lambda7 = function temp() { return undefined; }
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS7010: 'temp', which lacks return-type annotation, implicitly has an 'any' return type.
|
|
var lambda8 = () => { return undefined; }
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS7011: Function expression, which lacks return-type annotation, implicitly has an 'any' return type.
|
|
|
|
// this shouldn't be an error
|
|
var lambda9 = () => { return 5; }
|
|
var lambda10 = function temp1() { return 5; }
|
|
|
|
|