File: classPropertyAsProtected.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (50 lines) | stat: -rw-r--r-- 2,972 bytes parent folder | download
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
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(15,3): error TS2445: Property 'x' is protected and only accessible within class 'C' and its subclasses.
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(16,3): error TS2445: Property 'y' is protected and only accessible within class 'C' and its subclasses.
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(17,3): error TS2445: Property 'y' is protected and only accessible within class 'C' and its subclasses.
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(18,3): error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses.
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(20,3): error TS2445: Property 'a' is protected and only accessible within class 'C' and its subclasses.
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(21,3): error TS2445: Property 'b' is protected and only accessible within class 'C' and its subclasses.
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(22,3): error TS2445: Property 'b' is protected and only accessible within class 'C' and its subclasses.
tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(23,3): error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses.


==== tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts (8 errors) ====
    class C {
        protected x: string;
        protected get y() { return null; }
        protected set y(x) { }
        protected foo() { }
    
        protected static a: string;
        protected static get b() { return null; }
        protected static set b(x) { }
        protected static foo() { }
    }
    
    var c: C;
    // all errors
    c.x;
      ~
!!! error TS2445: Property 'x' is protected and only accessible within class 'C' and its subclasses.
    c.y;
      ~
!!! error TS2445: Property 'y' is protected and only accessible within class 'C' and its subclasses.
    c.y = 1;
      ~
!!! error TS2445: Property 'y' is protected and only accessible within class 'C' and its subclasses.
    c.foo();
      ~~~
!!! error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses.
    
    C.a;
      ~
!!! error TS2445: Property 'a' is protected and only accessible within class 'C' and its subclasses.
    C.b();
      ~
!!! error TS2445: Property 'b' is protected and only accessible within class 'C' and its subclasses.
    C.b = 1;
      ~
!!! error TS2445: Property 'b' is protected and only accessible within class 'C' and its subclasses.
    C.foo();
      ~~~
!!! error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses.