File: enumAssignmentCompat2.errors.txt

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (55 lines) | stat: -rw-r--r-- 1,668 bytes parent folder | download | duplicates (3)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
tests/cases/compiler/enumAssignmentCompat2.ts(25,5): error TS2322: Type 'typeof W' is not assignable to type 'number'.
tests/cases/compiler/enumAssignmentCompat2.ts(27,5): error TS2322: Type 'W.a' is not assignable to type 'typeof W'.
tests/cases/compiler/enumAssignmentCompat2.ts(29,5): error TS2322: Type '3' is not assignable to type 'typeof W'.
tests/cases/compiler/enumAssignmentCompat2.ts(31,5): error TS2322: Type 'W.a' is not assignable to type 'WStatic'.
tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type '5' is not assignable to type 'WStatic'.


==== tests/cases/compiler/enumAssignmentCompat2.ts (5 errors) ====
    enum W {
    
        a, b, c,
    
    }
    
    module W {
        export class D { }
    }
    
    interface WStatic {
    
        a: W;
    
        b: W;
    
        c: W;
    
    }
    
    
    
    var x: WStatic = W;
    var y: typeof W = W;
    var z: number = W; // error
        ~
!!! error TS2322: Type 'typeof W' is not assignable to type 'number'.
    var a: number = W.a;
    var b: typeof W = W.a; // error
        ~
!!! error TS2322: Type 'W.a' is not assignable to type 'typeof W'.
    var c: typeof W.a = W.a;
    var d: typeof W = 3; // error
        ~
!!! error TS2322: Type '3' is not assignable to type 'typeof W'.
    var e: typeof W.a = 4;
    var f: WStatic = W.a; // error
        ~
!!! error TS2322: Type 'W.a' is not assignable to type 'WStatic'.
    var g: WStatic = 5; // error
        ~
!!! error TS2322: Type '5' is not assignable to type 'WStatic'.
    var h: W = 3;
    var i: W = W.a;
    i = W.a;
    W.D;
    var p: W.D;