File: implementingAnInterfaceExtendingClassWithProtecteds.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 (76 lines) | stat: -rw-r--r-- 3,875 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
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(9,7): error TS2420: Class 'Bar' incorrectly implements interface 'I'.
  Type 'Bar' is missing the following properties from type 'I': y, x
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(12,7): error TS2420: Class 'Bar2' incorrectly implements interface 'I'.
  Property 'x' is missing in type 'Bar2' but required in type 'I'.
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(16,7): error TS2420: Class 'Bar3' incorrectly implements interface 'I'.
  Property 'x' is protected but type 'Bar3' is not a class derived from 'Foo'.
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(21,7): error TS2420: Class 'Bar4' incorrectly implements interface 'I'.
  Property 'x' is protected but type 'Bar4' is not a class derived from 'Foo'.
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(26,7): error TS2420: Class 'Bar5' incorrectly implements interface 'I'.
  Property 'y' is missing in type 'Bar5' but required in type 'I'.
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(29,7): error TS2420: Class 'Bar6' incorrectly implements interface 'I'.
  Property 'y' is protected in type 'Bar6' but public in type 'I'.


==== tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts (6 errors) ====
    class Foo {
        protected x: string;
    }
    
    interface I extends Foo {
        y: number;
    }
    
    class Bar implements I { // error
          ~~~
!!! error TS2420: Class 'Bar' incorrectly implements interface 'I'.
!!! error TS2420:   Type 'Bar' is missing the following properties from type 'I': y, x
    }
    
    class Bar2 implements I { // error
          ~~~~
!!! error TS2420: Class 'Bar2' incorrectly implements interface 'I'.
!!! error TS2420:   Property 'x' is missing in type 'Bar2' but required in type 'I'.
!!! related TS2728 tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts:2:15: 'x' is declared here.
        y: number;
    }
    
    class Bar3 implements I { // error
          ~~~~
!!! error TS2420: Class 'Bar3' incorrectly implements interface 'I'.
!!! error TS2420:   Property 'x' is protected but type 'Bar3' is not a class derived from 'Foo'.
        x: string;
        y: number;
    }
    
    class Bar4 implements I { // error
          ~~~~
!!! error TS2420: Class 'Bar4' incorrectly implements interface 'I'.
!!! error TS2420:   Property 'x' is protected but type 'Bar4' is not a class derived from 'Foo'.
        protected x: string;
        y: number;
    }
    
    class Bar5 extends Foo implements I { // error
          ~~~~
!!! error TS2420: Class 'Bar5' incorrectly implements interface 'I'.
!!! error TS2420:   Property 'y' is missing in type 'Bar5' but required in type 'I'.
!!! related TS2728 tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts:6:5: 'y' is declared here.
    }
    
    class Bar6 extends Foo implements I { // error
          ~~~~
!!! error TS2420: Class 'Bar6' incorrectly implements interface 'I'.
!!! error TS2420:   Property 'y' is protected in type 'Bar6' but public in type 'I'.
        protected y: number;
    }
    
    class Bar7 extends Foo implements I {
        y: number;
    }
    
    class Bar8 extends Foo implements I {
        x: string;
        y: number;
    }