File: mergedInterfacesWithInheritedPrivates2.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 (56 lines) | stat: -rw-r--r-- 2,550 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
49
50
51
52
53
54
55
56
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(17,7): error TS2420: Class 'D' incorrectly implements interface 'A'.
  Types have separate declarations of a private property 'w'.
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(23,7): error TS2415: Class 'E' incorrectly extends base class 'C2'.
  Property 'w' is private in type 'C2' but not in type 'E'.
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(23,7): error TS2420: Class 'E' incorrectly implements interface 'A'.
  Property 'x' is missing in type 'E' but required in type 'A'.
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(30,11): error TS2341: Property 'x' is private and only accessible within class 'C'.
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(31,12): error TS2341: Property 'w' is private and only accessible within class 'C2'.


==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts (5 errors) ====
    class C {
        private x: number;
    }
    
    class C2 {
        private w: number;
    }
    
    interface A extends C {
        y: string;
    }
    
    interface A extends C2 {
        z: string;
    }
    
    class D extends C implements A { // error
          ~
!!! error TS2420: Class 'D' incorrectly implements interface 'A'.
!!! error TS2420:   Types have separate declarations of a private property 'w'.
        private w: number;
        y: string;
        z: string;
    }
    
    class E extends C2 implements A { // error
          ~
!!! error TS2415: Class 'E' incorrectly extends base class 'C2'.
!!! error TS2415:   Property 'w' is private in type 'C2' but not in type 'E'.
          ~
!!! error TS2420: Class 'E' incorrectly implements interface 'A'.
!!! error TS2420:   Property 'x' is missing in type 'E' but required in type 'A'.
!!! related TS2728 tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts:2:13: 'x' is declared here.
        w: number;
        y: string;
        z: string;
    }
    
    var a: A;
    var r = a.x; // error
              ~
!!! error TS2341: Property 'x' is private and only accessible within class 'C'.
    var r2 = a.w; // error
               ~
!!! error TS2341: Property 'w' is private and only accessible within class 'C2'.