File: implementingAnInterfaceExtendingClassWithPrivates.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 (48 lines) | stat: -rw-r--r-- 2,429 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
39
40
41
42
43
44
45
46
47
48
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.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/implementingAnInterfaceExtendingClassWithPrivates.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/implementingAnInterfaceExtendingClassWithPrivates.ts(16,7): error TS2420: Class 'Bar3' incorrectly implements interface 'I'.
  Property 'x' is private in type 'I' but not in type 'Bar3'.
tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(21,7): error TS2420: Class 'Bar4' incorrectly implements interface 'I'.
  Types have separate declarations of a private property 'x'.


==== tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts (4 errors) ====
    class Foo {
        private 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/implementingAnInterfaceExtendingClassWithPrivates.ts:2:13: 'x' is declared here.
        y: number;
    }
    
    class Bar3 implements I { // error
          ~~~~
!!! error TS2420: Class 'Bar3' incorrectly implements interface 'I'.
!!! error TS2420:   Property 'x' is private in type 'I' but not in type 'Bar3'.
        x: string;
        y: number;
    }
    
    class Bar4 implements I { // error
          ~~~~
!!! error TS2420: Class 'Bar4' incorrectly implements interface 'I'.
!!! error TS2420:   Types have separate declarations of a private property 'x'.
        private x: string;
        y: number;
    }