File: inheritance1.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 (124 lines) | stat: -rw-r--r-- 5,100 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
tests/cases/compiler/inheritance1.ts(14,7): error TS2420: Class 'ImageBase' incorrectly implements interface 'SelectableControl'.
  Property 'select' is missing in type 'ImageBase'.
tests/cases/compiler/inheritance1.ts(18,7): error TS2420: Class 'Locations' incorrectly implements interface 'SelectableControl'.
  Property 'state' is missing in type 'Locations'.
tests/cases/compiler/inheritance1.ts(31,1): error TS2322: Type 'Control' is not assignable to type 'Button'.
  Property 'select' is missing in type 'Control'.
tests/cases/compiler/inheritance1.ts(37,1): error TS2322: Type 'Control' is not assignable to type 'TextBox'.
  Property 'select' is missing in type 'Control'.
tests/cases/compiler/inheritance1.ts(40,1): error TS2322: Type 'ImageBase' is not assignable to type 'SelectableControl'.
  Property 'select' is missing in type 'ImageBase'.
tests/cases/compiler/inheritance1.ts(46,1): error TS2322: Type 'Image1' is not assignable to type 'SelectableControl'.
  Property 'select' is missing in type 'Image1'.
tests/cases/compiler/inheritance1.ts(52,1): error TS2322: Type 'Locations' is not assignable to type 'SelectableControl'.
  Property 'state' is missing in type 'Locations'.
tests/cases/compiler/inheritance1.ts(53,1): error TS2322: Type 'Locations' is not assignable to type 'Control'.
  Property 'state' is missing in type 'Locations'.
tests/cases/compiler/inheritance1.ts(55,1): error TS2322: Type 'Control' is not assignable to type 'Locations'.
  Property 'select' is missing in type 'Control'.
tests/cases/compiler/inheritance1.ts(58,1): error TS2322: Type 'Locations1' is not assignable to type 'SelectableControl'.
  Property 'state' is missing in type 'Locations1'.
tests/cases/compiler/inheritance1.ts(59,1): error TS2322: Type 'Locations1' is not assignable to type 'Control'.
  Property 'state' is missing in type 'Locations1'.
tests/cases/compiler/inheritance1.ts(61,1): error TS2322: Type 'Control' is not assignable to type 'Locations1'.
  Property 'select' is missing in type 'Control'.


==== tests/cases/compiler/inheritance1.ts (12 errors) ====
    class Control {
        private state: any;
    }
    interface SelectableControl extends Control {
        select(): void;
    }
    
    class Button extends Control implements SelectableControl {
        select() { }
    }
    class TextBox extends Control {
        select() { }
    }
    class ImageBase extends Control implements SelectableControl{
          ~~~~~~~~~
!!! error TS2420: Class 'ImageBase' incorrectly implements interface 'SelectableControl'.
!!! error TS2420:   Property 'select' is missing in type 'ImageBase'.
    }
    class Image1 extends Control {
    }
    class Locations implements SelectableControl {
          ~~~~~~~~~
!!! error TS2420: Class 'Locations' incorrectly implements interface 'SelectableControl'.
!!! error TS2420:   Property 'state' is missing in type 'Locations'.
        select() { }
    }
    class Locations1 {
        select() { }
    }
    var sc: SelectableControl;
    var c: Control;
    
    var b: Button;
    sc = b;
    c = b;
    b = sc;
    b = c;
    ~
!!! error TS2322: Type 'Control' is not assignable to type 'Button'.
!!! error TS2322:   Property 'select' is missing in type 'Control'.
    
    var t: TextBox;
    sc = t;
    c = t;
    t = sc;
    t = c;
    ~
!!! error TS2322: Type 'Control' is not assignable to type 'TextBox'.
!!! error TS2322:   Property 'select' is missing in type 'Control'.
    
    var i: ImageBase;
    sc = i;
    ~~
!!! error TS2322: Type 'ImageBase' is not assignable to type 'SelectableControl'.
!!! error TS2322:   Property 'select' is missing in type 'ImageBase'.
    c = i;
    i = sc;
    i = c;
    
    var i1: Image1;
    sc = i1;
    ~~
!!! error TS2322: Type 'Image1' is not assignable to type 'SelectableControl'.
!!! error TS2322:   Property 'select' is missing in type 'Image1'.
    c = i1;
    i1 = sc;
    i1 = c;
    
    var l: Locations;
    sc = l;
    ~~
!!! error TS2322: Type 'Locations' is not assignable to type 'SelectableControl'.
!!! error TS2322:   Property 'state' is missing in type 'Locations'.
    c = l;
    ~
!!! error TS2322: Type 'Locations' is not assignable to type 'Control'.
!!! error TS2322:   Property 'state' is missing in type 'Locations'.
    l = sc;
    l = c;
    ~
!!! error TS2322: Type 'Control' is not assignable to type 'Locations'.
!!! error TS2322:   Property 'select' is missing in type 'Control'.
    
    var l1: Locations1;
    sc = l1;
    ~~
!!! error TS2322: Type 'Locations1' is not assignable to type 'SelectableControl'.
!!! error TS2322:   Property 'state' is missing in type 'Locations1'.
    c = l1;
    ~
!!! error TS2322: Type 'Locations1' is not assignable to type 'Control'.
!!! error TS2322:   Property 'state' is missing in type 'Locations1'.
    l1 = sc;
    l1 = c;
    ~~
!!! error TS2322: Type 'Control' is not assignable to type 'Locations1'.
!!! error TS2322:   Property 'select' is missing in type 'Control'.