File: implicitAnyDeclareTypePropertyWithoutType.errors.txt

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (38 lines) | stat: -rw-r--r-- 2,014 bytes parent folder | download | duplicates (2)
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/implicitAnyDeclareTypePropertyWithoutType.ts(6,10): error TS7008: Member 'y' implicitly has an 'any' type.
tests/cases/compiler/implicitAnyDeclareTypePropertyWithoutType.ts(6,13): error TS7008: Member 'z' implicitly has an 'any' type.
tests/cases/compiler/implicitAnyDeclareTypePropertyWithoutType.ts(7,18): error TS7008: Member 'z1' implicitly has an 'any' type.
tests/cases/compiler/implicitAnyDeclareTypePropertyWithoutType.ts(8,12): error TS7013: Construct signature, which lacks return-type annotation, implicitly has an 'any' return type.
tests/cases/compiler/implicitAnyDeclareTypePropertyWithoutType.ts(9,10): error TS7006: Parameter 'y2' implicitly has an 'any' type.
tests/cases/compiler/implicitAnyDeclareTypePropertyWithoutType.ts(10,22): error TS7006: Parameter 'y3' implicitly has an 'any' type.


==== tests/cases/compiler/implicitAnyDeclareTypePropertyWithoutType.ts (6 errors) ====
    class C {
        constructor() { }
    }
    
    // this should be an error
    var x: { y; z; }             // error at "y,z"
             ~~
!!! error TS7008: Member 'y' implicitly has an 'any' type.
                ~~
!!! error TS7008: Member 'z' implicitly has an 'any' type.
    var x1: { y1: C; z1; };      // error at "z1" 
                     ~~~
!!! error TS7008: Member 'z1' implicitly has an 'any' type.
    var x11: { new (); };        // error at "new"
               ~~~~~~~
!!! error TS7013: Construct signature, which lacks return-type annotation, implicitly has an 'any' return type.
    var x2: (y2) => number;      // error at "y2"
             ~~
!!! error TS7006: Parameter 'y2' implicitly has an 'any' type.
    var x3: (x3: string, y3) => void ; // error at "y3"
                         ~~
!!! error TS7006: Parameter 'y3' implicitly has an 'any' type.
    
    // this should not be an error
    var bar: { a: number; b: number };
    var foo: { littleC: C; c: string };
    var x4: new () => any;
    var x5: () => any;