29 lines
1.4 KiB
Plaintext
29 lines
1.4 KiB
Plaintext
tests/cases/compiler/noImplicitAnyForMethodParameters.ts(6,5): error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type.
|
|
tests/cases/compiler/noImplicitAnyForMethodParameters.ts(6,16): error TS7006: Parameter 'a' implicitly has an 'any' type.
|
|
tests/cases/compiler/noImplicitAnyForMethodParameters.ts(10,17): error TS7006: Parameter 'a' implicitly has an 'any' type.
|
|
tests/cases/compiler/noImplicitAnyForMethodParameters.ts(13,16): error TS7006: Parameter 'a' implicitly has an 'any' type.
|
|
|
|
|
|
==== tests/cases/compiler/noImplicitAnyForMethodParameters.ts (4 errors) ====
|
|
declare class A {
|
|
private foo(a); // OK - ambient class and private method - no error
|
|
}
|
|
|
|
declare class B {
|
|
public foo(a); // OK - ambient class and public method - error
|
|
~~~~~~~~~~~~~~
|
|
!!! error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type.
|
|
~
|
|
!!! error TS7006: Parameter 'a' implicitly has an 'any' type.
|
|
}
|
|
|
|
class C {
|
|
private foo(a) { } // OK - non-ambient class and private method - error
|
|
~
|
|
!!! error TS7006: Parameter 'a' implicitly has an 'any' type.
|
|
}
|
|
class D {
|
|
public foo(a) { } // OK - non-ambient class and public method - error
|
|
~
|
|
!!! error TS7006: Parameter 'a' implicitly has an 'any' type.
|
|
} |