File: implicitAnyInAmbientDeclaration2.d.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (38 lines) | stat: -rw-r--r-- 2,434 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(1,18): error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type.
tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(1,22): error TS7006: Parameter 'x' implicitly has an 'any' type.
tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(2,13): error TS7005: Variable 'bar' implicitly has an 'any' type.
tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(4,12): error TS7008: Member 'publicMember' implicitly has an 'any' type.
tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(7,12): error TS7010: 'publicFunction', which lacks return-type annotation, implicitly has an 'any' return type.
tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(7,27): error TS7006: Parameter 'x' implicitly has an 'any' type.
tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(13,24): error TS7006: Parameter 'publicConsParam' implicitly has an 'any' type.


==== tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts (7 errors) ====
    declare function foo(x);  // this should be an error
                     ~~~
!!! error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type.
                         ~
!!! error TS7006: Parameter 'x' implicitly has an 'any' type.
    declare var bar;  // this should be be an erro
                ~~~
!!! error TS7005: Variable 'bar' implicitly has an 'any' type.
    declare class C {
        public publicMember;  // this should be an error
               ~~~~~~~~~~~~
!!! error TS7008: Member 'publicMember' implicitly has an 'any' type.
        private privateMember;  // this should not be an error
    
        public publicFunction(x);  // this should be an error
               ~~~~~~~~~~~~~~
!!! error TS7010: 'publicFunction', which lacks return-type annotation, implicitly has an 'any' return type.
                              ~
!!! error TS7006: Parameter 'x' implicitly has an 'any' type.
        private privateFunction(privateParam);  // this should not be an error
        private constructor(privateParam);  // this should not be an error
    }
    
    declare class D {
        public constructor(publicConsParam, int: number);  // this should be an error
                           ~~~~~~~~~~~~~~~
!!! error TS7006: Parameter 'publicConsParam' implicitly has an 'any' type.
    }