23 lines
No EOL
825 B
Text
23 lines
No EOL
825 B
Text
==== 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
|
|
~~~~~~~~~~~~~~
|
|
!!! 'foo', which lacks return-type annotation, implicitly has an 'any' return type.
|
|
~
|
|
!!! Parameter 'a' implicitly has an 'any' type.
|
|
}
|
|
|
|
class C {
|
|
private foo(a) { } // OK - non-ambient class and private method - error
|
|
~
|
|
!!! Parameter 'a' implicitly has an 'any' type.
|
|
}
|
|
class D {
|
|
public foo(a) { } // OK - non-ambient class and public method - error
|
|
~
|
|
!!! Parameter 'a' implicitly has an 'any' type.
|
|
} |